Function at 0x410590
Capabilities:
Get file size
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, 3
mov dword [ebp - 0x10], ecx
mov ebx, edx
mov dword [ebp - 0xc], edi
and edx, edi
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0xc
cmp edx, 2
ja 0x4105cd
mov eax, ebx
and eax, 9
cmp al, 9
jne 0x4105d9
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 4
test edx, edx
jne 0x410658
mov esi, 0x80000000
mov eax, edi
push 0
push 0x80
cmp ebx, 0x10a
je 0x410685
push eax
lea eax, [ebp - 0x24]
push eax
push edi
push esi
push ecx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x41e81c
push 8
push edi
call dword [sym.imp.msvcrt.dll__open_osfhandle]
add esp, 8
mov esi, eax
test bl, 8
jne 0x4106bf
lea eax, [esi - 3]
xor ecx, ecx
mov edx, esi
cmp eax, 0x5b
ja 0x41064d
cmp esi, 0x1f
jg 0x41e8a8
mov eax, dword [ecx*4 + 0x4367ac]
bts eax, edx
mov dword [ecx*4 + 0x4367ac], eax
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x40241c
push ecx
mov esi, 0x40000000
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x410678
mov edi, 1
mov dword [ebp - 0xc], edi
mov ecx, dword [ebp - 0x10]
mov eax, 2
jmp 0x4105e4
push 3
lea eax, [ebp - 0x24]
push eax
push edi
mov eax, esi
or eax, 0x80000000
push eax
push ecx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x410610
push 0
push 0x80
push 4
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp - 0x10]
jmp 0x4105ff
mov ecx, esi
call fcn.0040dd98
test eax, eax
jne 0x410627
lea eax, [ebp - 0x10]
push eax
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileSize]
mov dword [ebp - 0x14], eax
or eax, dword [ebp - 0x10]
je 0x410627
xor eax, eax
mov dword [ebp - 8], 0xffffffff
push 2
mov word [ebp - 4], ax
lea eax, [ebp - 8]
push eax
push 0xffffffffffffffff
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x41e83f
push 0
lea eax, [ebp - 0x18]
push eax
push 1
lea eax, [ebp - 4]
push eax
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
test eax, eax
je 0x41e872
cmp word [ebp - 4], 0x1a
jne 0x410627
jmp 0x41e88d
add esp, 4
movzx ecx, al
test ecx, ecx
jne 0x41e82d
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.0041db30
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e858
sbb byte [edx + 3], ch
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.0041d290
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e883
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.0041dc20
add esp, 4
movzx eax, al
les eax, [edi + ecx]
mov dh, 0xc0
test eax, eax
jne 0x41e8ae
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
shr cl, 0x19
add dword [eax], eax
add byte [ebx - 0x17adf7ab], cl
leave
invalid
mov edx, dword [ebp + 8]
push edx
call fcn.0041db80
add esp, 4
mov eax, dword [ebp + 8]
push eax
call fcn.00421350
add esp, 4
movzx ecx, al
test ecx, ecx
jne 0x41e8d4
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.00421c20
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e8ff
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.0041dc60
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e92a
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.004222f0
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e952
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.00422610
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e97a
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
push 0x12c
push 0x64
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov ecx, dword [eax]
push ecx
call fcn.0041a530
add esp, 0xc
mov edx, dword [ebp + 8]
push edx
call fcn.00422ad0
add esp, 4
movzx eax, al
test eax, eax
jne 0x41e9b9
push 3
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx]
mov ecx, dword [eax + 0xb4]
call ecx
xor al, al
jmp 0x41e9c7
mov edx, dword [ebp + 8]
push edx
call fcn.00421310
add esp, 4
mov al, 1
pop ebp
ret