Function at 0x4727ae
Capabilities:
Parse pe header
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x164
mov dword [ebp - 0x164], ecx
push 0x2e
mov eax, dword [ebp + 8]
push eax
call fcn.0040a130
add esp, 8
mov dword [ebp - 0x104], eax
cmp dword [ebp - 0x104], 0
jne 0x4727e1
xor eax, eax
jmp 0x472ad0
push 0x51e864
mov ecx, dword [ebp - 0x104]
push ecx
call fcn.00402980
add esp, 8
test eax, eax
je 0x472830
push str..scr
mov edx, dword [ebp - 0x104]
push edx
call fcn.00402980
add esp, 8
test eax, eax
je 0x472830
push str..com
mov eax, dword [ebp - 0x104]
push eax
call fcn.00402980
add esp, 8
test eax, eax
je 0x472830
xor eax, eax
jmp 0x472ad0
push 0
push 0
push 3
push 0
push 1
mov ecx, dword [ebp + 0xc]
neg ecx
sbb ecx, ecx
and ecx, 0x40000000
or ecx, 0x80000000
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x150], eax
cmp dword [ebp - 0x150], 0xffffffff
jne 0x47286e
xor eax, eax
jmp 0x472ad0
push 0
lea eax, [ebp - 0x10c]
push eax
push 0x40
lea ecx, [ebp - 0x14c]
push ecx
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4728fc
mov eax, dword [ebp - 0x14c]
and eax, 0xffff
cmp eax, 0x5a4d
jne 0x4728fc
push 0
push 0
mov ecx, dword [ebp - 0x110]
push ecx
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x10c]
push eax
push 0xf8
lea ecx, [ebp - 0xfc]
push ecx
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4728fc
cmp dword [ebp - 0xfc], 0x4550
jne 0x4728fc
mov eax, dword [ebp - 0xf6]
and eax, 0xffff
test eax, eax
jne 0x472910
mov ecx, dword [ebp - 0x150]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x472ad0
mov edx, dword [ebp - 0xf6]
and edx, 0xffff
imul edx, edx, 0x28
push edx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [ebp - 0x158], eax
mov eax, dword [ebp - 0x158]
mov dword [ebp - 0x100], eax
cmp dword [ebp - 0x100], 0
jne 0x472957
mov ecx, dword [ebp - 0x150]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x472ad0
mov edx, dword [ebp - 0xf6]
and edx, 0xffff
imul edx, edx, 0x28
mov dword [ebp - 0x10c], edx
push 0
push 0
mov eax, dword [ebp - 0xe8]
and eax, 0xffff
mov ecx, dword [ebp - 0x110]
lea edx, [ecx + eax + 0x18]
push edx
mov eax, dword [ebp - 0x150]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [ebp - 0x10c]
push ecx
mov edx, dword [ebp - 0x10c]
push edx
mov eax, dword [ebp - 0x100]
push eax
mov ecx, dword [ebp - 0x150]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4729ea
mov edx, dword [ebp - 0x100]
mov dword [ebp - 0x15c], edx
mov eax, dword [ebp - 0x15c]
push eax
call fcn.004a90a8
add esp, 4
mov ecx, dword [ebp - 0x150]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x472ad0
mov dword [ebp - 0x108], 0
mov edx, dword [ebp - 0xd4]
push edx
mov eax, dword [ebp - 0xac]
push eax
mov ecx, dword [ebp - 0xc8]
push ecx
lea edx, [ebp - 0xf6]
push edx
mov eax, dword [ebp - 0x100]
push eax
mov ecx, dword [ebp - 0x150]
push ecx
call fcn.0042c555
mov dword [ebp - 4], eax
mov edx, dword [ebp - 4]
cmp edx, dword [ebp - 0xd4]
je 0x472aa2
mov dword [ebp - 0x108], 1
cmp dword [ebp + 0xc], 0
je 0x472aa2
mov eax, dword [ebp - 0xf6]
and eax, 0xffff
imul eax, eax, 0x28
mov ecx, dword [ebp - 0x100]
lea edx, [ecx + eax - 0x28]
mov dword [ebp - 0x154], edx
mov eax, dword [ebp - 4]
mov dword [ebp - 0xd4], eax
push 0
push 0
mov ecx, dword [ebp - 0x110]
push ecx
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x10c]
push eax
push 0xf8
lea ecx, [ebp - 0xfc]
push ecx
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x100]
mov dword [ebp - 0x160], eax
mov ecx, dword [ebp - 0x160]
push ecx
call fcn.004a90a8
add esp, 4
mov edx, dword [ebp - 0x150]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x108]
mov esp, ebp
pop ebp
ret 8