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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x28
push ebx
mov ebx, eax
mov eax, dword [ebp + 8]
lea ecx, [edi + 0x60]
push esi
mov dword [esp + 0x10], ecx
call fcn.00409d32
cmp byte [eax + 0x1c], 0
je 0x408bce
xor eax, eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [eax + 0xc]
mov ecx, dword [edi + 0x58]
xor edx, edx
push edx
push eax
mov dword [esp + 0x30], eax
xor esi, esi
call fcn.0041542c
pop ecx
pop ecx
test al, al
jne 0x408c07
mov ecx, dword [ebx + 4]
cmp ecx, esi
je 0x408c02
mov edx, dword [ecx]
xor eax, eax
push eax
push dword [esp + 0x2c]
push dword [edi + 0x58]
call dword [edx]
test eax, eax
jne 0x408c07
push 0xa
pop eax
jmp 0x408bc6
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
call fcn.00409d32
cmp dword [eax + 4], 0xc
mov eax, dword [edi + 0x58]
sete byte [esp + 0xb]
sub eax, 0x10
call fcn.00407082
mov ecx, dword [esp + 0x10]
add eax, 0x10
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 8]
call fcn.00409d32
add eax, 0x18
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [esp + 0x14]
call fcn.00401663
mov ebx, dword [ebx]
mov dword [esp + 0x20], ebx
cmp ebx, esi
je 0x408c93
mov esi, dword [ebx]
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
add esi, 0x1c
call fcn.00409d32
push 0
push dword [eax + 0xc]
mov ecx, ebx
call dword [esi]
mov esi, dword [ebx]
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
add esi, 0x14
call fcn.00409d32
push dword [eax]
lea eax, [esp + 0x10]
call fcn.0040797e
push eax
mov ecx, ebx
call dword [esi]
xor esi, esi
cmp byte [esp + 0xb], 0
je 0x408caf
lea esi, [edi + 0x90]
lea ebx, [esp + 0xc]
call fcn.00406b45
mov ebx, dword [esp + 0x20]
xor esi, esi
lea eax, [edi + 0x9c]
push eax
lea eax, [esp + 0x10]
push esi
push eax
call fcn.00407b1c
add esp, 0xc
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x28], eax
cmp eax, 0xffffffff
jne 0x408d00
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
call fcn.004039c4
push 2
jmp 0x408c04
mov eax, dword [edi + 0x6c]
mov ecx, dword [esp + 0x10]
push esi
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 8]
push esi
call fcn.00409d32
mov eax, dword [eax + 0x10]
add eax, dword [edi + 0x80]
push eax
push dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x408d54
cmp dword [esp + 0x28], esi
je 0x408d3e
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
pop esi
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
call fcn.004039c4
mov eax, esi
jmp 0x408bc6
push 0x10000
call fcn.0042371a
pop ecx
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 8]
call fcn.00409d32
mov eax, dword [eax + 0xc]
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], esi
cmp ebx, esi
je 0x408d8d
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x24]
test al, al
jne 0x408e40
mov ecx, dword [esp + 0x18]
mov eax, 0x10000
cmp ecx, eax
jbe 0x408d9c
mov ecx, eax
mov eax, dword [edi + 0x6c]
push esi
lea edx, [esp + 0x18]
push edx
push ecx
push dword [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x408e03
cmp dword [esp + 0x14], esi
je 0x408e03
push esi
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x1c]
push dword [esp + 0x28]
push dword [esp + 0x38]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408e03
mov eax, dword [esp + 0x14]
cmp eax, esi
je 0x408e03
sub dword [esp + 0x18], eax
add dword [esp + 0x20], eax
cmp ebx, esi
je 0x408df9
mov eax, dword [esp + 0x20]
cdq
push edx
push eax
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x20]
cmp dword [esp + 0x18], esi
jg 0x408d7a
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
call fcn.00409d32
push dword [esp + 0x1c]
mov byte [eax + 0x1c], 1
call fcn.00423725
pop ecx
cmp dword [esp + 0x28], esi
je 0x408d41
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408d41
push dword [esp + 0x1c]
call fcn.00423725
pop ecx
cmp dword [esp + 0x28], esi
je 0x408e5a
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
jmp 0x408d40