Function at 0x10014590
Capabilities:
Read file on windows

Disassembly:
sub esp, 0xc
push ebx
push ebp
mov ebp, ecx
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
mov dword [esp + 0x20], ecx
add ecx, esi
cmp ecx, eax
push edi
jb 0x100145b3
sub eax, esi
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x14]
mov cl, byte [eax + 0x20]
test cl, cl
je 0x10014742
mov ecx, dword [eax + 0x1c]
cmp ecx, 4
jge 0x100146db
mov dl, byte [eax + 0x29]
test dl, dl
je 0x100146db
test ecx, ecx
jle 0x100145f4
mov esi, dword [eax + 0x18]
mov edi, dword [eax + 0xc]
sub esi, ecx
mov edx, ecx
shr ecx, 2
add esi, edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0x14]
mov esi, dword [eax + 0x18]
mov edi, dword [eax + 0x1c]
mov ecx, dword [ebp + 0x10]
sub esi, edi
cmp ecx, esi
jg 0x10014613
mov esi, ecx
cmp ecx, esi
jg 0x10014613
mov byte [eax + 0x29], 0
mov esi, dword [ebp + 0x10]
test esi, esi
jle 0x100146c4
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 0x25]
mov edx, dword [eax + 0x1c]
push ecx
mov ecx, dword [eax + 0xc]
push esi
mov ebx, 1
add edx, ecx
push ebx
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, esi
je 0x100146c4
mov eax, dword [ebp + 0x14]
mov esi, dword [eax + 4]
lea ecx, [esp + 0x10]
call sym.rlmfc.dll_protected:_void___thiscall_R_Exception::constructor_void_
push esi
lea ecx, [esp + 0x14]
push str.Unable_to_read_data_from___s_
mov edi, vtable.R_FileException_UnableToReadData.0
push ecx
mov dword [esp + 0x1c], edi
call sym.rlmfc.dll_public:_void___cdecl_R_Exception::setError_char_const__
mov al, byte [0x100625ec]
add esp, 0xc
test bl, al
jne 0x1001469e
mov dl, al
or dl, bl
mov ecx, 0x100625f0
mov byte [0x100625ec], dl
call sym.rlmfc.dll_protected:_void___thiscall_R_Exception::constructor_void_
push 0x10016080
mov dword [0x100625f0], edi
call fcn.100281de
add esp, 4
lea edx, [esp + 0x10]
push edx
mov ecx, 0x100625f0
call sym.rlmfc.dll_public:_class_R_Exception____thiscall_R_Exception::operator_class_R_Exception_const__
push 0x1002d1b0
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x28], 0x100625f0
call sub.MSVCRT.dll__CxxThrowException
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
sub edx, esi
mov dword [ebp + 0x10], edx
add dword [eax + 0x1c], esi
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 0xc]
mov dword [eax + 0x10], ecx
mov eax, dword [ebp + 0x14]
mov edi, dword [eax + 0x1c]
mov ebx, dword [esp + 0x20]
xor edx, edx
mov dl, byte [eax + 0x29]
lea ecx, [eax + 0x1c]
push edx
mov edx, dword [eax + 0x10]
push ecx
mov ecx, dword [esp + 0x2c]
push ecx
push ebx
push edx
lea ecx, [eax + 0x2a]
call fcn.10013ad0
mov esi, eax
mov eax, dword [ebp + 0x14]
mov edx, dword [eax + 0x1c]
mov ecx, dword [eax + 0x10]
sub edi, edx
add ecx, edi
mov dword [eax + 0x10], ecx
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0x24]
add edx, esi
cmp eax, esi
mov dword [ebp + 8], edx
jle 0x100148db
mov edx, dword [ebp]
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
mov ecx, ebp
call dword [edx + 0x14]
pop edi
add eax, esi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 8
cmp dword [eax + 0x21], ebp
je 0x10014786
mov edi, dword [eax + 0x1c]
test edi, edi
jle 0x10014786
mov ebx, dword [eax + 0x14]
cmp esi, ebx
jb 0x10014779
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 0x10]
sub ebx, ecx
add ebx, edx
add ebx, edi
cmp esi, ebx
jae 0x10014779
sub ecx, dword [eax + 0x14]
add ecx, esi
sub edx, ecx
add edx, edi
mov dword [eax + 0x1c], edx
mov edx, dword [ebp + 0x14]
mov dword [edx + 0x10], ecx
jmp 0x10014780
mov dword [eax + 0x1c], 0
mov eax, dword [ebp + 0x14]
mov dword [eax + 0x21], ebp
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 0x1c]
test ecx, ecx
jne 0x10014882
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x25]
push 0
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 8]
mov dword [eax + 0x14], ecx
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x14]
sub eax, esi
mov esi, dword [ecx + 0x18]
add esp, 0xc
cmp eax, esi
jg 0x100147c6
mov esi, eax
cmp eax, esi
ja 0x100147ca
mov esi, eax
test esi, esi
jle 0x10014873
mov edx, dword [ecx + 0x25]
mov eax, dword [ecx + 0xc]
push edx
push esi
mov ebx, 1
push ebx
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, esi
je 0x10014873
mov ecx, dword [ebp + 0x14]
mov esi, dword [ecx + 4]
lea ecx, [esp + 0x10]
call sym.rlmfc.dll_protected:_void___thiscall_R_Exception::constructor_void_
push esi
lea edx, [esp + 0x14]
push str.Unable_to_read_data_from___s_
mov edi, vtable.R_FileException_UnableToReadData.0
push edx
mov dword [esp + 0x1c], edi
call sym.rlmfc.dll_public:_void___cdecl_R_Exception::setError_char_const__
mov al, byte [0x100625ec]
add esp, 0xc
test bl, al
jne 0x1001484d
mov dl, al
or dl, bl
mov ecx, 0x100625f0
mov byte [0x100625ec], dl
call sym.rlmfc.dll_protected:_void___thiscall_R_Exception::constructor_void_
push 0x10016080
mov dword [0x100625f0], edi
call fcn.100281de
add esp, 4
lea eax, [esp + 0x10]
push eax
mov ecx, 0x100625f0
call sym.rlmfc.dll_public:_class_R_Exception____thiscall_R_Exception::operator_class_R_Exception_const__
push 0x1002d1b0
lea ecx, [esp + 0x24]
push ecx
mov dword [esp + 0x28], 0x100625f0
call sub.MSVCRT.dll__CxxThrowException
mov edx, dword [ebp + 0x14]
mov dword [edx + 0x1c], esi
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 0xc]
mov dword [eax + 0x10], ecx
mov eax, dword [ebp + 0x14]
mov ebx, dword [eax + 0x1c]
mov ecx, dword [esp + 0x24]
cmp ecx, ebx
jge 0x10014892
mov ebx, ecx
mov esi, dword [eax + 0x10]
mov edx, dword [esp + 0x20]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0x14]
add dword [eax + 0x10], ebx
mov eax, dword [ebp + 0x14]
sub dword [eax + 0x1c], ebx
mov edi, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
mov eax, dword [esp + 0x24]
add edi, ebx
mov dword [ebp + 8], edi
cmp eax, dword [ecx + 0x1c]
jle 0x100148db
mov esi, dword [ebp]
sub eax, ebx
push eax
add edx, ebx
push edx
mov ecx, ebp
call dword [esi + 0x14]
add eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 8