I have some code I would like to convert to masm.
(I think it is C++.)

I will post a little at a time if someone can help me.
The code detects usb devices plugged in.

The "asterisked" ones are what I can't convert.

Thanks.

push 74
                               
** PUSH OFFSET HWDetect.00404D78

** CALL 0040398C

xor ebx,ebx

** MOV DWORD PTR SS:,EBX
Posted on 2010-05-02 07:19:47 by skywalker
Are you allowed to "convert" someone's disassembled code?
Posted on 2010-05-02 07:22:06 by ti_mo_n

Are you allowed to "convert" someone's disassembled code?


Yes, the code and executable was posted on Code Project.
The program is only 44K, so I hope that it won't take too long.

I disassembled his C++ code.

IDA made a very large asm file, but I decided that using Ollydbg would be shorter as it has far fewer
statements to convert.

Posted on 2010-05-02 08:29:40 by skywalker
Disassembling C++ code is pretty much the worst way to convert it... use the code as-is, or understand what it's doing and port it to assembly.
Posted on 2010-05-02 10:25:56 by f0dder

use the code as-is, or understand what it's doing and port it to assembly.


Or pipe it through llvm-gcc and output to ASM :idea:
Posted on 2010-05-02 13:02:49 by SpooK


use the code as-is, or understand what it's doing and port it to assembly.


Or pipe it through llvm-gcc and output to ASM :idea:
Still a bad idea, really - why do a compile-to-asm (or disassemble-from-compiled-c++) step when you can just link against compiled C++? Both those "solutions" give you unmaintainable, incomprehensible junk.
Posted on 2010-05-02 14:53:10 by f0dder

Disassembling C++ code is pretty much the worst way to convert it... use the code as-is, or understand what it's doing and port it to assembly.


The code requires an external dll not normally found on NT systems.

There has to be a way to do it with a single executable.

Posted on 2010-05-02 18:27:31 by skywalker
Perhaps you should post a link to the CodeProject article+code - it's pretty hard to comment further without knowing any context... there's no way one could say anything about the two lines of code in your first post without sitting with the entire disassembly and spending a crazy amount of time.
Posted on 2010-05-03 00:52:14 by f0dder