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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x648
mov eax, dword [0x4310b4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [0x4397c0]
mov dword [ebp - 0x618], 0
mov dword [ebp - 0x630], 1
mov dword [ebp - 0x61c], ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x644], esi
push edi
test ebx, ebx
je 0x41faf6
mov ecx, dword [esi + 0x3c]
test ecx, ecx
je 0x41fad5
push 1
push ecx
lea edx, [ebp - 0x10c]
call fcn.0040a2b8
mov eax, dword [ebx + 8]
mov ecx, ebx
mov dword [ebp - 0x640], eax
call fcn.0040d16e
mov edi, eax
mov dword [ebp - 0x624], edi
cmp edi, 0xffffffff
je 0x41faf6
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileSize]
mov ecx, dword [esi + 0x3c]
mov dword [ebp - 0x63c], eax
call fcn.0040974c
cmp byte [0x4397cd], 0
mov esi, eax
je 0x40b776
push 4
push 0x402374
push esi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x40b776
movzx eax, word [esi + 8]
test ax, ax
jne 0x40bb17
mov eax, dword [ebp - 0x63c]
mov dword [ebx + 8], eax
mov byte [0x4397bc], 1
jmp 0x40b948
cmp byte [edi + 1], 0xa
jne 0x40b877
mov eax, dword [ebp - 0x62c]
mov byte [edi + 2], 0
sub edi, edx
push 0
add edi, 2
push 0
add eax, edi
mov dword [ebp - 0x620], edi
push eax
push dword [ebp - 0x634]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov ecx, edi
mov edx, dword [ebp - 0x638]
mov ebx, dword [0x435618]
cmp ebx, 0x2b
jb 0x41fc03
cmp ebx, 0xc42c
jae 0x41fc03
mov eax, 1
push 0x200
lea esi, [ebp - 0x614]
push esi
push ecx
push edx
push eax
push ebx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov ecx, eax
mov dword [ebp - 0x618], ecx
mov edi, dword [ebp - 0x624]
test eax, eax
je 0x40b978
test ecx, ecx
je 0x40b980
cmp ecx, 0xffffffff
je 0x40b978
cmp word [ebp - 0x614], 0
je 0x40b978
cmp word [ebp - 0x10c], 0
je 0x40b978
lea eax, [ecx + ecx]
cmp eax, 0x402
jae 0x40bb35
xor ecx, ecx
mov word [ebp + eax - 0x614], cx
lea eax, [ebp - 0x614]
push 0x3a
push eax
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x40b8a0
jmp 0x40b770
mov ebx, dword [ebp - 0x61c]
cmp dword [0x435614], 0
jne 0x41fb00
push 1
push 0
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
cmp dword [ebp - 0x630], 0
mov dword [ebx + 8], eax
je 0x40b966
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov ebx, eax
mov dword [ebp - 0x634], ebx
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x41fb0a
push 1
push 0
push 0
push ebx
mov edi, 0x43d860
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
push 0x44be6c
mov dword [ebp - 0x62c], eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x618]
push eax
push 0x200
push edi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
push 0x44be6c
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
mov ecx, dword [ebp - 0x618]
test esi, esi
je 0x41fb2e
mov dword [ebp - 0x620], ecx
test ecx, ecx
je 0x40bb2e
cmp dword [0x435618], 0xfde9
mov esi, ecx
mov dword [ebp - 0x628], esi
mov ebx, ecx
je 0x41fb35
mov edx, edi
mov dword [ebp - 0x638], edx
test ebx, ebx
jle 0x40b6b8
lea ecx, [ecx]
cmp esi, 3
jl 0x40b877
mov al, byte [edi]
cmp al, 0xa
je 0x41fb8d
cmp al, 0xd
je 0x40b67e
movzx eax, byte [edi]
cmp byte [eax + 0x44bb58], 0
jne 0x41fb9c
dec esi
mov eax, 1
add edi, eax
mov dword [ebp - 0x628], esi
test esi, esi
jg 0x40b860
jmp 0x40b6b8
mov esi, ebx
add ebx, 2
mov dword [ebp - 0x620], ebx
cmp word [esi], 0xa
je 0x40b8c4
lea eax, [ebp - 0x614]
cmp esi, eax
je 0x40b8c4
sub esi, 2
cmp word [esi], 0xa
jne 0x40b8b1
cmp word [esi], 0x3a
je 0x40b8cd
add esi, 2
mov edi, esi
test esi, esi
je 0x40b90b
movzx ebx, word [edi]
push ebx
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
je 0x40b8ee
cmp ebx, 0xa
je 0x40b8ee
add edi, 2
jmp 0x40b8d3
push ebx
push 0x4023d8
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41fc78
mov ebx, dword [ebp - 0x620]
cmp word [edi], 0x3a
je 0x40b9b3
test ebx, ebx
je 0x40b92f
push 0x3a
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x40b8a0
mov edi, dword [ebp - 0x624]
mov ebx, dword [ebp - 0x61c]
cmp byte [0x4397bc], 1
jne 0x40b776
xor esi, esi
mov ecx, edi
call fcn.0040fa2d
mov eax, esi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
cmp eax, dword [ebp - 0x640]
jl 0x40b7aa
mov ecx, dword [ebp - 0x618]
test ecx, ecx
jne 0x41fdd7
cmp dword [ebp - 0x630], 0
je 0x41fdd7
push 0
push 0
push 0
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov dword [ebp - 0x630], 0
jmp 0x40b770
test esi, esi
je 0x41fc86
push 0xa
push esi
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x620], ebx
test ebx, ebx
je 0x41fc8e
jmp 0x40b9e0
movzx esi, word [edi]
push esi
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x41fd20
push esi
push 0x4023d8
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41fd2a
movzx eax, word [edi]
cmp eax, 0x3a
jne 0x41fd3b
add edi, 2
test edi, edi
je 0x40ba4c
nop
movzx esi, word [edi]
push esi
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x41fd49
push esi
push 0x4023d8
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41fd53
xor ebx, ebx
mov edi, edi
movzx esi, word [edi]
push esi
push 0x4023bc
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x40ba99
push esi
push 0x4023cc
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x40ba99
cmp esi, 0x5e
je 0x41fd64
mov ecx, esi
lea eax, [ebx + 1]
mov word [ebp + ebx*2 - 0x20c], cx
add edi, 2
mov ebx, eax
cmp eax, 0x7f
jb 0x40ba50
xor eax, eax
mov word [ebp + ebx*2 - 0x20c], ax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.msvcrt.dll__wcsicmp]
mov ebx, dword [ebp - 0x620]
add esp, 8
test eax, eax
jne 0x40b915
mov eax, dword [ebp - 0x644]
test byte [eax + 0x40], 1
je 0x41fd70
mov al, 1
mov byte [0x4397bc], al
call fcn.00408994
test ebx, ebx
je 0x41fd77
lea ecx, [ebp - 0x614]
sub ebx, ecx
add ebx, 2
sar ebx, 1
test al, al
jne 0x41fda5
mov esi, dword [ebp - 0x61c]
mov edi, dword [ebp - 0x624]
add dword [esi + 8], ebx
mov ebx, esi
jmp 0x40b93b
push eax
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x40b669
jmp 0x40b776
xor eax, eax
jmp 0x40b6f6
call fcn.00417cea
int3
mov ecx, ebx
call fcn.0040896a
mov eax, dword [ebx + 0x110]
push 0
push 0x2330
mov dword [0x4397c0], eax
call fcn.004128ff
add esp, 8
mov eax, 1
jmp 0x40b953
call fcn.0042ce09
jmp 0x40b783
lea eax, [ebp - 0x618]
mov ecx, ebx
push eax
push 0x200
lea edx, [ebp - 0x614]
call fcn.0042775c
mov ecx, dword [ebp - 0x618]
jmp 0x40b6fc
xor eax, eax
jmp 0x40b6f6
cmp dword [ebp - 0x62c], 0
jne 0x40b84d
push 3
push 0x403644
push 0x43d860
call sub.msvcrt.dll_memcmp
add esp, 0xc
mov ecx, ebx
test eax, eax
jne 0x40b84d
add ecx, 0xfffffffd
mov dword [ebp - 0x62c], 3
mov esi, ecx
mov dword [ebp - 0x620], ecx
mov edi, 0x43d863
mov dword [ebp - 0x618], ecx
mov dword [ebp - 0x628], esi
mov ebx, ecx
jmp 0x40b84d
cmp byte [edi + 1], 0xd
je 0x40b688
jmp 0x40b877
cmp esi, 1
je 0x41fbae
add esi, 0xfffffffe
mov eax, 2
jmp 0x40b88d
push 0x44be6c
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x628]
push eax
push 1
lea eax, [edi + 1]
push eax
push dword [ebp - 0x634]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
push 0x44be6c
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
test esi, esi
je 0x41fbfa
cmp dword [ebp - 0x628], 0
je 0x41fbfa
mov ecx, dword [ebp - 0x620]
inc ecx
jmp 0x40b6b2
xor ecx, ecx
xor eax, eax
jmp 0x40b6f0
cmp ebx, 0xc435
ja 0x41fc42
je 0x41fc71
cmp ebx, 0xc431
ja 0x41fc35
je 0x41fc71
cmp ebx, 0x2a
je 0x41fc71
cmp ebx, 0xc42b
jbe 0x40b6d3
cmp ebx, 0xc42e
jbe 0x41fc71
jmp 0x40b6d3
cmp ebx, 0xc433
je 0x41fc71
jmp 0x40b6d3
cmp ebx, 0xdeb3
ja 0x41fc62
cmp ebx, 0xdeaa
jae 0x41fc71
cmp ebx, 0xcec8
je 0x41fc71
cmp ebx, 0xd698
jmp 0x41fc3b
lea eax, [ebx - 0xfde8]
cmp eax, 1
ja 0x40b6d3
xor eax, eax
jmp 0x40b6d8
test bx, bx
je 0x40b905
jmp 0x40b8e9
xor ebx, ebx
mov dword [ebp - 0x620], ebx
push 1
push 0
push 0
push dword [ebp - 0x624]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
cmp eax, dword [ebp - 0x63c]
je 0x40b9e0
mov ecx, dword [ebp - 0x618]
cmp ecx, 0x200
je 0x40b9e0
lea eax, [ebp - 0x614]
sub esi, eax
sar esi, 1
sub ecx, esi
call fcn.00408994
test al, al
je 0x41fcfd
push 0
push 0
push 0
push 0
push ecx
lea eax, [ebp - 0x614]
push eax
push 0
push dword [0x435618]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov ecx, eax
mov edi, dword [ebp - 0x624]
neg ecx
push 1
push 0
push ecx
push edi
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
jmp 0x40b935
cmp esi, 0xa
jne 0x41fd33
jmp 0x40b9f5
test si, si
je 0x40ba0c
add edi, 2
jmp 0x40b9e0
cmp eax, 0x2b
jne 0x40ba1b
jmp 0x40ba18
cmp esi, 0xa
jne 0x41fd5c
jmp 0x40ba35
test si, si
je 0x40ba4c
add edi, 2
jmp 0x40ba20
movzx ecx, word [edi + 2]
add edi, 2
jmp 0x40ba84
xor al, al
jmp 0x40bada
test al, al
je 0x41fd8b
push 0
push 0
push 0
push 0
push dword [ebp - 0x618]
jmp 0x41fdae
mov ebx, dword [ebp - 0x61c]
mov eax, dword [ebp - 0x618]
mov edi, dword [ebp - 0x624]
add dword [ebx + 8], eax
jmp 0x40b93b
push 0
push 0
push 0
push 0
push ebx
lea eax, [ebp - 0x614]
push eax
push 0
push dword [0x435618]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov ebx, dword [ebp - 0x61c]
mov edi, dword [ebp - 0x624]
add dword [ebx + 8], eax
jmp 0x40b93b
mov esi, dword [ebp - 0x61c]
mov ecx, esi
call fcn.0040896a
mov eax, dword [esi + 0x110]
mov dword [0x4397c0], eax
lea eax, [ebp - 0x10c]
push eax
push 1
push 0x400023ab
call fcn.004128ff
add esp, 0xc
mov esi, 1
jmp 0x40b94a