Function at 0x401f3c
Capabilities:
Enumerate pe sections
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x88
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x18], 0
mov dword [esp + 4], 0x40
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._CheckSize
test eax, eax
jne 0x401f74
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp + 8]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
movzx eax, word [eax]
cmp ax, 0x5a4d
je 0x401fa1
mov dword [esp], 0xc1
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x3c]
add eax, 0xf8
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._CheckSize
test eax, eax
jne 0x401fc9
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x3c]
mov edx, eax
mov eax, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov eax, dword [eax]
cmp eax, 0x4550
je 0x402000
mov dword [esp], 0xc1
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x28]
movzx eax, word [eax + 4]
cmp ax, 0x14c
je 0x402028
mov dword [esp], 0xc1
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x38]
and eax, 1
test eax, eax
je 0x402050
mov dword [esp], 0xc1
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x28]
movzx eax, word [eax + 0x14]
movzx edx, ax
mov eax, dword [ebp - 0x28]
add eax, edx
add eax, 0x18
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x38]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x14], 0
jmp 0x4020b8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x402091
mov eax, dword [ebp - 0x10]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 0x2c]
add eax, edx
mov dword [ebp - 0x1c], eax
jmp 0x4020a2
mov eax, dword [ebp - 0x10]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
add eax, edx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x18]
jbe 0x4020b0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
add dword [ebp - 0x14], 1
add dword [ebp - 0x10], 0x28
mov eax, dword [ebp - 0x28]
movzx eax, word [eax + 6]
movzx eax, ax
cmp eax, dword [ebp - 0x14]
ja 0x402077
lea eax, [ebp - 0x64]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
call eax
sub esp, 4
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x50]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._AlignValueUp
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x60]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._AlignValueUp
cmp eax, dword [ebp - 0x30]
je 0x402121
mov dword [esp], 0xc1
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x34]
mov edx, dword [ebp + 0x24]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov edx, dword [ebp - 0x30]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [ebp + 0x10]
call eax
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4021a4
mov eax, dword [ebp + 0x24]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x3000
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [ebp + 0x10]
call eax
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4021a4
mov dword [esp], 0xe
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call eax
mov dword [esp + 8], 0x40
mov dword [esp + 4], 8
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call eax
sub esp, 0xc
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x40220e
mov eax, dword [ebp + 0x24]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [ebp + 0x14]
call eax
mov dword [esp], 0xe
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x40243d
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0xc]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x28]
movzx eax, word [eax + 0x16]
movzx eax, ax
and eax, 0x2000
test eax, eax
setne al
movzx edx, al
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x14], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x10]
mov dword [eax + 0x1c], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x14]
mov dword [eax + 0x20], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x18]
mov dword [eax + 0x24], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x1c]
mov dword [eax + 0x28], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x20]
mov dword [eax + 0x2c], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp + 0x24]
mov dword [eax + 0x34], edx
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x3c], edx
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x54]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._CheckSize
test eax, eax
jne 0x402291
jmp 0x40242d
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp + 0x24]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [ebp + 0x10]
call eax
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x54]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 0x3c]
mov edx, eax
mov eax, dword [ebp - 0x34]
add edx, eax
mov eax, dword [ebp - 0x20]
mov dword [eax], edx
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov edx, dword [ebp - 0xc]
mov dword [eax + 0x34], edx
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._CopySections
test eax, eax
jne 0x402322
jmp 0x40242d
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov edx, dword [eax + 0x34]
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0x34]
sub edx, eax
mov eax, edx
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x402357
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._PerformBaseRelocation
mov edx, dword [ebp - 0x20]
mov dword [edx + 0x18], eax
jmp 0x402361
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x18], 1
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._BuildImportTable
test eax, eax
jne 0x402375
jmp 0x40242d
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._FinalizeSections
test eax, eax
jne 0x402389
jmp 0x40242d
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._ExecuteTLS
test eax, eax
jne 0x40239d
jmp 0x40242d
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x40241e
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x402409
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov eax, dword [eax + 0x28]
add eax, edx
mov dword [ebp - 0x3c], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
sub esp, 0xc
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x4023fd
mov dword [esp], 0x45a
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
call eax
sub esp, 4
jmp 0x40242d
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x10], 1
jmp 0x402428
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov eax, dword [eax + 0x28]
add edx, eax
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x38], edx
jmp 0x402428
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x38], 0
mov eax, dword [ebp - 0x20]
jmp 0x40243d
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._MemoryFreeLibrary
mov eax, 0
leave
ret