Function at 0x401570
Capabilities:
Allocate or change rwx memory
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x288
mov byte [ebp - 0x244], 0xd8
mov byte [ebp - 0x243], 0xdf
mov byte [ebp - 0x242], 0xd3
mov byte [ebp - 0x241], pe_nt_image_headers32
mov byte [ebp - 0x240], 0xc3
mov byte [ebp - 0x23f], 0xcd
mov byte [ebp - 0x23e], 0xc8
mov byte [ebp - 0x23d], 0xc9
mov byte [ebp - 0x23c], 0xde
mov byte [ebp - 0x23b], 0x8c
mov byte [ebp - 0x23a], 0x8c
mov byte [ebp - 0x239], 0x8c
mov eax, dword [ebp - 0x244]
xor eax, 0x8c8c8c8c
mov dword [ebp - 0x244], eax
mov ecx, dword [ebp - 0x240]
xor ecx, 0x8c8c8c8c
mov dword [ebp - 0x240], ecx
mov edx, dword [ebp - 0x23c]
xor edx, 0x8c8c8c8c
mov dword [ebp - 0x23c], edx
push 0x104
lea eax, [ebp - 0x108]
push eax
lea ecx, [ebp - 0x244]
push ecx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x401635
push 0x104
lea edx, [ebp - 0x108]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0x80
push 3
push 0
push 1
push bind
lea ecx, [ebp - 0x108]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x230], eax
cmp dword [ebp - 0x230], 0xffffffff
jne 0x401676
push 0
lea edx, [ebp - 0x108]
push edx
push 2
call fcn.00401240
add esp, 0xc
push 0
lea eax, [ebp - 4]
push eax
push 0x40
lea ecx, [ebp - 0x22c]
push ecx
mov edx, dword [ebp - 0x230]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
mov eax, dword [ebp - 0x1f0]
add eax, 0x18
push eax
mov ecx, dword [ebp - 0x230]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [ebp - 4]
push edx
push 0xe0
lea eax, [ebp - 0x1e8]
push eax
mov ecx, dword [ebp - 0x230]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
mov edx, dword [ebp - 0x190]
push edx
mov eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 4]
push ecx
push 0x38
lea edx, [ebp - 0x288]
push edx
mov eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 4], 0x38
jne 0x401712
cmp dword [ebp - 0x288], 0x82d0b188
je 0x401725
push 0
lea ecx, [ebp - 0x108]
push ecx
push 0xd
call fcn.00401240
add esp, 0xc
push 0
push 0
mov edx, dword [ebp + 0xc]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x268]
push eax
mov ecx, dword [ebp - 0x230]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0xc]
imul edx, edx, 0xc
mov eax, dword [ebp + edx - 0x260]
mov dword [ebp - 0x24c], eax
mov ecx, dword [ebp - 0x24c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x238], eax
push 0
lea edx, [ebp - 4]
push edx
mov eax, dword [ebp - 0x24c]
push eax
mov ecx, dword [ebp - 0x238]
push ecx
mov edx, dword [ebp - 0x230]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x248], 0
cmp dword [ebp - 0x248], 0
je 0x4017ad
mov eax, dword [ebp - 0x248]
mov dword [0x401b10], eax
jmp 0x4017cf
push 0x40
push 0x101000
mov ecx, dword [ebp + 0xc]
imul ecx, ecx, 0xc
mov edx, dword [ebp + ecx - 0x264]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x401b10], eax
cmp dword [0x401b10], 0
jne 0x4017ef
push 0x4018a0
push 0x4018a0
push 0x80030008
call fcn.00401240
add esp, 0xc
cmp dword [ebp - 0x248], 0
jne 0x40181c
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
mov ecx, dword [ebp + eax - 0x264]
push ecx
mov edx, dword [0x401b10]
push edx
mov eax, dword [ebp - 0x238]
push eax
call section..text___
add esp, 0xc
mov ecx, dword [0x401b10]
mov dword [ebp - 0x250], ecx
mov edx, dword [ebp - 0x250]
mov eax, dword [edx + 0x3c]
mov ecx, dword [0x401b10]
lea edx, [ecx + eax + 4]
mov dword [ebp - 0x1ec], edx
mov eax, dword [ebp - 0x1ec]
add eax, 0x14
mov dword [0x401b14], eax
mov ecx, dword [0x401b14]
mov edx, dword [0x401b10]
sub edx, dword [ecx + 0x1c]
mov dword [ebp - 0x234], edx
cmp dword [ebp - 0x248], 0
jne 0x401895
mov eax, dword [ebp - 0x234]
push eax
mov ecx, dword [0x401b14]
push ecx
call fcn.00401420
add esp, 8
mov edx, dword [0x401b14]
mov eax, dword [edx + 0x68]
push eax
call fcn.00401290
add esp, 4
mov esp, ebp
pop ebp
ret