Menu

#2 convert asm to a lookup table.

open
nobody
None
5
2003-11-30
2003-11-30
No

This should be easy for some one who gets the drifft.

/*
* This is an interpreter to handle self-modifying code.
* This is far from complete, but the most common cases
are handled.
*/

i_next:
test %esi,%esi
jns NMI
cmp $0x7fff,%ebx
jg i_done

selfmod:
/* This will be converted to a lookup table when it's
complete */
cmpb $0x4c,RAM(%ebx)
je ijmp
cmpb $0xad,RAM(%ebx)
je ilda
cmpb $0x20,RAM(%ebx)
je ijsr
cmpb $0x6c,RAM(%ebx)
je ijmpind
cmpb $0xb9,RAM(%ebx)
je ilday
....

What you do is create a table (like the dos FAT). So
that jmp %edx+ RAM(%ebx) gets the desiered result, by
making %edx point to the table.

The table it self as an example from the code above.
Have value ijmp at address(position) $0x4c.
ilda at $0xad
ijsr at $0x20
....

Think you can do it, read up on asm to find ought how
to code the table. If you don't have time please post
an example table so that I can do the work.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.