Function at 0x401330
Capabilities:
Accept command line arguments
Read file on windows
Terminate process
Write file on windows

Disassembly:
sub esp, 0x28
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x24]
xor ebx, ebx
push eax
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
cmp dword [esp + 0x24], 3
mov edi, eax
je 0x4013ae
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push ebx
lea ecx, [esp + 0x30]
push ecx
push 0x401040
mov dword [esp + 0x38], ebx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
push 0x401040
push 0xfffffffffffffff4
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push eax
call ebp
push ebx
lea edx, [esp + 0x30]
push edx
push 0x4010c8
mov dword [esp + 0x38], ebx
call esi
push eax
push 0x4010c8
push 0xfffffffffffffff4
call edi
push eax
call ebp
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push 0x10000
push 0x40
mov byte [esp + 0x1b], bl
mov dword [esp + 0x28], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebp, dword [sym.imp.KERNEL32.dll_CreateFileW]
push ebx
push ebx
push 3
push ebx
push 1
mov dword [esp + 0x2c], eax
mov eax, dword [edi + 4]
push 0x80000000
push eax
call ebp
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x2c], esi
push ebx
jne 0x401446
mov ebp, dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [esp + 0x2c]
push ecx
push 0x401134
mov dword [esp + 0x34], ebx
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
push 0x401134
push 0xfffffffffffffff4
call edi
mov esi, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push eax
call esi
call fcn.004012d0
push ebx
lea edx, [esp + 0x2c]
push edx
push 0x401168
mov dword [esp + 0x34], ebx
call ebp
push eax
push 0x401168
push 0xfffffffffffffff4
call edi
push eax
call esi
jmp 0x401636
mov eax, dword [edi + 8]
push ebx
push 2
push ebx
push 1
push 0x40000000
push eax
call ebp
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], ebx
push ebx
jne 0x4014b8
mov ebp, dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [esp + 0x2c]
push ecx
push 0x40116c
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
push 0x40116c
push 0xfffffffffffffff4
call edi
mov esi, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push eax
call esi
call fcn.004012d0
push ebx
lea edx, [esp + 0x2c]
push edx
push 0x4011a8
mov dword [esp + 0x34], ebx
call ebp
push eax
push 0x4011a8
push 0xfffffffffffffff4
call edi
push eax
call esi
jmp 0x401636
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x18]
push eax
push 0x10000
push ecx
push esi
mov dword [esp + 0x30], ebx
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
mov ebp, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
je 0x4015ab
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x401631
mov ecx, dword [esp + 0x20]
push ebx
lea edx, [esp + 0x2c]
push edx
push eax
mov eax, dword [esp + 0x24]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4015ee
cmp dword [esp + 0x14], 0x10000
jne 0x401631
push ebx
lea edx, [esp + 0x34]
push edx
push 0x401234
mov dword [esp + 0x3c], ebx
call ebp
push eax
push 0x401234
push 0xfffffffffffffff4
call edi
push eax
call esi
mov eax, dword [esp + 0x1c]
and eax, 0x80000003
jns 0x401557
dec eax
or eax, 0xfffffffc
inc eax
movzx ecx, word [eax*2 + 0x401238]
push ebx
lea edx, [esp + 0x34]
push edx
push 1
lea eax, [esp + 0x40]
push eax
push 0xfffffffffffffff4
mov dword [esp + 0x48], ecx
mov dword [esp + 0x44], ebx
call edi
push eax
call esi
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x2c]
add dword [esp + 0x1c], 1
push ebx
lea ecx, [esp + 0x18]
push ecx
push 0x10000
push edx
push eax
mov dword [esp + 0x28], ebx
mov dword [esp + 0x3c], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4014f0
push ebx
lea ecx, [esp + 0x38]
push ecx
push 0x4011ac
mov dword [esp + 0x40], ebx
call ebp
push eax
push 0x4011ac
push 0xfffffffffffffff4
call edi
push eax
call esi
call fcn.004012d0
push ebx
lea edx, [esp + 0x38]
push edx
push 0x4011e8
mov dword [esp + 0x40], ebx
call ebp
push eax
push 0x4011e8
push 0xfffffffffffffff4
call edi
push eax
call esi
jmp 0x401636
push ebx
lea eax, [esp + 0x38]
push eax
push 0x4011f0
mov dword [esp + 0x40], ebx
call ebp
push eax
push 0x4011f0
push 0xfffffffffffffff4
call edi
push eax
call esi
call fcn.004012d0
push ebx
lea ecx, [esp + 0x38]
push ecx
push 0x4011ec
mov dword [esp + 0x40], ebx
call ebp
push eax
push 0x4011ec
push 0xfffffffffffffff4
call edi
push eax
call esi
jmp 0x401636
mov byte [esp + 0x13], 1
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esp + 0x13], bl
je 0x4013a6
push ebx
lea edx, [esp + 0x38]
push edx
push 0x401244
mov dword [esp + 0x40], ebx
call ebp
push eax
push 0x401244
push 0xfffffffffffffff4
call edi
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll_ExitProcess]