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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x294
mov byte [ebp - 0x244], 0xd8
mov byte [ebp - 0x243], 0xdf
mov byte [ebp - 0x242], 0xd3
mov byte [ebp - 0x241], 0xc0
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 eax, dword [ebp - 0x240]
xor eax, 0x8c8c8c8c
mov dword [ebp - 0x240], eax
mov eax, dword [ebp - 0x23c]
xor eax, 0x8c8c8c8c
mov dword [ebp - 0x23c], eax
push 0x104
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x244]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x40141a
push 0x104
lea eax, [ebp - 0x108]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x230], eax
cmp dword [ebp - 0x230], 0xffffffff
jne 0x40145b
push 0
lea eax, [ebp - 0x108]
push eax
push 2
call fcn.00401064
add esp, 0xc
push 0
lea eax, [ebp - 4]
push eax
push 0x40
lea eax, [ebp - 0x22c]
push eax
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
mov eax, dword [ebp - 0x1f0]
add eax, 0x18
push eax
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push 0xe0
lea eax, [ebp - 0x1e8]
push eax
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push dword [ebp - 0x190]
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push 0x38
lea eax, [ebp - 0x288]
push eax
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 4], 0x38
jne 0x4014f1
cmp dword [ebp - 0x288], 0x82d0b188
je 0x401504
push 0
lea eax, [ebp - 0x108]
push eax
push 0xd
call fcn.00401064
add esp, 0xc
push 0
push 0
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x268]
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
mov eax, dword [ebp + eax - 0x260]
mov dword [ebp - 0x24c], eax
push dword [ebp - 0x24c]
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x238], eax
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x24c]
push dword [ebp - 0x238]
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
and dword [ebp - 0x248], 0
cmp dword [ebp - 0x248], 0
je 0x401583
mov eax, dword [ebp - 0x248]
mov dword [0x405644], eax
jmp 0x4015a4
push 0x40
push 0x101000
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x264]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x405644], eax
cmp dword [0x405644], 0
jne 0x4015c4
push 0x4016f6
push 0x4016f6
push 0x80030008
call fcn.00401064
add esp, 0xc
cmp dword [ebp - 0x248], 0
jne 0x401684
mov eax, dword [ebp - 0x238]
movzx eax, word [eax + 1]
shl eax, 8
mov dword [ebp - 0x290], eax
mov eax, dword [ebp - 0x290]
imul eax, eax, 6
add eax, 0x4000
mov dword [ebp - 0x28c], eax
push 4
push 0x103000
push dword [ebp - 0x28c]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x294], eax
cmp dword [ebp - 0x294], 0
jne 0x401633
push 0x4016f6
push 0x4016f6
push 0x80030008
call fcn.00401064
add esp, 0xc
push dword [ebp - 0x28c]
push dword [ebp - 0x294]
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x264]
push dword [0x405644]
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x260]
push dword [ebp - 0x238]
call section..text___
add esp, 0x18
push 0x8000
push dword [ebp - 0x28c]
push dword [ebp - 0x294]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [0x405644]
mov dword [ebp - 0x250], eax
mov eax, dword [ebp - 0x250]
mov eax, dword [eax + 0x3c]
mov ecx, dword [0x405644]
lea eax, [ecx + eax + 4]
mov dword [ebp - 0x1ec], eax
mov eax, dword [ebp - 0x1ec]
add eax, 0x14
mov dword [0x405648], eax
mov eax, dword [0x405648]
mov ecx, dword [0x405644]
sub ecx, dword [eax + 0x1c]
mov dword [ebp - 0x234], ecx
cmp dword [ebp - 0x248], 0
jne 0x4016f4
push dword [ebp - 0x234]
push dword [0x405648]
call fcn.0040121e
pop ecx
pop ecx
mov eax, dword [0x405648]
push dword [eax + 0x68]
call fcn.004010ae
pop ecx
leave
ret