Function at 0x1000313d
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2df8
call fcn.10013f40
mov eax, dword [0x1001d008]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
mov edi, 0x2598
lea eax, [ebp + 8]
mov ebx, ecx
lea ecx, [ebp - 0x2dcc]
push edi
push eax
push ecx
mov dword [ebp - 0x2ddc], ebx
call fcn.10013f70
mov eax, dword [ebp + 0x25a0]
lea esi, [ebp - 0x2dcc]
add esp, 0xc
mov dword [ebp - 0x2dd8], eax
mov eax, edi
call fcn.10013f40
mov edi, esp
mov ecx, 0x966
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x2dd8]
mov ecx, ebx
push esi
call fcn.10002495
test eax, eax
je 0x100034e4
push 0x828
xor edi, edi
lea eax, [ebp - 0x834]
push edi
push eax
call fcn.10005730
add esp, 0xc
mov dword [ebp - 0x2dd4], edi
lea eax, [ebp - 0x834]
mov dword [ebp - 0x2dd0], edi
mov ecx, ebx
push 0x828
push eax
call fcn.100026b9
test eax, eax
je 0x100034e4
xor eax, eax
mov edx, 0x3ee
cmp esi, edx
mov edi, connect
setne al
xor ecx, ecx
add eax, 3
cmp esi, edx
mov edx, 0x40000000
mov dword [ebp - 0x2de4], eax
sete cl
cmp esi, 0x3ee
mov dword [ebp - 0x2de8], ecx
cmove edx, edi
xor edi, edi
mov dword [ebp - 0x2dec], edx
push edi
push 0x80
push eax
push edi
push ecx
push edx
lea eax, [ebp - 0x410]
mov dword [ebp - 0x82c], edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 0x82c]
mov edi, eax
cmp edi, 0xffffffff
mov eax, 0x1b6b
cmove ecx, eax
mov dword [ebp - 0x82c], ecx
test ecx, ecx
jne 0x100032d5
lea ecx, [ebp - 0x81c]
cmp esi, 0x3ee
lea eax, [ebp - 0x2dd4]
cmovne eax, ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp esi, 0x3ee
jne 0x100032a4
mov edx, dword [ebp - 0x2dd4]
mov ecx, dword [ebp - 0x2dd0]
mov dword [ebp - 0x824], edx
mov dword [ebp - 0x820], ecx
jmp 0x100032b0
mov ecx, dword [ebp - 0x820]
mov edx, dword [ebp - 0x824]
mov eax, dword [ebp - 0x818]
cmp eax, ecx
jl 0x100032db
jg 0x100032c4
cmp dword [ebp - 0x81c], edx
jbe 0x100032db
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x82c], 0x1b6d
mov eax, dword [ebp - 0x818]
cmp esi, 0x3ee
jne 0x10003308
cmp dword [ebp - 0x82c], 0
jne 0x10003357
test eax, eax
jl 0x10003357
jg 0x100032fb
cmp dword [ebp - 0x81c], 0
jbe 0x10003357
push 0
push 0
push eax
push dword [ebp - 0x81c]
jmp 0x1000332c
cmp dword [ebp - 0x82c], 0
jne 0x10003357
push 2
xorps xmm0, xmm0
push 0
movlpd qword [ebp - 0x2df4], xmm0
push dword [ebp - 0x2df0]
push dword [ebp - 0x2df4]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov ecx, dword [ebp - 0x824]
sub ecx, dword [ebp - 0x81c]
mov eax, dword [ebp - 0x820]
sbb eax, dword [ebp - 0x818]
mov dword [ebp - 0x2dd0], eax
mov dword [ebp - 0x2dd4], ecx
cmp dword [ebx + 0x4650], 0x7d4
jne 0x10003378
push 0x828
lea eax, [ebp - 0x834]
mov ecx, ebx
push eax
call fcn.1000265c
jmp 0x1000337a
xor eax, eax
test eax, eax
je 0x100034dd
cmp dword [ebp - 0x82c], 0
jne 0x1000348b
mov eax, dword [ebp - 0x2dd4]
or eax, dword [ebp - 0x2dd0]
jne 0x100033a9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1000348b
and dword [ebp - 0x2de0], 0
push 0x100000
call fcn.1000459c
mov edx, dword [ebp - 0x2dd0]
mov ebx, eax
pop ecx
test edx, edx
jl 0x10003477
mov ecx, dword [ebp - 0x2dd4]
jg 0x100033e9
test ecx, ecx
je 0x10003477
test edx, edx
jl 0x100033f0
jg 0x100033e9
cmp ecx, 0x100000
jbe 0x100033f0
mov esi, 0x100000
jmp 0x100033f2
mov esi, ecx
cmp dword [ebp - 0x2dd8], 0x3ee
jne 0x10003423
push 0
lea eax, [ebp - 0x2de0]
push eax
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [ebp - 0x2ddc]
push esi
push ebx
call fcn.10002641
test eax, eax
je 0x10003471
jmp 0x10003446
mov ecx, dword [ebp - 0x2ddc]
push esi
push ebx
call fcn.100026b9
test eax, eax
je 0x10003471
push 0
lea eax, [ebp - 0x2de0]
push eax
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x2dd4]
mov edx, dword [ebp - 0x2dd0]
sub ecx, esi
mov dword [ebp - 0x2dd4], ecx
sbb edx, 0
mov dword [ebp - 0x2dd0], edx
test edx, edx
jg 0x100033e9
jl 0x10003471
test ecx, ecx
jne 0x100033db
mov esi, dword [ebp - 0x2dd8]
push ebx
call fcn.100045a5
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x2ddc]
push 0x828
xor edi, edi
lea eax, [ebp - 0x834]
push edi
push eax
call fcn.10005730
add esp, 0xc
mov dword [ebp - 0x2dd4], edi
lea eax, [ebp - 0x834]
mov dword [ebp - 0x2dd0], edi
mov ecx, ebx
push 0x828
push eax
call fcn.100026b9
mov ecx, dword [ebp - 0x2de8]
test eax, eax
mov eax, dword [ebp - 0x2de4]
mov edx, dword [ebp - 0x2dec]
jne 0x1000322b
jmp 0x100034e4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1000423e
mov esp, ebp
pop ebp
ret 0x259c