有人可以給我一些真實的例子來幫助我瞭解什麼是被叫方,什麼是彙編語言來電?我已經通過了大部分資源,但仍然無法區分被調用者和調用者。 預先感謝您。 (我加入這個解釋 - 再次謝謝遺憾的代碼,我是新來的,不知道如何插入代碼,以便正常顯示!) 我想了解這段代碼 - 學習彙編的基礎知識。我想補充意見,每個命令(我相信別人像我一樣需要它太:彙編語言 - 調用約定
sub_401040 proc near
.text:00401040
.text:00401040
.text:00401040 000 push ebp ; Push the content of ebp register onto the stack
.text:00401041 004 mov ebp, esp ;Allocating 8 bytes of storage ; move the esp register content into ebp register
.text:00401043 004 push ecx
.text:00401044 008 mov eax, [ebp+8]
.text:00401047 008 push eax ; Push eax contents onto the stack
.text:00401048 00C call ds:lstrlenA
.text:0040104E 008 add eax, [ebp+0Ch]
.text:00401051 008 mov edx, eax
.text:00401053 008 mov ecx, 1 ;Set buffer address
.text:00401058 008 call sub_401000
.text:0040105D 008 mov [ebp-4], eax
.text:00401060 008 mov ecx, [ebp-4]
.text:00401063 008 shl ecx, 2
.text:00401066 008 mov [ebp-4], ecx
.text:00401069 008 mov edx, [ebp-4]
.text:0040106C 008 push edx
.text:0040106D 00C push offset aResultD ; "Result: %d\n"
.text:00401072 010 call ds:printf
.text:00401078 010 add esp, 8 ; clean up the stack by adding the size of the argument to esp register
.text:0040107B 008 mov eax, 539h
.text:00401080 008 mov esp, ebp
.text:00401082 004 pop ebp ;Restore old frame pointer
.text:00401083 000 retn ; Return near
.text:00401083 sub_401040 endp
,我讀了,爲了定義調用約定,我需要找出誰是主叫方和誰是被調用者:)我花了這麼多時間來理解邏輯:是調用ds:lstrlenA的意思是被調用者?而sub_401040是來電者?我們可以在一個程序中有多個調用約定嗎?像cdecl一起stdcall? 我不是程序員,也不是編寫代碼,我只是想了解它如何工作來幫助分析病毒。
不知道你的意思。你寫的代碼,對不對?所以你定義調用約定。你是一個從內存讀取,寫入內存,節省寄存器等 – 2013-02-19 07:41:36