Function at 0x40c890
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42788e
mov eax, dword fs:[0]
push eax
sub esp, 0xd80
mov eax, dword [0x431474]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
add eax, 0x208
mov dword [ebp - 0xad4], eax
mov byte [ebp - 0x284], 0
push 0x103
push 0
lea ecx, [ebp - 0x283]
push ecx
call fcn.00413bb0
add esp, 0xc
mov byte [ebp - 0x38c], 0
push 0x103
push 0
lea edx, [ebp - 0x38b]
push edx
call fcn.00413bb0
add esp, 0xc
lea eax, [ebp - 0x284]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0040b5a0
add esp, 8
lea edx, [ebp - 0x38c]
push edx
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040b5a0
add esp, 8
push str..tmp
lea ecx, [ebp - 0x284]
push ecx
call fcn.004165e0
add esp, 8
mov word [ebp - 0x594], 0
push 0x206
push 0
lea edx, [ebp - 0x592]
push edx
call fcn.00413bb0
add esp, 0xc
lea eax, [ebp - 0x594]
push eax
lea ecx, [ebp - 0x284]
push ecx
call fcn.0040b660
add esp, 8
mov dword [ebp - 0xb4c], 0
lea edx, [ebp - 0xb4c]
push edx
lea eax, [ebp - 0x594]
push eax
mov ecx, dword [ebp - 0xad4]
push ecx
call fcn.004053e0
add esp, 0xc
mov dword [ebp - 0xadc], eax
lea ecx, [ebp - 0xad0]
call fcn.00405a30
mov dword [ebp - 4], 0
push 0x42ac58
lea edx, [ebp - 0x284]
push edx
call fcn.004171b0
add esp, 8
mov dword [ebp - 0x17c], eax
mov dword [ebp - 0xb48], 0
mov dword [ebp - 0x598], 0
cmp dword [ebp - 0x17c], 0
jne 0x40ca0c
mov byte [ebp - 0xd5d], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xad0]
call fcn.00402b40
mov al, byte [ebp - 0xd5d]
jmp 0x40cd3c
mov eax, dword [ebp - 0x17c]
push eax
call fcn.0041b7c5
add esp, 4
push eax
call fcn.00416fed
add esp, 4
mov dword [ebp - 0x598], eax
mov byte [ebp - 0xab4], 0
push 0x513
push 0
lea ecx, [ebp - 0xab3]
push ecx
call fcn.00413bb0
add esp, 0xc
mov dword [ebp - 0x178], 0
mov dword [ebp - 0xd5c], 0
push 0
push 0x104
lea edx, [ebp - 0xab4]
push edx
call fcn.00413bb0
add esp, 0xc
mov eax, dword [ebp - 0x17c]
push eax
push 0x513
push 1
lea ecx, [ebp - 0xab4]
push ecx
call fcn.00416e29
add esp, 0x10
mov dword [ebp - 0xd5c], eax
mov edx, dword [ebp - 0x178]
add edx, dword [ebp - 0xd5c]
mov dword [ebp - 0x178], edx
lea eax, [ebp - 0xab4]
push eax
lea ecx, [ebp - 0xad0]
call fcn.0040d050
mov ecx, dword [ebp - 0x178]
cmp ecx, dword [ebp - 0x598]
jl 0x40ca51
mov edx, dword [ebp - 0x17c]
push edx
call fcn.0041625e
add esp, 4
lea ecx, [ebp - 0x30]
call fcn.00405a30
mov byte [ebp - 4], 1
lea eax, [ebp - 0xad0]
push eax
lea ecx, [ebp - 0xd7c]
push ecx
call fcn.0040b970
add esp, 8
mov dword [ebp - 0xd84], eax
mov edx, dword [ebp - 0xd84]
mov dword [ebp - 0xd88], edx
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0xd88]
push eax
lea ecx, [ebp - 0x30]
call fcn.004059f0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xd7c]
call fcn.00402b40
push 0x42ac5c
lea ecx, [ebp - 0x38c]
push ecx
call fcn.004171b0
add esp, 8
mov dword [ebp - 0xad8], eax
cmp dword [ebp - 0xad8], 0
jne 0x40cb7e
mov byte [ebp - 0xd7d], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x30]
call fcn.00402b40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xad0]
call fcn.00402b40
mov al, byte [ebp - 0xd7d]
jmp 0x40cd3c
mov edx, dword [ebp - 0xad8]
push edx
lea ecx, [ebp - 0x30]
call fcn.00406270
push eax
push 1
lea ecx, [ebp - 0x30]
call fcn.0040bf30
push eax
call fcn.0041615e
add esp, 0x10
mov dword [ebp - 0xd58], eax
mov eax, dword [ebp - 0xad8]
push eax
call fcn.0041625e
add esp, 4
mov byte [ebp - 0x68], 0
push 0x31
push 0
lea ecx, [ebp - 0x67]
push ecx
call fcn.00413bb0
add esp, 0xc
mov word [ebp - 0xb44], 0
push 0x62
push 0
lea edx, [ebp - 0xb42]
push edx
call fcn.00413bb0
add esp, 0xc
mov byte [ebp - 0x174], 0
push 0x103
push 0
lea eax, [ebp - 0x173]
push eax
call fcn.00413bb0
add esp, 0xc
push 0x42ac60
call fcn.00414110
add esp, 4
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
push ecx
push str.55a9a3e6e39b74636588416b51a753b5
lea edx, [ebp - 0x174]
push edx
call fcn.004158c0
add esp, 0xc
mov word [ebp - 0xd54], 0
push 0x206
push 0
lea eax, [ebp - 0xd52]
push eax
call fcn.00413bb0
add esp, 0xc
lea ecx, [ebp - 0xd54]
push ecx
lea edx, [ebp - 0x284]
push edx
call fcn.0040b660
add esp, 8
mov eax, dword [ebp - 0x34]
push eax
lea ecx, [ebp - 0x174]
push ecx
push 0x32
lea edx, [ebp - 0x68]
push edx
lea eax, [ebp - 0xd54]
push eax
call fcn.0040b270
add esp, 0x14
push 0x32
lea ecx, [ebp - 0xb44]
push ecx
push 0x32
lea edx, [ebp - 0x68]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0xb44]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x40ccde
mov byte [ebp - 0xd7e], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x30]
call fcn.00402b40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xad0]
call fcn.00402b40
mov al, byte [ebp - 0xd7e]
jmp 0x40cd3c
cmp dword [ebp - 0xadc], 1
jl 0x40ccf9
cmp dword [ebp - 0xadc], 5
jg 0x40ccf9
mov byte [ebp - 0xd89], 0
jmp 0x40cd00
mov byte [ebp - 0xd89], 1
mov dl, byte [ebp - 0xd89]
mov byte [ebp - 0x599], dl
mov al, byte [ebp - 0x599]
mov byte [ebp - 0xd7f], al
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x30]
call fcn.00402b40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xad0]
call fcn.00402b40
mov al, byte [ebp - 0xd7f]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00413b95
mov esp, ebp
pop ebp
ret