Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


assemblerunit.pas

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Oct 29, 2007 2:44 pm    Post subject: assemblerunit.pas Reply with quote

I was looking through the assemblerunit.pas file in the source (I'm writing a program, and I'm curious on how to get the opcodes), and I found the following:

Code:

//opcode part (bytes)
type Textraopcode=(eo_none,
                   eo_reg0,eo_reg1,eo_reg2,eo_reg3,eo_reg4,eo_reg5,eo_reg6,eo_reg7, // /digit
                   eo_reg, //  /r
                   eo_cb,eo_cw,eo_cd,eo_cp,
                   eo_ib,eo_iw,eo_id,
                   eo_prb,eo_prw,eo_prd,
                   eo_pi
                  );


//parameter part
type tparam=(par_noparam,
             //constant
             par_1,
             par_3,
             par_al,
             par_ax,
             par_eax,
             par_cl,
             par_dx,
             par_cs,
             par_ds,
             par_es,
             par_ss,
             par_fs,
             par_gs,
             //regs
             par_r8,
             par_r16,
             par_r32,
             par_mm,
             par_xmm,
             par_st,
             par_st0,
             par_sreg,
             par_cr,
             par_dr,
             //memorylocs
             par_m8,
             par_m16,
             par_m32,
             par_m64,
             par_m80,
             par_m128,
             par_moffs8,
             par_moffs16,
             par_moffs32,
             //regs+memorylocs
             par_rm8,
             par_rm16,
             par_rm32,
             par_r32_m16,
             par_mm_m32,
             par_mm_m64,
             par_xmm_m32,
             par_xmm_m64,
             par_xmm_m128,

            //values
             par_imm8,
             par_imm16,
             par_imm32,
             //relatives
             par_rel8,
             par_rel16,
             par_rel32);


I know Pascal well enough (Computer Science I) to understand the type definitions, but I'm not exactly sure what they're all supposed to mean, why they're there, etc

I saw the gigantic opcode list, and I saw the parameters and extraopcodes being used, but I'm really not sure what they all mean; I understand the simple things like

Code:

par_ax,
par_eax,
par_al


etc, but I'm not far enough into Assembly to really understand the mm/xmm (for example).

I don't understand any of the "extraopcode" thing.

Would someone please clarify this?

~~~

On a side note, it took me long enough, but I realized how good at Delphi/Assembly DB really is. Don't ridicule me on my late discovery...
Razz
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Mon Oct 29, 2007 3:49 pm    Post subject: Reply with quote

get the intel instruction set reference book i'll help with the meaning of the instructions (e.g eo_reg1 etc...)

Anyhow, the extraopcode part is used for assembler instructions that extend the instruction into the modmr byte (e.g ADD and AND, they both have a situtation where the byte starts with 80 and then followed by a modrm where the R field constains a 0 (add) or a 4 (and) , so thats why add is defined as eo_reg0, and and as eo_reg4)

_________________
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
View user's profile Send private message MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Oct 29, 2007 4:42 pm    Post subject: Reply with quote

That would make a lot of sense if I knew what modrm meant (Google provided nothing usefull).

I understand that the last byte of the opcode is based on parameters alone (I've tested many times), and I understand that the first couple of bytes are related to the opcode--however there are some opcodes with the same names but different parameters, and I'm guessing that the extraopcode is used to help find the correct opcode.

Edit:

Ok, I've found a PDF file of the book you're talking about, and it explains everything--which I thank you quite heavily for.

Anyways, I'm going on a school trip today (out of state), so I can read up on it during then.

Muchos gracias, senor!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites