Function at 0x401460
Capabilities:
Accept command line arguments
Create process on windows
Get common file path
Set current directory

Disassembly:
sub esp, 0x78
push ebp
mov ebp, dword [esp + 0x80]
push 2
push 0x104
mov dword [0x410ab0], ebp
call fcn.00405988
push 2
push 0x104
mov dword [0x410aac], eax
call fcn.00405988
push 2
push 0x104
mov dword [0x410aa8], eax
call fcn.00405988
push 2
push 0x2000
mov dword [0x410a98], eax
call fcn.00405988
mov ecx, dword [0x410aac]
add esp, 0x20
test ecx, ecx
mov dword [0x410a9c], eax
je 0x40195f
mov edx, dword [0x410aa8]
test edx, edx
je 0x40195f
mov edx, dword [0x410a98]
test edx, edx
je 0x40195f
test eax, eax
je 0x40195f
push ebx
push esi
push edi
push 0x104
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
call fcn.00401300
mov edi, eax
test edi, edi
jne 0x401898
call fcn.00401980
test eax, eax
mov dword [esp + 0x10], eax
jne 0x4016f6
mov eax, dword [0x410aa8]
mov ecx, dword [0x410a9c]
mov ebx, dword [sym.imp.USER32.dll_wsprintfW]
push eax
push 0x40d080
push ecx
call ebx
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov edi, eax
cmp word [edi], 0x22
jne 0x40154d
lea edx, [edi + 2]
push 0x22
push edx
jmp 0x401550
push 0x20
push edi
call fcn.0040591f
mov esi, eax
add esp, 8
test esi, esi
jne 0x401562
mov esi, edi
jmp 0x401565
add esi, 2
test esi, esi
je 0x40158f
cmp word [esi], 0
je 0x40158f
mov eax, dword [0x410a9c]
push 0x40d07c
push eax
call fcn.00405750
mov ecx, dword [0x410a9c]
push esi
push ecx
call fcn.00405750
add esp, 0x10
mov edx, dword [0x410a9c]
push 0x40d06c
push edx
call fcn.00405750
mov eax, dword [0x410aac]
mov ecx, dword [0x410a9c]
push eax
push ecx
call fcn.00405750
mov edx, dword [0x410a9c]
push 0x40d068
push edx
call fcn.00405750
mov eax, dword [0x410aa4]
mov ecx, dword [0x410a9c]
add esp, 0x18
push eax
push 0x40d058
push ecx
call fcn.0040579f
mov edx, dword [0x410a9c]
add esp, 4
lea eax, [edx + eax*2]
push eax
call ebx
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x50]
add esp, 0xc
rep stosd dword es:[edi], eax
xor ecx, ecx
lea edx, [esp + 0x18]
mov dword [esp + 0x18], ecx
lea eax, [esp + 0x44]
mov dword [esp + 0x1c], ecx
push edx
mov dword [esp + 0x24], ecx
push eax
push ecx
push ecx
push 0x20
push 1
push ecx
mov dword [esp + 0x40], ecx
push ecx
mov ecx, dword [0x410a9c]
push ecx
push 0
mov dword [esp + 0x6c], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x4016f6
mov esi, dword [sym.imp.USER32.dll_PeekMessageW]
mov ebp, dword [sym.imp.USER32.dll_GetMessageW]
mov ebx, dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
xor edi, edi
test edi, edi
jne 0x4016a7
push edi
push edi
push edi
lea edx, [esp + 0x34]
push edi
push edx
call esi
test eax, eax
je 0x4016a7
push 0
push 0
lea eax, [esp + 0x30]
push 0
push eax
call ebp
test eax, eax
je 0x40168f
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x401694
mov edi, 1
push 0
push 0
push 0
lea eax, [esp + 0x34]
push 0
push eax
call esi
test eax, eax
jne 0x401666
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x4016db
push 0xff
push 0x3e8
push 0
push 0
push 0
call ebx
cmp dword [esp + 0x14], 0x103
je 0x401653
mov eax, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x18]
push ecx
call esi
mov ebp, dword [esp + 0x8c]
mov eax, dword [0x410aac]
test eax, eax
je 0x401738
push 0x5c
push eax
call fcn.00405948
add esp, 8
test eax, eax
je 0x401738
mov edi, dword [0x410aac]
mov edx, eax
sub edx, edi
sar edx, 1
cmp edx, 3
jae 0x401727
mov word [eax + 2], 0
jmp 0x40172c
mov word [eax], 0
mov eax, dword [0x410aac]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov edi, dword [0x410aa0]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
test edi, edi
je 0x4017eb
cmp word [edi], 0
je 0x4017e2
xor esi, esi
push edi
call fcn.00405a39
add esp, 4
test eax, eax
je 0x40177d
cmp dword [0x410ac4], 2
je 0x40177d
push 0x3e8
call ebx
inc esi
cmp esi, 0xa
jl 0x401758
jmp 0x4017c5
push 2
push edi
call fcn.0040579f
add esp, 4
inc eax
push eax
call fcn.00405988
mov esi, eax
add esp, 8
test esi, esi
je 0x4017c5
push edi
push esi
call fcn.0040577a
push 0x5c
push esi
call fcn.00405948
add esp, 0x10
test eax, eax
je 0x4017bc
push esi
mov word [eax], 0
call fcn.00405b2e
add esp, 4
push esi
call fcn.004058b6
add esp, 4
push edi
call fcn.0040579f
lea edi, [edi + eax*2 + 2]
add esp, 4
cmp word [edi], 0
jne 0x401756
mov edi, dword [0x410aa0]
push edi
call fcn.004058b6
add esp, 4
push 2
push 0x104
call fcn.00405988
mov esi, eax
add esp, 8
test esi, esi
je 0x40185d
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x401854
push esi
call fcn.0040579f
mov ecx, dword [0x410a98]
push eax
push ecx
push esi
call fcn.00405a98
add esp, 0x10
test eax, eax
jne 0x401854
mov edx, dword [0x410a98]
push edx
call fcn.0040579f
push esi
mov edi, eax
call fcn.0040579f
add esp, 8
cmp edi, eax
jbe 0x401854
mov eax, dword [0x410a98]
push eax
call fcn.00401360
add esp, 4
push esi
call fcn.004058b6
add esp, 4
xor esi, esi
mov ecx, dword [0x410a98]
push ecx
call fcn.00401030
mov edx, dword [0x410a98]
push edx
call fcn.00405b2e
add esp, 8
test eax, eax
je 0x401894
cmp dword [0x410ac4], 2
je 0x401894
push 0x3e8
call ebx
inc esi
cmp esi, 0xa
jl 0x40185f
mov edi, dword [esp + 0x10]
cmp edi, 0x40000000
jl case.default.0x4018ab
lea eax, [edi - 0x40000001]
cmp eax, 3
ja case.default.0x4018ab
jmp dword [eax*4 + 0x40196c]
mov dword [esp + 0x10], 2
mov edi, dword [esp + 0x10]
jmp 0x4018e5
mov dword [esp + 0x10], 6
mov edi, dword [esp + 0x10]
jmp 0x4018e5
mov dword [esp + 0x10], 7
mov edi, dword [esp + 0x10]
jmp 0x4018e5
test edi, edi
jle 0x401921
cmp edi, 8
jge 0x401921
push 2
push 0x104
call fcn.00405988
add esp, 8
mov esi, eax
movsx eax, byte [edi + 0x40d030]
push 0x104
push esi
push eax
push ebp
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x40
push 0
push esi
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
push esi
call fcn.004058b6
add esp, 4
mov ecx, dword [0x410a9c]
push ecx
call fcn.004058b6
mov edx, dword [0x410a98]
push edx
call fcn.004058b6
mov eax, dword [0x410aa8]
push eax
call fcn.004058b6
mov ecx, dword [0x410aac]
push ecx
call fcn.004058b6
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x78
ret 0x10
or eax, 0xffffffff
pop ebp
add esp, 0x78
ret 0x10