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

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0xc
push ebx
push ebp
push esi
push edi
push 1
push eax
call fcn.00408360
add esp, 8
test al, al
jne 0x408784
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ecx, dword [esp + 0x20]
push 2
push ecx
call fcn.00408360
add esp, 8
test al, al
je 0x40877a
mov ebx, dword [0x4692c4]
mov edx, dword [0x469ac8]
cmp edx, dword [ebx*4 + 0x469ec4]
jb 0x40877a
mov eax, dword [0x4692c0]
cmp ebx, eax
jg 0x4088dc
je 0x4088dc
xor ebp, ebp
xor esi, esi
cmp ebx, ebp
jle 0x4089e9
jmp 0x4087d0
cmp esi, eax
mov dword [esp + 0x10], ebp
jge 0x408808
mov edi, dword [esi*4 + 0x469ec8]
mov eax, esi
lea ecx, [esi*4 + 0x469ac8]
mov edx, dword [ecx]
cmp edx, edi
je 0x408819
ja 0x408819
add dword [esp + 0x10], 1
add eax, 1
add ecx, 4
cmp eax, dword [0x4692c0]
jl 0x4087e8
mov eax, dword [0x4692c0]
add esi, 1
cmp esi, ebx
jl 0x4087d0
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x24]
push ebp
push 0x80
push 3
push ebp
push ebp
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [esi*4 + 0x4696c8]
push ebp
push ebp
mov edi, eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esi*4 + 0x469ec8]
lea ebx, [esi*4 + 0x469ec8]
push edx
call fcn.00415d30
mov ecx, dword [ebx]
add esp, 4
push 0
mov ebp, eax
lea eax, [esp + 0x18]
push eax
push ecx
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x20]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov eax, dword [esp + 0x10]
push 0
add eax, esi
mov ecx, dword [eax*4 + 0x4692c8]
push 0
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx]
push 0
lea edx, [esp + 0x1c]
push edx
push eax
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.00415d35
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
xor ebp, ebp
test eax, eax
jle 0x4089e9
xor esi, esi
cmp ebp, ebx
jge 0x40891a
mov edi, dword [ebp*4 + 0x469ac8]
mov eax, ebp
lea ecx, [ebp*4 + 0x469ec8]
lea esp, [esp]
mov edx, dword [ecx]
cmp edx, edi
je 0x40892b
jb 0x40892b
add eax, 1
add esi, 1
add ecx, 4
cmp eax, ebx
jl 0x408900
mov eax, dword [0x4692c0]
add ebp, 1
cmp ebp, eax
jl 0x4088e6
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ecx, dword [esp + 0x24]
push 0
push 0x80
push 3
push 0
push 0
push SysReAllocStringLen
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
add esi, ebp
push 0
add esi, esi
mov edx, dword [esi + esi + 0x4696c8]
add esi, esi
push 0
mov edi, eax
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 0x469ec8]
push eax
call fcn.00415d30
mov edx, dword [esi + 0x469ec8]
add esp, 4
push 0
lea ecx, [esp + 0x1c]
push ecx
push edx
mov ebx, eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp*4 + 0x4692c8]
push 0
push 0
mov edi, eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 0x469ec8]
push 0
lea edx, [esp + 0x18]
push edx
push eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.00415d35
add esp, 4
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0xc
ret