| | |
Asm help .Please
![]() |
•
•
Join Date: May 2009
Posts: 4
Reputation:
Solved Threads: 0
For Example .I have a function that code in C++ :
and when I compile that function,so I found in asm that code :
It's my example.So when I search in other asm file,I found that asm code :
Please help me and tell me know what the real code in C++ (same my example) .And parameter to function that has address 0051F900h .Please help me
Assembly Syntax (Toggle Plain Text)
void MyFunc(int s) { struct itemRec { int code; int index; } bItem; bItem.code = 0x0000000B; bItem.index = s; __asm { push eax push edx mov ecx,0x00625388 push 00000000h lea edx,bItem push edx push 00000016h mov eax,0x00487273 call eax pop edx pop eax } }
and when I compile that function,so I found in asm that code :
Assembly Syntax (Toggle Plain Text)
push ebp mov ebp,esp sub esp,00000008h mov eax,[ebp+08h] mov dword ptr [ebp-08h],0000000Bh mov [ebp-04h],eax push eax push edx mov ecx,00625388h push 00000000h lea edx,[ebp-08h] push edx push 00000016h mov eax,0x00487273h call eax pop edx pop eax mov esp,ebp pop ebp retn
It's my example.So when I search in other asm file,I found that asm code :
Assembly Syntax (Toggle Plain Text)
push ebp mov ebp,esp sub esp,00000008h mov eax,[ebp+08h] add eax,eax mov ecx,[eax+eax+L1000D004] add eax,eax lea edx,[ebp+08h] mov [ebp+08h],ecx mov [ebp-04h],eax mov [ebp-08h],edx push eax push ecx mov ecx,ds:[00838344h] add ecx,0000843Ch add ecx,00007EBCh push ecx add ecx,0000054Ch mov eax,[ebp-08h] push eax mov eax,0051F900h call eax mov ecx,[eax+0Ch] cmp ecx,[ebp+08h] pop ecx jnz L100010A8 add eax,00000010h add ecx,[ebp-04h] mov [ecx],eax L100010A8: pop ecx pop eax mov esp,ebp pop ebp retn
Please help me and tell me know what the real code in C++ (same my example) .And parameter to function that has address 0051F900h .Please help me
•
•
Join Date: Apr 2009
Posts: 39
Reputation:
Solved Threads: 5
Either I don't know what you're asking for or this smells like homework.
Anyway the param to the function you were asking about
The C calling convention is to push arguments on the stack from right to left. So what do you think the argument passed is?
Anyway the param to the function you were asking about
Assembly Syntax (Toggle Plain Text)
mov eax,[ebp-08h] push eax mov eax,0051F900h call eax
The C calling convention is to push arguments on the stack from right to left. So what do you think the argument passed is?
•
•
Join Date: May 2009
Posts: 4
Reputation:
Solved Threads: 0
SO,I want to know how many arguments in that function,and How to use that function
for example:
void MyFunc(int s) {
struct itemRec {
int code;
int index;
} bItem;
bItem.code = 0x0000000B;
bItem.index = s;
__asm {
push eax
push edx
mov ecx,0x00625388
push 00000000h
lea edx,bItem
push edx
push 00000016h
mov eax,0x00487273
call eax
pop edx
pop eax
}
}
I really want to know how use that function ( 0x0051F900) .So because I don't know how many arguments that push to that function and code for use that function .Please help me.
In your post.You say :
So [ebp-08h] is?I don't know type of that argument.
for example:
void MyFunc(int s) {
struct itemRec {
int code;
int index;
} bItem;
bItem.code = 0x0000000B;
bItem.index = s;
__asm {
push eax
push edx
mov ecx,0x00625388
push 00000000h
lea edx,bItem
push edx
push 00000016h
mov eax,0x00487273
call eax
pop edx
pop eax
}
}
I really want to know how use that function ( 0x0051F900) .So because I don't know how many arguments that push to that function and code for use that function .Please help me.
In your post.You say :
•
•
•
•
mov eax,[ebp-08h]
push eax
mov eax,0051F900h
call eax
•
•
Join Date: May 2009
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
Either I don't know what you're asking for or this smells like homework.
Anyway the param to the function you were asking about
Assembly Syntax (Toggle Plain Text)
mov eax,[ebp-08h] push eax mov eax,0051F900h call eax
The C calling convention is to push arguments on the stack from right to left. So what do you think the argument passed is?
![]() |
Similar Threads
- intergrating ASM to C++ (C++)
- ASM Game Coding Problem/Question (Assembly)
- Starting ASM (Assembly)
- My Sample ASM Code (Assembly)
- asm in C (C++)
Other Threads in the Assembly Forum
- Previous Thread: Space Invaders
- Next Thread: New to Win32 ASM programming
| Thread Tools | Search this Thread |






Please help me