Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Mabinogi
You last visited: Today at 16:40

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Help] Using Asm

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2009
Posts: 359
Received Thanks: 124
[Help] Using Asm

Heya,

I'm trying to do some .dll editing. However, being a 1st year ME student, all this stuff is a lil complicated for me. I have no idea where to turn to ask some of these questions, so I'll start by asking here.

I know that "TEST" performs a bitwise and between 2 values. However, here's part of pleione.dll
Code:
 TEST EDX,EDX
JE SHORT <Address>
I see that TEST is used in a few instances like this. Do there exist any situation where that conditional jump would not be taken? I would imagine there would be... how would that be triggered?

Also, what exactly does "LEAVE" do? The definition on Wikipedia seemed to say that it behaves similarly to POP on stack memory?

And, if at some point in the code, a subroutine is called, does it run from the address called until the next RETN? In ASM, what exactly would a line like RETN 4 do? Where does the 4 get stored?

Alright... that's about all I have for now. Maybe more questions to come later. Any help would be appreciated.



lostmage333 is offline  
Old   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8
Received Thanks: 1
Starting with the 80186 processor, the ENTER and LEAVE instructions simplify the stack setup and restore instructions at the beginning and end of procedures. However, ENTER uses a lot of time. It is necessary only with nested, statically-scoped procedures. Thus, a Pascal compiler may sometimes generate ENTER. The LEAVE instruction, on the other hand, is an efficient way to do the stack cleanup. LEAVE reverses the effect of the last ENTER instruction by restoring BP and SP to their values before the procedure call.

---

The syntax for RETN and RETF is:

label: | label LABEL NEAR
statements
RETN [[constant]]

label LABEL FAR
statements
RETF [[constant]]

The RET instruction (and its RETF and RETN variations) allows an optional constant operand that specifies a number of bytes to be added to the value of the SP register after the return. This operand adjusts for arguments passed to the procedure before the call.


Augur is offline  
Old   #3
 
elite*gold: 0
Join Date: Sep 2009
Posts: 359
Received Thanks: 124
Thank you! So if I'm understanding correctly, it makes no sense to change the LEAVE. Also, changing the constant does not seem like it would do much?
lostmage333 is offline  
Closed Thread



« Previous Thread | Next Thread »



All times are GMT +1. The time now is 16:40.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.