Stuff related to the LOLCODE language.
4 posts Page 1 of 1
Postby arfonzo » Fri May 09, 2014 3:42 pm
Hi all,

I'm trying to send a telnet IAC using SOCKS, could someone show me an example of how this could be done? Telnet reference:

Postby jjm » Sat May 10, 2014 1:57 am
Hi arfonzo,

First of all, be sure to post a link to your project when you get it up and running! I'll create a topic for posting/discussing random LOLCODE projects.

As for your question, one annoying thing about the current LOLCODE spec is that it doesn't have a good way of converting between decimal and ASCII. However, there is a workaround:

You can insert the ASCII character with value 255 (or anything else, like 1, 251, and so on) in a text editor and this value should remain in any strings that contain it (it will be printed with VISIBLE or sent with PUT). For example, in vim you can open the file in binary mode with the -b flag and then enter the following command to insert the ASCII character with hex value ff (decimal value 255):
Code: Select all
:r !echo -e "\xff"
This will show up as <ff> in vim and will output the value 255 in a VISIBLE statement, and it should send the value 255 with a PUT statement (though I have not yet tested this functionality).

Hope this helps.
Postby arfonzo » Sat May 10, 2014 11:28 am

Ah, perfect, thanks for that hint! I will try that method for now.

I'm working on writing a Telnet BBS in LOLCODE, I will certainly post links when it's more complete. I'm just working on the fundamentals at the moment, such as sending IAC WILL ECHO over Telnet for masking password prompts.

It would be great to be able to do this within LOLCODE, to avoid having to have loads of files, each with the various telnet IAC commands. I believe this will also need to be done in order to send ANSI escape sequences (something which most BBSes support), which could result in a horrific jumble of binary files per command.

Postby jjm » Sat May 10, 2014 2:33 pm
Oh, so you don't need a separate file for each binary, which should make your life easier. In the example that I provided you could just add the various character codes directly to your Telnet source code. One example that I tried was:
Code: Select all
HAI 1.4
    VISIBLE "<ff>"!
(where <ff> was the code entered into the source code file the way that I described in the previous post). And when I ran it I got output like this:
Code: Select all
./lci | hexdump
0000000 ff
Which should still work when transmitting data with SOCKS.
4 posts Page 1 of 1


Who is online

Users browsing this forum: No registered users and 1 guest