Function at 0x501830
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x278
push esi
cmp dword [ebp + 0xc], 0x40
jae 0x501847
xor eax, eax
jmp 0x501e38
cmp dword [ebp + 8], 0
jne 0x501854
xor eax, eax
jmp 0x501e38
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
xor edx, edx
mov dx, word [ecx]
cmp edx, 0x5a4d
je 0x501871
xor eax, eax
jmp 0x501e38
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x3c]
add ecx, 0xf8
cmp dword [ebp + 0xc], ecx
jae 0x501889
xor eax, eax
jmp 0x501e38
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp + 8]
add eax, dword [edx + 0x3c]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
cmp dword [ecx], 0x4550
je 0x5018a7
xor eax, eax
jmp 0x501e38
mov edx, dword [ebp - 0x1c]
xor eax, eax
mov ax, word [edx + 0x16]
and eax, 0x2000
test eax, eax
jne 0x5018c0
xor eax, eax
jmp 0x501e38
mov ecx, dword [ebp - 0x1c]
xor edx, edx
mov dx, word [ecx + 0x16]
and edx, 2
test edx, edx
jne 0x5018d7
xor eax, eax
jmp 0x501e38
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
mov cx, word [eax + 0x14]
cmp ecx, 0xe0
je 0x5018ef
xor eax, eax
jmp 0x501e38
mov edx, dword [ebp - 0x1c]
add edx, 0xf8
mov dword [ebp - 8], edx
mov dword [ebp - 0x14], 0
jmp 0x50190d
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x1c]
xor edx, edx
mov dx, word [ecx + 6]
cmp dword [ebp - 0x14], edx
jge 0x501943
mov eax, dword [ebp - 0x14]
imul eax, eax, 0x28
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0x28
mov edx, dword [ebp - 8]
mov eax, dword [edx + eax + 0x14]
mov edx, dword [ebp - 8]
add eax, dword [edx + ecx + 0x10]
cmp eax, dword [ebp + 0xc]
jbe 0x501941
xor eax, eax
jmp 0x501e38
jmp 0x501904
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x38]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x54]
mov ecx, dword [ebp - 4]
lea eax, [eax + ecx - 1]
xor edx, edx
div dword [ebp - 4]
imul eax, dword [ebp - 4]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x14], 0
jmp 0x501977
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
mov cx, word [eax + 6]
cmp dword [ebp - 0x14], ecx
jge 0x501a00
mov edx, dword [ebp - 0x14]
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edx + 8]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edx + 0x10]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x38]
cmp edx, dword [ebp - 0x30]
jle 0x5019b8
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x278], eax
jmp 0x5019c1
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x278], ecx
mov edx, dword [ebp - 0x278]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x14]
imul eax, eax, 0x28
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + eax + 0xc]
add edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 4]
lea eax, [edx + eax - 1]
xor edx, edx
div dword [ebp - 4]
imul eax, dword [ebp - 4]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x34]
jge 0x5019fb
mov edx, dword [ebp - 0x34]
mov dword [ebp - 0x2c], edx
jmp 0x50196e
cmp dword [ebp - 0x2c], 0
jne 0x501a0d
xor eax, eax
jmp 0x501e38
push 0x40
push 0x3000
mov eax, dword [ebp - 0x2c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x501a30
xor eax, eax
jmp 0x501e38
mov ecx, dword [ebp - 0x1c]
xor edx, edx
mov dx, word [ecx + 6]
imul edx, edx, 0x28
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x54]
add ecx, edx
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.0053cd90
add esp, 0xc
mov dword [ebp - 0x14], 0
jmp 0x501a67
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x1c]
xor eax, eax
mov ax, word [edx + 6]
cmp dword [ebp - 0x14], eax
jge 0x501ad7
mov ecx, dword [ebp - 0x14]
imul ecx, ecx, 0x28
mov edx, dword [ebp - 8]
cmp dword [edx + ecx + 0xc], 0
je 0x501a95
mov eax, dword [ebp - 0x14]
imul eax, eax, 0x28
mov ecx, dword [ebp - 8]
cmp dword [ecx + eax + 0x10], 0
jne 0x501a97
jmp 0x501a5e
mov edx, dword [ebp - 0x14]
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x18]
add ecx, dword [eax + edx + 0xc]
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edx + 0x10]
push ecx
mov edx, dword [ebp - 0x14]
imul edx, edx, 0x28
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 8]
add ecx, dword [eax + edx + 0x14]
push ecx
mov edx, dword [ebp - 0x40]
push edx
call fcn.0053cd90
add esp, 0xc
jmp 0x501a5e
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x1c]
add eax, 0xf8
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x1c]
cmp dword [ecx + 0xa0], 0
jbe 0x501bcc
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0xa4], 0
jbe 0x501bcc
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
sub ecx, dword [eax + 0x34]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
add eax, dword [edx + 0xa0]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
mov eax, dword [ebp - 0x44]
add edx, dword [eax + 4]
test edx, edx
je 0x501bcc
mov ecx, dword [ebp - 0x44]
add ecx, 8
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [edx + 4]
sub eax, 8
shr eax, 1
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x54], 0
jmp 0x501b6b
mov ecx, dword [ebp - 0x54]
add ecx, 1
mov dword [ebp - 0x54], ecx
mov edx, dword [ebp - 0x54]
cmp edx, dword [ebp - 0x4c]
jge 0x501bbb
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x50]
xor edx, edx
mov dx, word [ecx + eax*2]
and edx, 0xf000
cmp edx, 0x3000
jne 0x501bb9
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x18]
add ecx, dword [eax]
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x50]
xor esi, esi
mov si, word [eax + edx*2]
and esi, 0xfff
add ecx, esi
mov dword [ebp - 0x58], ecx
mov ecx, dword [ebp - 0x58]
mov edx, dword [ecx]
add edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x58]
mov dword [eax], edx
jmp 0x501b62
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x44]
add edx, dword [ecx + 4]
mov dword [ebp - 0x44], edx
jmp 0x501b2f
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x80]
mov dword [ebp - 0x20], ecx
cmp dword [ebp - 0x20], 0
je 0x501dd1
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x20]
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
cmp dword [eax], 0
je 0x501dd1
mov ecx, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x18]
add edx, dword [ecx + 0x10]
mov dword [ebp - 0x264], edx
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0x18]
add ecx, dword [eax]
mov dword [ebp - 0x26c], ecx
mov edx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x18]
add eax, dword [edx + 0xc]
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x14], 0
jmp 0x501c32
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
cmp dword [ebp - 0x14], 0x100
jge 0x501c62
mov edx, dword [ebp - 0x60]
add edx, dword [ebp - 0x14]
xor eax, eax
mov al, byte [edx]
test eax, eax
jne 0x501c4b
jmp 0x501c62
mov ecx, dword [ebp - 0x60]
add ecx, dword [ebp - 0x14]
movzx dx, byte [ecx]
mov eax, dword [ebp - 0x14]
mov word [ebp + eax*2 - 0x260], dx
jmp 0x501c29
cmp dword [ebp - 0x14], 0x100
jl 0x501c83
push 0x8000
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x501e38
mov edx, dword [ebp - 0x14]
mov word [ebp + edx*2 - 0x260], 0
lea eax, [ebp - 0x260]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp - 0x268], eax
cmp dword [ebp - 0x268], 0
jne 0x501cbf
lea ecx, [ebp - 0x260]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x268], eax
cmp dword [ebp - 0x268], 0
jne 0x501ce0
push 0x8000
push 0
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x501e38
mov dword [ebp - 0x14], 0
jmp 0x501cf2
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x26c]
cmp dword [edx + ecx*4], 0
jne 0x501d06
jmp 0x501dc3
mov dword [ebp - 0x270], 0
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x26c]
mov edx, dword [ecx + eax*4]
and edx, 0x80000000
test edx, edx
je 0x501d4e
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x26c]
mov edx, dword [ecx + eax*4]
and edx, 0xffff
push edx
mov eax, dword [ebp - 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x270], eax
jmp 0x501d80
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x26c]
mov eax, dword [ebp - 0x18]
add eax, dword [edx + ecx*4]
mov dword [ebp - 0x274], eax
mov ecx, dword [ebp - 0x274]
add ecx, 2
push ecx
mov edx, dword [ebp - 0x268]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x270], eax
cmp dword [ebp - 0x270], 0
je 0x501da9
push 4
lea eax, [ebp - 0x270]
push eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x264]
lea eax, [edx + ecx*4]
push eax
call fcn.0053cd90
add esp, 0xc
jmp 0x501dbe
push 0x8000
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x501e38
jmp 0x501ce9
mov edx, dword [ebp - 0x5c]
add edx, 0x14
mov dword [ebp - 0x5c], edx
jmp 0x501beb
lea eax, [ebp - 0x28]
push eax
push 0x40
mov ecx, dword [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
mov dword [eax + 0x34], ecx
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x28]
add eax, dword [ebp - 0x18]
mov dword [ebp - 0xc], eax
push 0
push 1
mov ecx, dword [ebp - 0x18]
push ecx
call dword [ebp - 0xc]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x501e35
push 0
push 0
mov edx, dword [ebp - 0x18]
push edx
call dword [ebp - 0xc]
push 0x8000
push 0
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [ebp - 0xc], 0
xor eax, eax
jmp 0x501e38
mov eax, dword [ebp - 0x18]
pop esi
mov esp, ebp
pop ebp
ret 8