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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x27c
push 0x104
lea eax, [ebp - 0x108]
push eax
push 0x40189f
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x401580
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 0x4015c4
push 0
lea eax, [ebp - 0x108]
push eax
push 0x40188d
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
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 - 0x27c]
push eax
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 4], 0x38
jne 0x40165a
cmp dword [ebp - 0x27c], 0x82d0b188
je 0x401678
push 0
lea eax, [ebp - 0x108]
push eax
push 0x40185d
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push 0
push 0
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x25c]
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 - 0x254]
mov dword [ebp - 0x240], eax
push dword [ebp - 0x240]
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 - 0x240]
push dword [ebp - 0x238]
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_ReadFile]
and dword [ebp - 0x23c], 0
cmp dword [ebp - 0x23c], 0
je 0x4016f7
mov eax, dword [ebp - 0x23c]
mov dword [0x401a90], eax
jmp 0x401718
push 0x40
push 0x101000
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x258]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x401a90], eax
cmp dword [0x401a90], 0
jne 0x40173d
push 0x30
push 0x40184a
push 0x4017d9
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp dword [ebp - 0x23c], 0
jne 0x401767
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xc
push dword [ebp + eax - 0x258]
push dword [0x401a90]
push dword [ebp - 0x238]
call section..text___
add esp, 0xc
mov eax, dword [0x401a90]
mov dword [ebp - 0x244], eax
mov eax, dword [ebp - 0x244]
mov eax, dword [eax + 0x3c]
mov ecx, dword [0x401a90]
lea eax, [ecx + eax + 4]
mov dword [ebp - 0x1ec], eax
mov eax, dword [ebp - 0x1ec]
add eax, 0x14
mov dword [0x401a94], eax
mov eax, dword [0x401a94]
mov ecx, dword [0x401a90]
sub ecx, dword [eax + 0x1c]
mov dword [ebp - 0x234], ecx
cmp dword [ebp - 0x23c], 0
jne 0x4017d7
push dword [ebp - 0x234]
push dword [0x401a94]
call fcn.0040140d
pop ecx
pop ecx
mov eax, dword [0x401a94]
push dword [eax + 0x68]
call fcn.00401215
pop ecx
leave
ret