I need to write some portions of binary data to the existing EXE file. But the problem is that I have written the procedure that does what I want in assembly language and compiled it with TASM. Not I need to include that binary data to my VC++ project (I'd like to declare that using '#define' statement), but what stops me is a PE EXE file header. What should I do to make compiler produce a clear binary code so I can reliably write it to any part of the EXE and it will work? I know, that the problem here is not just the header, but should I write the whole binary code in 0x... binary nibbles (it is very handy) or use the built-in assembler (which I don't like)?
Posted on 2002-06-02 10:14:54 by Maestro
I have not used TASM and don't know what the output formats are, but iirc, the output isn't compatible with M$ LINK.EXE. The code could be converted to MASM syntax, use the built-in assembler, or binary 0x0. Your choice would depend on how easy you would changes to code to be in the future - I would convert the code to MASM syntax - many here could provide help on the conversion.
Posted on 2002-06-02 10:39:37 by bitRAKE

Binary insertion can be done but its a nightmare to do and get right where either converting the TASM source code to VC inline asm or MASM format is no big deal to do.

If its a function, I would be inclined to build a module in MASM and link it into the VC program.


Posted on 2002-06-02 10:57:23 by hutch--