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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [0x7e2670]
xor eax, ebp
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x140], ecx
mov eax, dword [ebp - 0x140]
mov dword [eax + 0x24], 0
cmp dword [ebp + 8], 0
je 0x41134c
mov ecx, dword [ebp + 8]
push ecx
call fcn.00666cf0
add esp, 4
test eax, eax
jne 0x411372
push 0x6c9d04
call fcn.0066610b
add esp, 4
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
or eax, 0xffffffff
jmp 0x41176d
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
push 0x6c9d30
mov edx, dword [ebp + 8]
push edx
call fcn.00669fd1
add esp, 8
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 8], 0
jne 0x4113d1
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.open_file_error:filepath_s_lasterror_d._r_n
call fcn.0066610b
add esp, 0xc
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
or eax, 0xffffffff
jmp 0x41176d
cmp dword [ebp - 8], 0
je 0x411406
push 2
push 0
mov edx, dword [ebp - 8]
push edx
call fcn.00669e99
add esp, 0xc
mov eax, dword [ebp - 8]
push eax
call fcn.00669daa
add esp, 4
mov dword [ebp - 0x10], eax
push 0
push 0
mov ecx, dword [ebp - 8]
push ecx
call fcn.00669e99
add esp, 0xc
mov edx, dword [ebp - 0x10]
push edx
push str.file.size_d_r_n
call fcn.0066610b
add esp, 8
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
cmp dword [ebp - 0x10], 0
jne 0x411449
mov eax, dword [ebp - 8]
push eax
call fcn.00669ba2
add esp, 4
mov dword [ebp - 8], 0
or eax, 0xffffffff
jmp 0x41176d
mov dword [ebp - 4], 0
mov dword [ebp - 0xc], 2
cmp dword [0x7c39ec], 0x80
jne 0x41146a
mov dword [ebp - 0xc], 1
mov dword [ebp - 0x18], 0
jmp 0x41147c
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0xc]
jge 0x411726
mov dword [ebp - 0x128], 0x100
mov byte [ebp - 0x120], 0
push 0xff
push 0
lea eax, [ebp - 0x11f]
push eax
call fcn.006665c0
add esp, 0xc
mov dword [ebp - 0x134], 0
push 0x100
push 0
lea ecx, [ebp - 0x120]
push ecx
call fcn.006665c0
add esp, 0xc
mov edx, dword [ebp - 8]
push edx
push 0x100
push 1
lea eax, [ebp - 0x120]
push eax
call fcn.00669b18
add esp, 0x10
mov dword [ebp - 0x134], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x134], 0x100
je 0x41153c
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp + 8]
push edx
push 0x6c9d70
call fcn.0066610b
add esp, 0xc
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov eax, dword [ebp - 0x140]
mov dword [eax + 0x24], 0xffffffff
jmp 0x411726
movzx ecx, byte [ebp - 0x120]
mov edx, dword [ebp - 0x140]
mov dword [edx + 0xc8], ecx
mov dword [ebp - 0x12c], 0
mov dword [ebp - 0x1c], 0
push 4
lea eax, [ebp - 0x114]
push eax
lea ecx, [ebp - 0x12c]
push ecx
call fcn.00668860
add esp, 0xc
push 4
lea edx, [ebp - 0x110]
push edx
lea eax, [ebp - 0x1c]
push eax
call fcn.00668860
add esp, 0xc
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x12c]
mov dword [ebp - 0x124], ecx
mov edx, dword [ebp - 0x124]
push edx
call fcn.00576bfc
add esp, 4
mov dword [ebp - 0x138], eax
mov eax, dword [ebp - 0x138]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x124]
push ecx
push 0
mov edx, dword [ebp - 4]
push edx
call fcn.006665c0
add esp, 0xc
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x124]
push ecx
push 1
mov edx, dword [ebp - 4]
push edx
call fcn.00669b18
add esp, 0x10
mov dword [ebp - 0x134], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x134]
cmp eax, dword [ebp - 0x124]
je 0x41163d
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp + 8]
push edx
push 0x6c9d9c
call fcn.0066610b
add esp, 0xc
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov eax, dword [ebp - 0x140]
mov dword [eax + 0x24], 0xffffffff
jmp 0x411726
push 0x6c9dc8
mov ecx, dword [ebp - 0x140]
mov edx, dword [ecx + 0xc8]
imul edx, edx, 0x28
mov eax, dword [ebp - 0x140]
lea ecx, [eax + edx + 0x34]
call fcn.00404810
push eax
call fcn.00669fd1
add esp, 8
mov dword [ebp - 0x130], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x130], 0
je 0x4116ae
mov ecx, dword [ebp - 0x130]
push ecx
push 1
mov edx, dword [ebp - 0x124]
push edx
mov eax, dword [ebp - 4]
push eax
call fcn.00669854
add esp, 0x10
mov ecx, dword [ebp - 0x130]
push ecx
call fcn.00669ba2
add esp, 4
jmp 0x4116e3
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp + 8]
push eax
push str.read_file_error:filepath_s_lasterror_d._r_n
call fcn.0066610b
add esp, 0xc
call fcn.006684b5
add eax, 0x20
push eax
call fcn.00668459
add esp, 4
mov ecx, dword [ebp - 0x140]
mov dword [ecx + 0x24], 0xffffffff
jmp 0x411726
mov edx, dword [ebp - 0x140]
mov eax, dword [edx + 0xc8]
imul eax, eax, 0x28
mov ecx, dword [ebp - 0x140]
mov edx, dword [ebp - 0x12c]
mov dword [ecx + eax + 0x30], edx
mov eax, dword [ebp - 0x140]
mov ecx, dword [eax + 0xc8]
imul ecx, ecx, 0x28
mov edx, dword [ebp - 0x140]
mov eax, dword [ebp - 0x124]
mov dword [edx + ecx + 0x2c], eax
jmp 0x411473
cmp dword [ebp - 8], 0
je 0x41173f
mov ecx, dword [ebp - 8]
push ecx
call fcn.00669ba2
add esp, 4
mov dword [ebp - 8], 0
cmp dword [ebp - 4], 0
je 0x411764
mov edx, dword [ebp - 4]
mov dword [ebp - 0x13c], edx
mov eax, dword [ebp - 0x13c]
push eax
call fcn.00576bf1
add esp, 4
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x140]
mov eax, dword [ecx + 0x24]
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.006665ac
mov esp, ebp
pop ebp
ret 4