Function at 0x401a58
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Get system information on windows
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x80
cmp dword [ebp + 8], 0
jne 0x401a6e
xor eax, eax
jmp 0x401f84
mov eax, dword [ebp + 8]
mov dword [ebp - 0x54], eax
push 0x40
mov ecx, dword [ebp - 0x54]
push ecx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
cmp eax, 1
je 0x401a94
mov edx, dword [ebp - 0x54]
xor eax, eax
mov ax, word [edx]
cmp eax, 0x5a4d
je 0x401a9b
xor eax, eax
jmp 0x401f84
mov ecx, dword [ebp - 0x54]
mov edx, dword [ebp - 0x54]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0x50], edx
push 0xf8
mov eax, dword [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
cmp eax, 1
je 0x401ac6
mov ecx, dword [ebp - 0x50]
cmp dword [ecx], 0x4550
je 0x401acd
xor eax, eax
jmp 0x401f84
mov edx, dword [ebp - 0x50]
xor eax, eax
mov ax, word [edx + 0x14]
cmp eax, 0xe0
jne 0x401aee
mov ecx, dword [ebp - 0x50]
xor edx, edx
mov dx, word [ecx + 0x18]
cmp edx, 0x10b
je 0x401af5
xor eax, eax
jmp 0x401f84
mov eax, dword [ebp - 0x50]
xor ecx, ecx
mov cx, word [eax + 6]
cmp ecx, 1
jge 0x401b0a
xor eax, eax
jmp 0x401f84
mov edx, dword [ebp - 0x50]
xor eax, eax
mov ax, word [edx + 0x14]
mov ecx, dword [ebp - 0x50]
lea edx, [ecx + eax + 0x18]
mov dword [ebp - 8], edx
mov dword [ebp - 0x60], 0x28
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x50]
xor edx, edx
mov dx, word [ecx + 6]
mov ecx, dword [ebp - 0x60]
imul ecx, edx
add eax, ecx
mov dword [ebp - 0x58], eax
mov edx, dword [ebp - 0x58]
mov dword [ebp - 0x40], edx
mov word [ebp - 0x48], 0
jmp 0x401b58
mov ax, word [ebp - 0x48]
add ax, 1
mov word [ebp - 0x48], ax
mov ecx, dword [ebp - 0x48]
and ecx, 0xffff
mov edx, dword [ebp - 0x50]
xor eax, eax
mov ax, word [edx + 6]
cmp ecx, eax
jae 0x401bc4
mov ecx, dword [ebp - 0x48]
and ecx, 0xffff
imul ecx, ecx, 0x28
mov edx, dword [ebp - 0x48]
and edx, 0xffff
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [eax + ecx + 0xc]
mov eax, dword [ebp - 8]
add ecx, dword [eax + edx + 0x10]
cmp dword [ebp - 0x40], ecx
jae 0x401bc2
mov ecx, dword [ebp - 0x48]
and ecx, 0xffff
imul ecx, ecx, 0x28
mov edx, dword [ebp - 0x48]
and edx, 0xffff
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [eax + ecx + 0xc]
mov eax, dword [ebp - 8]
add ecx, dword [eax + edx + 0x10]
mov dword [ebp - 0x40], ecx
jmp 0x401b4c
lea ecx, [ebp - 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x40]
xor edx, edx
div dword [ebp - 0x38]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x40]
xor edx, edx
div dword [ebp - 0x38]
test edx, edx
je 0x401bee
mov edx, dword [ebp - 0x44]
add edx, 1
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x44]
imul eax, dword [ebp - 0x38]
mov dword [0x41b4ac], eax
push 0x40
push 0x1000
mov ecx, dword [0x41b4ac]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp + 0xc], eax
cmp dword [ebp + 0xc], 0
jne 0x401c20
xor eax, eax
jmp 0x401f84
mov edx, dword [ebp - 0x58]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0040a0d0
add esp, 0xc
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x5c], 0
mov word [ebp - 0x48], 0
jmp 0x401c5d
mov dx, word [ebp - 0x48]
add dx, 1
mov word [ebp - 0x48], dx
mov eax, dword [ebp - 0x48]
and eax, 0xffff
mov ecx, dword [ebp - 0x50]
xor edx, edx
mov dx, word [ecx + 6]
cmp eax, edx
jge 0x401ccd
mov eax, dword [ebp - 0x48]
and eax, 0xffff
imul eax, eax, 0x28
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
add edx, dword [ecx + eax + 0xc]
mov dword [ebp - 0x68], edx
mov eax, dword [ebp - 0x48]
and eax, 0xffff
imul eax, eax, 0x28
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 8]
add edx, dword [ecx + eax + 0x14]
mov dword [ebp - 0x64], edx
mov eax, dword [ebp - 0x48]
and eax, 0xffff
imul eax, eax, 0x28
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + eax + 0x10]
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
call fcn.0040a0d0
add esp, 0xc
jmp 0x401c51
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x54]
mov edx, dword [ebp - 0x54]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0x50], edx
mov eax, dword [ebp - 0x50]
add eax, 0xf8
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x54]
mov dword [0x41d4d0], ecx
mov edx, dword [ebp - 0x50]
mov eax, dword [edx + 0x80]
mov dword [ebp - 0x70], eax
cmp dword [ebp - 0x70], 0
jne 0x401d1d
push 0x8000
push 0
mov ecx, dword [ebp - 0x54]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x401f84
mov edx, dword [ebp - 0x50]
mov eax, dword [edx + 0x80]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x401d3a
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0x54]
mov dword [ebp - 4], ecx
jmp 0x401d52
push 0x8000
push 0
mov edx, dword [ebp - 0x54]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x401f84
mov eax, 1
test eax, eax
je 0x401e79
mov ecx, dword [ebp - 4]
cmp dword [ecx + 4], 0
jne 0x401d76
mov edx, dword [ebp - 4]
cmp dword [edx + 0xc], 0
jne 0x401d76
jmp 0x401e79
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0xc]
add ecx, dword [0x41d4d0]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x401da5
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x401dc3
push 0x8000
push 0
mov ecx, dword [ebp - 0x54]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x401f84
mov edx, dword [ebp - 4]
mov eax, dword [edx]
add eax, dword [ebp - 0x54]
mov dword [ebp - 0x78], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x10]
add edx, dword [ebp - 0x54]
mov dword [ebp - 0x74], edx
mov eax, dword [ebp - 0x78]
cmp dword [eax], 0
je 0x401e6b
mov ecx, dword [ebp - 0x78]
mov edx, dword [ecx]
add edx, dword [ebp - 0x54]
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x7c], 0x80000000
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax]
and ecx, dword [ebp - 0x7c]
test ecx, ecx
je 0x401e20
mov edx, dword [ebp - 0x78]
mov eax, dword [edx]
and eax, 0xffff
push eax
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0x74]
mov dword [edx], eax
jmp 0x401e36
mov eax, dword [ebp - 0x4c]
add eax, 2
push eax
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0x74]
mov dword [edx], eax
cmp dword [ebp - 0x74], 0
jne 0x401e54
push 0x8000
push 0
mov eax, dword [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x401f84
mov ecx, dword [ebp - 0x74]
add ecx, 4
mov dword [ebp - 0x74], ecx
mov edx, dword [ebp - 0x78]
add edx, 4
mov dword [ebp - 0x78], edx
jmp 0x401dda
mov eax, dword [ebp - 4]
add eax, 0x14
mov dword [ebp - 4], eax
jmp 0x401d52
mov ecx, dword [ebp - 0x50]
mov edx, dword [ecx + 0xa0]
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x18], 0
je 0x401f76
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x54]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
cmp dword [ecx], 0
je 0x401f76
mov edx, dword [ebp - 0x18]
add edx, 8
mov dword [ebp - 0x80], edx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
add ecx, dword [eax + 4]
cmp dword [ebp - 0x80], ecx
jae 0x401f65
mov edx, dword [ebp - 0x80]
xor eax, eax
mov ax, word [edx]
and eax, 0xf000
mov dword [ebp - 0x6c], eax
cmp dword [ebp - 0x6c], 0x3000
jne 0x401f3c
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x54]
add edx, dword [ecx]
mov eax, dword [ebp - 0x80]
xor ecx, ecx
mov cx, word [eax]
and ecx, 0xfff
add edx, ecx
mov dword [ebp - 0xc], edx
mov edx, dword [ebp - 0x80]
xor eax, eax
mov ax, word [edx]
and eax, 0xfff
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx]
add edx, eax
mov eax, dword [0x41d3f0]
mov dword [eax*4 + 0x41c450], edx
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x50]
mov eax, dword [ecx]
sub eax, dword [edx + 0x34]
mov ecx, dword [0x41d3f0]
mov dword [ecx*4 + 0x41b4b0], eax
mov edx, dword [0x41d3f0]
add edx, 1
mov dword [0x41d3f0], edx
jmp 0x401f57
cmp dword [ebp - 0x6c], 0
je 0x401f57
push 0x8000
push 0
mov eax, dword [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x401f84
mov ecx, dword [ebp - 0x80]
add ecx, 2
mov dword [ebp - 0x80], ecx
jmp 0x401ead
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
add eax, dword [edx + 4]
mov dword [ebp - 0x18], eax
jmp 0x401e98
mov ecx, dword [ebp + 0xc]
mov dword [0x41d4d4], ecx
mov eax, 1
mov esp, ebp
pop ebp
ret