Function at 0x401603
Capabilities:
Accept command line arguments
Delete file
Get common file path
Read file on windows
Set current directory
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x368
mov dword [ebp - 0xc], 0
mov eax, dword [sym.imp.KERNEL32.dll_GetCommandLineA]
call eax
mov dword [ebp - 0x10], eax
mov dword [esp + 8], 0x104
lea eax, [ebp - 0x240]
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call eax
sub esp, 0xc
lea eax, [ebp - 0x348]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x44f420
mov dword [esp + 4], 0x1000
lea eax, [ebp - 0x240]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
call eax
sub esp, 0x10
lea eax, [ebp - 0x344]
mov dword [esp + 4], eax
mov dword [esp], 0x104
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
call eax
sub esp, 8
mov eax, dword [ebp - 0x348]
mov byte [eax], 0
mov dword [esp], 0x44f420
mov eax, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
call eax
sub esp, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], str.base.pk
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
je 0x4018d7
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffff1800
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call eax
sub esp, 0x10
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
je 0x4018da
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x34]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xe800
mov dword [esp + 4], 0x406040
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
sub esp, 0x14
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
lea eax, [ebp - 0x13c]
mov dword [esp + 4], eax
mov dword [esp], 0x104
mov eax, dword [sym.imp.KERNEL32.dll_GetTempPathA]
call eax
sub esp, 8
lea eax, [ebp - 0x240]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea eax, [ebp - 0x13c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
call eax
sub esp, 0x10
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 2
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
lea eax, [ebp - 0x240]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
call eax
sub esp, 0x1c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
je 0x4018dd
mov eax, dword [ebp - 0x34]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x38]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0x406040
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
lea eax, [ebp - 0x240]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
call eax
sub esp, 4
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x4018e0
mov dword [esp + 4], str.main
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call eax
sub esp, 8
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x4018e3
mov eax, dword [ebp - 0xc]
add eax, 0x3c
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
lea edx, [eax + 0x30]
mov eax, dword [ebp - 0xc]
add eax, edx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
lea edx, [eax + 8]
mov eax, dword [ebp - 0xc]
add eax, edx
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call fcn.0040159e
mov dword [esp + 4], 0
mov dword [esp], 0
mov eax, dword [ebp - 0x20]
call eax
sub esp, 8
jmp 0x4018e4
nop
jmp 0x4018e4
nop
jmp 0x4018e4
nop
jmp 0x4018e4
nop
jmp 0x4018e4
nop
lea eax, [ebp - 0x344]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
call eax
sub esp, 4
mov dword [esp + 4], 0
mov dword [esp], str.base.pk
call fcn.004014f0
cmp dword [ebp - 0xc], 0
je 0x401921
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_FreeLibrary]
call eax
sub esp, 4
lea eax, [ebp - 0x240]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_DeleteFileA]
call eax
sub esp, 4
mov eax, 0
leave
ret 0x10