| View previous topic :: View next topic |
| Author |
Message |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Wed Feb 08, 2017 2:41 pm Post subject: Doubt function assembly |
|
|
Look at this script:
| Code: |
push 10
call script2
|
I believe this script will pass 10 as parameter. If I am right, it tells me how script2 would get this argument. _________________
... |
|
| Back to top |
|
 |
mgostIH Expert Cheater
Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Wed Feb 08, 2017 3:02 pm Post subject: Re: Doubt function assembly |
|
|
| Filipe_Br wrote: | Look at this script:
| Code: |
push 10
call script2
|
I believe this script will pass 10 as parameter. If I am right, it tells me how script2 would get this argument. |
And the question is? _________________
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4710
|
Posted: Wed Feb 08, 2017 3:13 pm Post subject: |
|
|
| Code: | script2:
push ebp
mov ebp,esp
mov eax,[ebp+8]
// eax is now 0x10 (16 in dec); do whatever with it
mov esp,ebp
pop ebp
ret |
If you're smart enough to keep track of the stack yourself, establishing a stack frame isn't necessary. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Wed Feb 08, 2017 3:42 pm Post subject: |
|
|
| ParkourPenguin wrote: | | Code: | script2:
push ebp
mov ebp,esp
mov eax,[ebp+8]
// eax is now 0x10 (16 in dec); do whatever with it
mov esp,ebp
pop ebp
ret |
If you're smart enough to keep track of the stack yourself, establishing a stack frame isn't necessary. |
There is always an error in the application. I've tried several script variations, most of the error in the application. _________________
... |
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4710
|
Posted: Wed Feb 08, 2017 3:50 pm Post subject: |
|
|
I don't know what you mean by that. If you're trying to test this and it's crashing, make sure you're removing the argument from the stack.
If it still crashes, post your code so we can tell you what's wrong. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
SunBeam I post too much
Reputation: 65
Joined: 25 Feb 2005 Posts: 4023 Location: Romania
|
Posted: Wed Feb 08, 2017 3:56 pm Post subject: |
|
|
I guess he gave up on DirectX coding/hooking
Keep in mind the second script you posted is in stdcall calling convention. If you somehow need to use cdecl, you'll need to "add esp,X" after the call:
| Code: | push 10
call myfunc
add esp,4 |
BR,
Sun |
|
| Back to top |
|
 |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Feb 08, 2017 6:22 pm Post subject: |
|
|
No one wanted to point out that it is actually passing 16 as a parameter?  |
|
| Back to top |
|
 |
Filipe_Br Master Cheater
Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Feb 09, 2017 1:45 am Post subject: |
|
|
ParkourPenguin did point it out.  |
|
| Back to top |
|
 |
|