I have recently tried writing a program that would replay the packets from a wireshark packet capture took during a network printing session with my Lexmark x4690. Surprisingly, it did work! Encouraged by this first working test, I made a second program that tries to break down the protocol into logical parts that make more sense than just sending a bunch of blobs. I have successfully isolated the "payload" (the printing page itself) out of the protocol and dumped it to a file that my program uses. The payload appears to be a variant of HP's PCL, and part of it seems to be explained in Lexmark's Printer Languages and Interface Technical Reference. My test program with the test payload can be downloaded here: lexprint.zip.
Compile using:
gcc -o lexprint lexprint.c
and then run it:
./lexprint <Printer IP address> printer.dat
Here is what it should look like:
aghaster@debian:~/lexprint$ ./lexprint 192.168.1.175 print.dat Server: 192.168.1.175 File: print.dat > 48 42 4E 33 00 00 00 00 01 < 48 42 4E 33 00 00 00 00 00 Connected to HBN3 server > A5 00 07 50 E0 81 00 02 00 11 < 48 42 4E 33 00 00 00 00 0C A5 00 09 50 E0 81 00 02 00 11 01 00 > A5 00 0D 50 E0 82 02 03 00 04 < 48 42 4E 33 00 00 00 00 08 A5 00 05 40 FF 80 00 00 > A5 00 09 50 E0 81 00 23 00 01 < 48 42 4E 33 00 00 00 00 08 A5 00 05 40 FF 80 00 00 > A5 00 08 50 E0 81 00 22 02 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 E0 82 02 03 00 > A5 00 06 50 E0 73 01 01 10 00 < 48 42 4E 33 00 00 00 00 08 A5 00 05 50 E0 81 00 23 > A5 00 07 50 E0 8F 20 03 01 01 < 48 42 4E 33 00 00 00 00 0B A5 00 08 50 E0 81 00 22 02 00 01 > A5 00 0B 50 E0 81 00 01 00 01 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 E0 73 01 01 10 > A5 00 07 50 E0 8F 20 03 01 00 < 48 42 4E 33 00 00 00 00 1E A5 00 1B 50 E0 8F 20 03 01 01 01 01 00 10 FB F4 CF F3 FF 7F B3 1C A7 E9 BF EB 00 FF 3F 7F > A5 00 0B 50 E0 81 00 01 00 01 < 48 42 4E 33 00 00 00 00 08 A5 00 05 50 E0 81 00 01 > A5 00 07 50 E0 81 00 05 01 16 < 48 42 4E 33 00 00 00 00 1E A5 00 1B 50 E0 8F 20 03 01 00 01 00 00 10 BF D4 5D F3 FF 7F 1F E9 9A EA FF EF 00 FF 1F 77 > A5 00 0E 50 E0 81 00 01 00 01 < 48 42 4E 33 00 00 00 00 08 A5 00 05 50 E0 81 00 01 > A5 00 0D 50 E0 84 00 01 0A 6A < 48 42 4E 33 00 00 00 00 06 A5 00 03 D4 E0 81 > A5 00 0E 50 E0 81 00 01 00 01 < 48 42 4E 33 00 00 00 00 08 A5 00 05 50 E0 81 00 01 > A5 00 06 50 05 00 00 00 00 01 < 48 42 4E 33 00 00 00 00 08 A5 00 05 50 E0 84 00 01 ... (continues, the payload is too large to paste here) < 48 42 4E 33 00 00 00 00 09 A5 00 06 10 01 00 03 CD 44 > A5 00 06 50 05 01 00 00 01 3A < 48 42 4E 33 00 00 00 00 09 A5 00 06 10 01 00 03 CD 45 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 10 01 00 03 CD 46 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 01 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 08 50 05 02 00 00 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 05 50 E0 82 02 02 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01 > A5 00 06 50 E0 73 01 01 00 00 < 48 42 4E 33 00 00 00 00 09 A5 00 06 50 05 02 00 00 01
Where <Printer IP Address> is your Lexmark printer IP address (192.168.1.175 in my case). The test payload is ten rows of the letter 'A' from notepad. For the moment the only documentation is the source code itself. I will post more when I find more, but in the meantime if anybody is interested in contributing findings and information, you are always welcome to send me an email.
This thread is here for people that want to take a look at it and contribute their findings













