http://sandsprite.com/CodeStuff/olly_dll.html
this is where i found what i was looking for to assemble instructions to proper machine op codes......... it assembles instructions and disassemles them as well......
Olly assembler and disassembler for visual basic DLL library
Re: Olly assembler and disassembler for visual basic DLL lib
here is a little program that assembles a big instruction into proper machine opcodes.....
Code: Select all
Structure t_asmmodel; { // Model To search For assembler command
code.c[15]; // Binary code
mask.c[15]; // Mask for binary code (0: bit ignored)
length.i; // Length of code, bytes (0: empty)
jmpsize.i; // Offset size if relative jump
jmpoffset.i; // Offset relative to IP
jmppos.i; // Position of jump offset in command
EndStructure
Global cnn.t_asmmodel
txt$=Space(85)
ttt$="test word ptr cs:[00404706], 0004"+Chr(0)
l=OpenLibrary(#PB_Any,"olly.dll")
If l
*tas=GetFunction(l,"Assemble")
offsett=$1000
asmlen=CallFunctionFast(*tas,@ttt$,offsett,cnn,0,0,@txt$)
t=0
While t<asmlen
tl$=tl$+Hex(cnn\code[t])+" "
t+1
Wend
MessageRequester("machine opcodes in hex of assembler instruction TEST WORD PTR CS:[00404706], 0004",tl$)
EndIf