Function at 0x401058
Capabilities:
Accept command line arguments
Create process on windows
Delete file
Get common file path
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5bc
push ebx
push esi
push edi
mov esi, str.iyExitID
lea edi, [ebp - 0x2c]
or dword [ebp - 0x20], 0xffffffff
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
xor ebx, ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x10], ebx
movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [ebp - 0xc], eax
mov esi, 0x104
lea eax, [ebp - 0x2b0]
push esi
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp eax, esi
je 0x4013ec
cmp eax, ebx
je 0x4013ec
push ebx
push 0x80
push 3
push ebx
push 1
lea eax, [ebp - 0x2b0]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x4013ec
mov esi, 0x40000
push esi
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
mov dword [ebp - 0x1c], edi
je 0x4012fb
lea eax, [ebp - 4]
push ebx
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
push dword [ebp + 8]
call esi
lea eax, [ebp - 0x2c]
push eax
call fcn.00402e00
cmp dword [ebp - 4], eax
pop ecx
jbe 0x4012cf
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x30], ebx
push eax
mov dword [ebp - 0x14], ebx
call fcn.00402e00
pop ecx
mov ecx, dword [ebp - 4]
sub ecx, eax
je 0x401172
mov al, byte [edi]
cmp al, byte [ebp - 0x2c]
jne 0x40115a
lea eax, [ebp - 0x2c]
push eax
call fcn.00402e00
push eax
lea eax, [ebp - 0x2c]
push eax
push edi
call fcn.00402dc0
add esp, 0x10
test eax, eax
jne 0x40115a
cmp dword [ebp - 0x30], ebx
jne 0x401172
mov dword [ebp - 0x30], 1
inc dword [ebp - 0x14]
lea eax, [ebp - 0x2c]
push eax
inc edi
call fcn.00402e00
pop ecx
mov ecx, dword [ebp - 4]
sub ecx, eax
cmp dword [ebp - 0x14], ecx
jb 0x40112c
lea eax, [ebp - 0x2c]
push eax
call fcn.00402e00
pop ecx
mov ecx, dword [ebp - 4]
sub ecx, eax
cmp dword [ebp - 0x14], ecx
jae 0x4012cf
push ebx
lea eax, [ebp - 0x2c]
push ebx
push eax
call fcn.00402e00
add eax, dword [ebp - 0x14]
pop ecx
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4012cf
lea eax, [ebp - 4]
push ebx
push eax
push 4
pop edi
lea eax, [ebp - 0x18]
push edi
push eax
push dword [ebp + 8]
call esi
cmp dword [ebp - 4], edi
jne 0x4012cf
lea eax, [ebp - 4]
push ebx
push eax
lea eax, [ebp - 8]
push edi
push eax
push dword [ebp + 8]
call esi
cmp dword [ebp - 4], edi
jne 0x4012cf
mov eax, 0x500000
cmp dword [ebp - 0x18], eax
ja 0x4012cf
cmp dword [ebp - 8], eax
ja 0x4012cf
push dword [ebp - 0x18]
push dword [ebp - 0x1c]
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
cmp eax, ebx
mov dword [ebp - 0x1c], eax
je 0x4012fb
lea ecx, [ebp - 4]
push ebx
push ecx
push dword [ebp - 0x18]
push eax
push dword [ebp + 8]
call esi
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x18]
jne 0x4012cf
mov eax, dword [ebp - 8]
inc eax
push eax
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
je 0x4012d2
mov eax, dword [ebp - 8]
push dword [ebp - 0x18]
inc eax
push dword [ebp - 0x1c]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x34]
push eax
push edi
call fcn.00401409
push 1
pop esi
cmp eax, esi
jne 0x4012d2
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x34]
jne 0x4012d2
lea eax, [ebp - 0x1a8]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x4012d2
lea eax, [ebp - 0x1a8]
push str.iyExit.exe
push eax
call fcn.00402c80
pop ecx
lea eax, [ebp - 0x1a8]
pop ecx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea ecx, [ebp - 4]
push ebx
push ecx
mov dword [ebp - 0x20], eax
push dword [ebp - 8]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 8]
jne 0x4012d2
mov dword [ebp - 0x10], esi
jmp 0x4012d2
mov edi, dword [ebp - 0x38]
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push ebx
push dword [ebp - 0xc]
call esi
cmp edi, ebx
je 0x4012ec
push edi
push ebx
push dword [ebp - 0xc]
call esi
cmp dword [ebp - 0x20], 0xffffffff
je 0x4012fb
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
cmp dword [ebp - 0x10], ebx
je 0x4013ec
push 0x44
lea eax, [ebp - 0x8c]
pop esi
mov dword [ebp - 0x10], ebx
push esi
push ebx
push eax
call fcn.00402d60
push 1
mov dword [ebp - 0x8c], esi
pop esi
lea eax, [ebp - 0x1a8]
push eax
lea eax, [ebp - 0x5bc]
push eax
mov dword [ebp - 0x60], esi
mov word [ebp - 0x5c], si
call fcn.00402c70
lea eax, [ebp - 0x5bc]
push 0x405020
push eax
call fcn.00402c80
lea eax, [ebp - 0x2b0]
push eax
lea eax, [ebp - 0x5bc]
push eax
call fcn.00402c80
lea eax, [ebp - 0x5bc]
push 0x40501c
push eax
call fcn.00402c80
call fcn.00401020
push eax
lea eax, [ebp - 0x5bc]
push eax
call fcn.00402c80
lea eax, [ebp - 0x5bc]
push 0x405018
push eax
call fcn.00402c80
add esp, 0x3c
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x8c]
push eax
push ebx
push ebx
push 0x20
push esi
push ebx
lea eax, [ebp - 0x5bc]
push ebx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x4013ec
push 0xffffffffffffffff
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x48]
call edi
push dword [ebp - 0x44]
call edi
lea eax, [ebp - 0x1a8]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov dword [ebp - 0x10], esi
jmp 0x4013ff
push 0x10
push str.Setup
push str.Internal_Error
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret 4