Re: How to maintain opcode/modrbym/sib tables
- From: "randyhyde@xxxxxxxxxxxxx" <spamtrap@xxxxxxxxxx>
- Date: 20 Dec 2005 16:46:41 -0800
spamtrap@xxxxxxxxxx wrote:
> How to maintain opcode/modrbym/sib tables
> ***************************************************
> Hi,
> Im writing a disassembler for PE files in C. I have almost
> understood how to do the disassembling but i dont know how to store the
> necessary information for decoding . The information inculdes opcodes,
> modrbym and sib tables.
> I have two strategies.
> One is to store everything in different arrays within the programs
> itself and search within it while disassembling.
> Second is to store these info in text files and search in them while
> disassembling.
> Both has adv and disadv. The first stratgey is good since everythin is
> in mem and faster access but will take lot of memory.
It won't take *that* much memory. And it will be better than 1,000
times faster than searching through a text file.
> The second
> strategy is good since it will take less memory but will have lot of
> disk i/o and will slow down the program.Please tell which one is good.
Reading from the file is *bad*.
>
> If anybody has a better method of doing it thats also welcome.
Perhaps if you were to explain a little better what you're trying to
do?
Opcodes map to mnemonics easy enough. As for your addressing mode
bytes, I don't see a lookup table being the solution -- construct your
output on the fly by decoding the various fields of these operands.
Cheers,
Randy Hyde
.
- References:
- How to maintain opcode/modrbym/sib tables
- From: spamtrap
- How to maintain opcode/modrbym/sib tables
- Prev by Date: Page flipping on LFB in protected mode...how??!?!
- Next by Date: Re: Need help in accessing more than 4GB memory
- Previous by thread: How to maintain opcode/modrbym/sib tables
- Next by thread: Re: How to maintain opcode/modrbym/sib tables
- Index(es):
Relevant Pages
|