KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I just noticed some strange assembly language code of empty main method. //filename: main.c void main() { } disassembly: push ebp mov ebp,esp sub esp,0C0h; why on the earth is it reserving 192 bytes? push ebx push esi push edi ; good compiler. Its saving ebx, esi & edi values. lea edi,[ebp-0C0h] ; line 1 mov ecx,30h ; line 2 mov eax,0CCCCCCCCh ; line 3 rep stos dword ptr es:[edi] ; line 4 xor eax,eax ; returning value 0. Code following this line is explanatory. pop edi ; restoring the original states of edi,esi & ebx pop esi pop ebx mov esp,ebp pop ebp ret why on the earth is it reserving 192 bytes for function where there aren't any variables whats up with the four lines: line 1, line 2, line 3, line 4? what is it trying to do & WHY?
Tags (comma-separated)
Save Edits
Cancel