| View previous topic :: View next topic |
| Author |
Message |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Fri Sep 21, 2007 8:36 pm Post subject: |
|
|
you know what it's doing but you don't know what it's actually doing.. lolz
functions read their arguments off the stack; push puts it on the stack.
you should listen to appalsap though, she's probably right
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Sep 21, 2007 8:38 pm Post subject: |
|
|
I said I know what push does, but I said I didn't get what it was doing when it pusehd 6 and pushed 4
Edit:
Comment your codes me, I'm rusty, havn't programmed in a while... =P
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Fri Sep 21, 2007 9:37 pm Post subject: |
|
|
| Code: |
typedef int(__cdecl* nubprototype)(int arg1, int arg2);
void aaaa()
{
nubprototype nb;
nb = (nubprototype)GetProcAddress(LoadLibrary(TEXT("lol.dll")), "nub");
nb(1, 2); //you can call it like any function, no inline asm required
}
|
See the
The 1 & 2 turns into
| Code: |
push 2
push 1
call nb
|
Those are arguments. Just use appal's code.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Sep 21, 2007 10:52 pm Post subject: |
|
|
do i need arguments?
edit:
I think I'm starting to get it, if I just put like call nub, it just will call the function, but it won't keep its arguments? Btw, the nubprototype stuff?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Sep 22, 2007 7:22 am Post subject: |
|
|
| oib111 wrote: | do i need arguments?
|
... Does your function needs arguments? Damn it why do you make simple things appear hard.
_________________
|
|
| Back to top |
|
 |
Cx Master Cheater
Reputation: 0
Joined: 27 Jul 2007 Posts: 367
|
Posted: Sat Sep 22, 2007 1:54 pm Post subject: |
|
|
| UnLmtD wrote: | | oib111 wrote: | do i need arguments?
|
... Does your function needs arguments? Damn it why do you make simple things appear hard. |
He's not making simple things appear hard, he just doesn't know what an argument is.
_________________
armed with this small butterfly net
i will face the world alone
& never be lonely. |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Sep 22, 2007 5:32 pm Post subject: |
|
|
Of course he does (He should), he's working with WIN32 APIs
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Sep 22, 2007 5:59 pm Post subject: |
|
|
Are arguments basicly parameters?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Sat Sep 22, 2007 6:41 pm Post subject: |
|
|
Arguments are synonymous with parameters.
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sat Sep 22, 2007 7:39 pm Post subject: |
|
|
oh =P ok i get it....
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Sun Sep 23, 2007 6:41 am Post subject: |
|
|
He's talking about Functions, not Procedures.
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Sep 23, 2007 7:18 am Post subject: |
|
|
| Kaspersky wrote: |
He's talking about Functions, not Procedures. |
its the same...
here:
| Quote: | function DllMessage:[result type]; external 'SimpleMessageDLL.dll'
|
and with arguments:
| Quote: | function DllMessage([your atgs here]):[result type]; external 'SimpleMessageDLL.dll'
|
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Sep 23, 2007 2:15 pm Post subject: |
|
|
I think I got it now. So for example if I wanted to do this with a function in my dll that multiplies two numbers i could do something like this.
| Code: |
DWORD multiply = GetProcAddress(LoadLibrary("operators.dll"), "multiply");
__asm{
push y //push y onto stack
push x //push x onto stack
call nub
}
|
| Code: |
//multiply function in dll
int multiply(int x,y){
return x*y
}
|
Edit:
I know I should do appals way, but I was using that way as an example.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|