 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Tue Dec 07, 2010 9:07 am Post subject: CE memory viewer |
|
|
Hello,
I've got a question about the memory viewer, I'm not asking for code in any way.
I took a better look at the source DB provides us with: unit Assemblerunit;
The first 1000 lines are only delcarions, I've got a question about these to,
Code: | type TTokenType=(
ttInvalidtoken, ttRegister8Bit,
and
type Textraopcode=(eo_none,
eo_reg0,
and
type tparam=(par_noparam, |
Are typedefs you told me , but how should I declare the things inside it?
Code: | type topcode=record
mnemonic: string;
opcode1,opcode2: textraopcode;
paramtype1,paramtype2,paramtype3: tparam;
bytes:byte;
bt1,bt2,bt3: byte; |
In C would be
Code: |
type topcode=record // I did not know this one, topcode is the array down
char mnemonic[];
textraopcode opcode1,opcode2;
tparam paramtype1,paramtype2,paramtype3;
byte bytes[];
byte bt1,bt2,bt3; // not fully clear to??? |
After those you get this
Code: | const opcodes: array [1..opcodecount] of topcode =(
{ok} (mnemonic:'AAA';opcode1:eo_none;paramtype1:par_noparam;bytes:1;bt1:$37), //no param
{ok} (mnemonic:'AAD';opcode1:eo_none;paramtype1:par_noparam;bytes:2;bt1:$d5;bt2:$0a),
{ok} (mnemonic:'AAD';opcode1:eo_ib;paramtype1:par_imm8;bytes:1;bt1:$d5),
{ok} (mnemonic:'AAM';opcode1:eo_none;paramtype1:par_noparam;bytes:2;bt1:$d4;bt2:$0a),
{ok} (mnemonic:'AAM';opcode1:eo_ib;paramtype1:par_imm8;bytes:1;bt1:$d4),
{ok} (mnemonic:'AAS';opcode1:eo_none;paramtype1:par_noparam;bytes:1;bt1:$3F),
{ok} (mnemonic:'ADC';opcode1:eo_ib;paramtype1:par_AL;paramtype2:par_imm8;bytes:1;bt1:$14),
{ok} (mnemonic:'ADC';opcode1:eo_iw;paramtype1:par_AX;paramtype2:par_imm16;bytes:2;bt1:$66;bt2:$15),
{ok} (mnemonic:'ADC';opcode1:eo_id;paramtype1:par_EAX;paramtype2:par_imm32;bytes:1;bt1:$15),
{ok} (mnemonic:'ADC';opcode1:eo_reg2;opcode2:eo_ib;paramtype1:par_rm8;paramtype2:par_imm8;bytes:1;bt1:$80),//verified
(mnemonic:'ADC';opcode1:eo_reg2;opcode2:eo_iw;paramtype1:par_rm16;paramtype2:par_imm16;bytes:2;bt1:$66;bt2:$81), |
All things things won are the structs?? above, first the above things. {ok} is that a comment?
Further I would like to ask you something about the code itself. How does it works, do you read the first byte, eg e9 (jmp) and see how many bytes it has. Some ASM opcodes eg 83(cmp) have sometimes 3 bytes sometimes 6, how can I know the differnce, I'll try to do this first, before to see if its ebx,eax, al or w/e. First I would like to see all bytes + addresses and after that finish the opcodes.
Thanks a lot for the help.[/quote] |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25785 Location: The netherlands
|
Posted: Tue Dec 07, 2010 9:23 am Post subject: |
|
|
{ok} is a comment yes, it's on instructions I have extensively tested myself
Quote: | How does it works, do you read the first byte, eg e9 (jmp) and see how many bytes it has |
No, it takes the assembler string yuo input, split it up into tokens, and then find the opcode token, then lookup that token in this array (with the help of 3 level index) and find out which version (parameter order) is required.
Then use the bytes in bt1, b2 and 3 and fill in the rest based on the parameter and eo_regX
Anyhow, before I explain the rest I believe you are looking at the wrong sourcecode for the thing you want to do.
I believe you want to convert bytes into text, which is called disassembling, so I recommend reading disassembler.pas instead _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|