Versatile hex-to-binary routine

Started by Larry Hammick, December 14, 2007, 08:58:20 AM

Previous topic - Next topic

Larry Hammick

The attached asm file illustrates a routine called ReadD1 which reads an asciiz string containing a mixture of literal and hex material, and converts it all to binary. The demo program itself, called undump.exe, is like the "echo" command except that it can write any bytes to the console, and (as with "echo") the output may be redirected to a file, to a device, or to another command that reads standard input.

[attachment deleted by admin]

Adamanteus

#1
 I looked to program, first imagination was how it is good, excellent idea and much features. But when looked to you code  :dazzled: understood - that assembleres not respect universality. No one appropriate prototype there is, happend to write himself - much better  :lol
P. S. fixed :

[attachment deleted by admin]

Larry Hammick

Thanks Adamanteus. That's much tidier.
My mistake here:invoke GetStdHandle,-10   ; -10 = STD_INPUT_HANDLE
    mov StdErr,eax

That should use -12 = STD_ERROR_HANDLE. But it's only for the error handlers, which are just stubs in the given demonstration.

Adamanteus

#3
 Yes, but I prefer to use windows.inc, good style better that kernel mode writing   :snooty:
Also, could you answer on such question : When jump on ExitAddress - is it possible to return code, or looks on somehow not documented trick ?

Larry Hammick

Quote from: Adamanteus on December 15, 2007, 09:07:50 AMWhen jump on ExitAddress - is it possible to return code, or looks on somehow not documented trick ?
It exits with a return code in eax. It's the same as
push eax
call ExitThread

Adamanteus