| View previous topic :: View next topic |
| Author |
Message |
Teh1337Bix Cheater
Reputation: 3
Joined: 22 Mar 2010 Posts: 37 Location: Australia
|
Posted: Fri Sep 24, 2010 4:49 am Post subject: What the no push word, immediate in auto assemble? |
|
|
How do you decide how many bytes to push in CE if you are using an immediate value?
Push dword 12345 won't work, neither will push word 12345. some functions take words you know, and its annoying to load the value into registers.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25952 Location: The netherlands
|
Posted: Fri Sep 24, 2010 6:01 am Post subject: |
|
|
sub esp,paramcountinbytes (0xc in this case)
mov [esp],firstparameter
mov [esp+4],second parameter (word)
mov [esp+6],third parameter (word)
mov [esp+8],fourth parameter
call function
and which function takes a word?
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Teh1337Bix Cheater
Reputation: 3
Joined: 22 Mar 2010 Posts: 37 Location: Australia
|
Posted: Fri Sep 24, 2010 10:04 am Post subject: |
|
|
| of course you could do it that way, but I regard that method as hacky. Can you still please make pushing words supported?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25952 Location: The netherlands
|
Posted: Fri Sep 24, 2010 10:19 am Post subject: |
|
|
another method would be:
| Code: |
db 66
push wordvalue
|
also, the first method I wrote isn't really that hackerish. That's the default method of stack parameter passing in 64-bit (and perhaps even faster because esp is only modified 2 times instead of 5 times)
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Sat Sep 25, 2010 11:11 am Post subject: |
|
|
TehBix,
Late to the party, but thought I'd suggest that you try it in C/C++ and ask your compiler to generate an assembly listing. I think you'll find that it either passes a DWORD despite you asking for a short or that it makes something even more hackerish than what you are calling hackerish.
Cheers
|
|
| Back to top |
|
 |
Teh1337Bix Cheater
Reputation: 3
Joined: 22 Mar 2010 Posts: 37 Location: Australia
|
Posted: Sun Sep 26, 2010 10:37 pm Post subject: |
|
|
I haven't written C++ in years, all I do now is assembly.
EDIT: Still I just think it would be a nice feature to having pushing words supported.
|
|
| Back to top |
|
 |
|