Function at 0x300018c4
Capabilities:
Allocate or change rwx memory
Get file size
Read file on windows
Read file via mapping
Set environment variable

Disassembly:
push 3
push 0
push 1
push 0x80000000
or byte [ebp - 0x4637b], 0xff
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x464]
push eax
push 0x30001e04
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
cmp dword [ebp - 0x38], 0xffffffff
jne 0x3000190e
push 0
push 0
push 0
lea eax, [ebp - 0x464]
push eax
push 2
call fcn.300010a1
add esp, 0x14
jmp 0x300019f4
push 0
push 0
push 0x40
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push 0x10
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov edx, dword [ebp - 0x34]
add edx, eax
mov eax, dword [ebp - 0x30]
adc eax, ecx
mov dword [ebp - 0x684], edx
mov dword [ebp - 0x680], eax
mov eax, dword [ebp - 0x680]
cmp eax, dword [ebp - 0x1c]
jl 0x30001a75
jg 0x30001a5b
mov eax, dword [ebp - 0x684]
cmp eax, dword [ebp - 0x20]
jbe 0x30001a75
push 0
push 0x30001ddc
push 0
lea eax, [ebp - 0x144]
push eax
push 0xd
call fcn.300010a1
add esp, 0x14
push dword [ebp - 0x2c]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x358], eax
push 0
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x34]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x2c]
push dword [ebp - 0x358]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x30001afe
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x2c]
jne 0x30001afe
mov eax, dword [ebp - 0x358]
movsx eax, byte [eax]
cmp eax, 0x74
jne 0x30001afe
mov eax, dword [ebp - 0x358]
movsx eax, byte [eax + 1]
cmp eax, 0x68
jne 0x30001afe
mov eax, dword [ebp - 0x358]
movsx eax, byte [eax + 2]
cmp eax, 0x69
jne 0x30001afe
mov eax, dword [ebp - 0x358]
movsx eax, byte [eax + 3]
cmp eax, 0x6e
je 0x30001b18
push 0
push 0x30001ddc
push 0
lea eax, [ebp - 0x144]
push eax
push 0xd
call fcn.300010a1
add esp, 0x14
mov eax, dword [ebp - 0x358]
cmp dword [eax + 0x38], 0
jne 0x30001b3e
push 0
push 0
lea eax, [ebp - 0x144]
push eax
push 0x30001da2
push 2
call fcn.300010a1
add esp, 0x14
push 0
mov eax, dword [ebp - 0x358]
add eax, 0x34
push eax
mov eax, dword [ebp - 0x358]
push dword [eax + 0x30]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push 0xc
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x10]
call fcn.30001113
pop ecx
mov dword [ebp - 0x40], eax
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x40]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
and dword [ebp - 0x354], 0
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], eax
push 0
push dword [ebp - 8]
push 0
push 0x40
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x354], eax
cmp dword [ebp - 0x354], 0
je 0x30001c18
push 0
push 0
push 0
push 0x26
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001bfc
push 0
push 0
push 0
push 6
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001c18
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x354], 0
cmp dword [0x30002600], 0
jne 0x30001c58
push 0x40
push 0x101000
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001c58
push 0x40
push 0x3000
push dword [ebp - 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001c7c
push 0
push 0
push 0x3000119c
push 0x3000119c
push 0x80030008
call fcn.300010a1
add esp, 0x14
cmp dword [ebp - 0xc], 0
jne 0x30001c98
push dword [ebp - 0x10]
push dword [ebp - 0x40]
push dword [0x30002600]
call fcn.30001499
add esp, 0xc
jmp 0x30001cac
push dword [ebp - 0x14]
push dword [0x30002600]
push dword [ebp - 0x40]
call section..text
add esp, 0xc
push dword [ebp - 0x14]
push dword [ebp - 0x40]
call fcn.3000119d
pop ecx
pop ecx
cmp dword [ebp - 0x354], 0
je 0x30001d39
push dword [0x30002600]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push 0
push 0
push 0
push 0x26
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001d09
push 0
push 0
push 0
push 6
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x30002600], eax
cmp dword [0x30002600], 0
jne 0x30001d2d
push 0
push 0
push 0x3000119c
push 0x3000119c
push 0x80030008
call fcn.300010a1
add esp, 0x14
push dword [ebp - 0x354]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x30002600]
mov dword [ebp - 0x35c], eax
mov eax, dword [ebp - 0x35c]
mov eax, dword [eax + 0x3c]
mov ecx, dword [0x30002600]
lea eax, [ecx + eax + 4]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
add eax, 0x14
mov dword [0x30002604], eax
mov eax, dword [0x30002604]
mov ecx, dword [0x30002600]
sub ecx, dword [eax + 0x1c]
mov dword [ebp - 0x3c], ecx
push dword [ebp - 0x3c]
push dword [0x30002604]
call fcn.3000134d
pop ecx
pop ecx
mov eax, dword [0x30002604]
push dword [eax + 0x68]
call fcn.300011c3
pop ecx
call fcn.3000109d
jmp 0x8f581f08