PDA

View Full Version : Use an assembler ;-)


Carpathia
November 11th, 2000, 02:12
You can use softice to assemble your instructions into a *safe* area of memory. Assuming you have CODE ON, it will show you the assembled opcode alongside each instruction.

Beware of location dependant instructions like relative jumps; you should really temporarily assemble your new code into the location where you finally intend to patch them, unless you absolutely understand what youre doing.

If softICE isnt an option, you can use an editor like hiew, (possibly hex workshop too).

Assembling instructions by hand is a task usually reserved for bored and twisted old schoolers ;-) Let the tools do the mundane work.

Check out hutchs opcode viewer (also comes with MASM32): http://carpathia.cjb.net/opcodes.exe

Regards

Carpathia

carpathia
November 11th, 2000, 09:39
incase anyone's wondering, this was supposed to be a reply to -Z-'s post about asm->hex. :-)

vgb
November 15th, 2000, 12:49
I'm very rusty with assembler - was looking at some source code and saw
"invoke OpenClipboard,hinst". Have been unable to find INVOKE in any of the opcode references, can you shed any light? Is it essentially a CALL or am I misunderstanding something?

Thanx,

VGB

carpathia
November 15th, 2000, 13:36
Quote:
vgb (11-15-2000 01:49):
I'm very rusty with assembler - was looking at some source code and saw
"invoke OpenClipboard,hinst". Have been unable to find INVOKE in any of the opcode references, can you shed any light? Is it essentially a CALL or am I misunderstanding something?

Thanx,

VGB


Invoke is a MASM macro, which pushes the given parameters onto the stack and calls the function specified as the first parameter. It is exactly the same as making the call manually, with no extra overhead.

Regards

Carpathia

vgb
November 15th, 2000, 14:22
Got it -

Thanx,

vgb