Function at 0x4597d0
Capabilities:
Allocate or change rwx memory
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [0x5954a0]
xor eax, ebp
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadCodePtr]
test eax, eax
je 0x4597f5
xor eax, eax
jmp 0x459a2e
mov dword [ebp - 0x20], 3
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x24], ecx
cmp dword [ebp - 0x24], 0
jne 0x459814
mov dword [ebp - 0x48], 0
jmp 0x45989e
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 1
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0x3fffffff
jle 0x459836
mov dword [ebp - 0x4c], 0
jmp 0x459898
mov eax, dword [ebp - 8]
shl eax, 1
call fcn.004f86f0
mov dword [ebp - 0x40], esp
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x40], 0
je 0x459855
cmp dword [ebp - 0x24], 0
jne 0x45985e
mov dword [ebp - 0x4c], 0
jmp 0x459898
xor ecx, ecx
mov edx, dword [ebp - 0x40]
mov word [edx], cx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp - 0x24]
push edx
push 0
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x459892
mov dword [ebp - 0x4c], 0
jmp 0x459898
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x4c], ecx
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x48], edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x4598c3
xor eax, eax
jmp 0x459a2e
call dword [sym.imp.KERNEL32.dll_GetVersion]
and eax, 0xc0000000
cmp eax, 0x80000000
jne 0x4598e6
mov edx, dword [ebp + 8]
push edx
call fcn.00459a50
add esp, 4
mov dword [ebp - 0x1c], eax
jmp 0x4598ec
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
push 0x40
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x459903
xor eax, eax
jmp 0x459a2e
mov edx, dword [ebp - 0x1c]
movzx eax, word [edx]
cmp eax, 0x5a4d
je 0x459917
xor eax, eax
jmp 0x459a2e
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x1c]
add edx, dword [ecx + 0x3c]
mov dword [ebp - 0xc], edx
push 0xf8
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
je 0x45993d
xor eax, eax
jmp 0x459a2e
mov ecx, dword [ebp - 0xc]
cmp dword [ecx], 0x4550
je 0x45994f
xor eax, eax
jmp 0x459a2e
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x1c]
add eax, dword [edx + 0x80]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp - 0xc]
jne 0x45996d
xor eax, eax
jmp 0x459a2e
mov edx, dword [ebp - 4]
cmp dword [edx + 0xc], 0
je 0x4599a3
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax + 0xc]
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x34]
push eax
call fcn.004fb8b9
add esp, 8
test eax, eax
jne 0x459998
jmp 0x4599a3
mov ecx, dword [ebp - 4]
add ecx, 0x14
mov dword [ebp - 4], ecx
jmp 0x45996d
mov edx, dword [ebp - 4]
cmp dword [edx + 0xc], 0
jne 0x4599b0
xor eax, eax
jmp 0x459a2e
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x1c]
add ecx, dword [eax + 0x10]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
cmp dword [edx], 0
je 0x459a2c
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
cmp ecx, dword [ebp - 0x2c]
jne 0x459a21
push 4
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_IsBadWritePtr]
test eax, eax
je 0x459a14
lea eax, [ebp - 0x30]
push eax
push 0x40
push 4
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp + 0x14]
mov dword [edx], eax
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x30]
push edx
push 4
mov eax, dword [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov dword [ebp - 0x18], eax
jmp 0x459a1c
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp + 0x14]
mov dword [ecx], edx
mov eax, dword [ebp - 0x2c]
jmp 0x459a2e
mov eax, dword [ebp - 0x28]
add eax, 4
mov dword [ebp - 0x28], eax
jmp 0x4599bc
xor eax, eax
lea esp, [ebp - 0x4c]
mov ecx, dword [ebp - 0x38]
xor ecx, ebp
call fcn.004f8124
mov esp, ebp
pop ebp
ret 0x10