Function at 0x402717
Capabilities:
Check if file exists
Create process on windows
Read file on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x27c
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x10], eax
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x234], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
mov dword [ebp - 0x20], eax
mov eax, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0xc], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x1c], eax
push 0x104
push 0
lea eax, [ebp - 0x230]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x104
push 0
lea eax, [ebp - 0x128]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x104
lea eax, [ebp - 0x230]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x101
push 0
lea eax, [ebp - 0x125]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x128]
push eax
call dword [ebp - 0x20]
cmp eax, 2
jne 0x40280d
push 0x40
push 0
lea eax, [ebp - 0x278]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x128]
push eax
push 0x40c568
lea eax, [ebp - 0x278]
push eax
call dword [ebp - 0xc]
add esp, 0xc
push 5
push 0
lea eax, [ebp - 0x278]
push eax
push 0x40c43c
push 0x40c570
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
and dword [ebp - 4], 0
or dword [ebp - 0x18], 0xffffffff
and dword [ebp - 0x14], 0
and dword [ebp - 8], 0
movsx eax, byte [0x40eb94]
cmp eax, 0xffffffb1
jne 0x40283c
push 0
push 0x8f
push 0x30
push 0x40eb94
call fcn.004022d2
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
push 0x40eb94
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x402889
push 0
push 1
lea eax, [ebp - 0x230]
push eax
call fcn.00402411
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x402884
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
jmp 0x4029aa
mov dword [ebp - 8], 2
push 0
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
push 0
lea eax, [ebp - 0x14]
push eax
push 2
push dword [0x410cfc]
push dword [ebp - 0x18]
call dword [ebp - 0x1c]
push 0x104
push 0
push 0x4110f0
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0
lea eax, [ebp - 0x14]
push eax
push 0x104
push 0x4110f0
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x4110f0
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x402912
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 1
lea eax, [ebp - 0x230]
push eax
call fcn.00402411
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x2e
push 0x4110f0
call dword [sym.imp.MSVCRT.dll_strrchr]
pop ecx
pop ecx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x402939
mov eax, dword [ebp - 4]
and dword [eax], 0
and dword [ebp - 0x27c], 0
jmp 0x40294f
mov eax, dword [ebp - 0x27c]
inc eax
mov dword [ebp - 0x27c], eax
cmp dword [ebp - 0x27c], 0x64
jge 0x40299a
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
push 0x40eb94
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x40298a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x402988
jmp 0x40299a
jmp 0x402990
push dword [ebp - 0x18]
call dword [ebp - 0x10]
push 0x32
call dword [ebp - 0x234]
jmp 0x402942
push 0
push 2
lea eax, [ebp - 0x230]
push eax
call fcn.00402411
leave
ret