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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x230
mov eax, dword [0x4261d4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [0x426054]
mov dword [ebp - 0x214], 0
mov dword [ebp - 0x218], ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x230], esi
push edi
mov edi, 1
mov dword [ebp - 0x220], edi
test ebx, ebx
je 0x41d4ba
mov ecx, dword [esi + 0x3c]
test ecx, ecx
je 0x41d499
push edi
push ecx
lea edx, [ebp - 0x10c]
call fcn.0040747b
mov eax, dword [ebx + 8]
mov ecx, ebx
mov dword [ebp - 0x22c], eax
call fcn.00405ddd
mov ebx, eax
mov dword [ebp - 0x210], ebx
cmp ebx, 0xffffffff
je 0x41d4ba
push 0
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileSize]
mov ecx, dword [esi + 0x3c]
mov dword [ebp - 0x228], eax
call fcn.004024cb
cmp byte [0x426004], 0
mov esi, eax
je 0x407648
push 4
push 0x40746c
push esi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x407801
cmp dword [0x426124], 0
jne 0x409378
push 1
push 0
push 0
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
mov esi, dword [ebp - 0x218]
mov dword [esi + 8], eax
cmp eax, dword [ebp - 0x22c]
jl 0x407685
test edi, edi
je 0x409382
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov ebx, eax
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x41d4c1
push 1
push 0
push 0
push ebx
mov esi, 0x427800
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
push 0x4261a4
mov dword [ebp - 0x224], eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x214]
push eax
push 0x200
push esi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_ReadFile]
push 0x4261a4
mov edi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
test edi, edi
mov edi, dword [ebp - 0x214]
je 0x40938a
test edi, edi
je 0x409371
mov ecx, edi
mov dword [ebp - 0x21c], ecx
test edi, edi
jle 0x407744
lea esp, [esp]
cmp ecx, 3
jl 0x407728
mov al, byte [esi]
cmp al, 0xa
je 0x41d4e4
cmp al, 0xd
je 0x407a74
movzx eax, byte [esi]
cmp byte [eax + 0x4267e0], 0
jne 0x41d4f3
dec ecx
inc esi
mov dword [ebp - 0x21c], ecx
test ecx, ecx
jg 0x407711
mov ecx, dword [0x426120]
cmp ecx, 0x2b
jb 0x41d54b
cmp ecx, 0xc42c
jae 0x41d54b
mov eax, 1
push 0x200
push 0x435800
push edi
push 0x427800
push eax
push ecx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov edi, eax
mov dword [ebp - 0x214], edi
mov esi, dword [ebp - 0x218]
test eax, eax
je 0x409391
test edi, edi
je 0x409399
cmp edi, 0xffffffff
je 0x409391
cmp word [0x435800], 0
je 0x409391
cmp word [ebp - 0x10c], 0
je 0x409391
lea eax, [edi + edi]
cmp eax, 0x4000
jae 0x41684a
xor ecx, ecx
push 0x3a
push 0x435800
mov word [eax + 0x435800], cx
call dword [sym.imp.msvcrt.dll_wcschr]
mov edi, dword [ebp - 0x220]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x407aa6
mov ebx, dword [ebp - 0x210]
jmp 0x407648
movzx eax, word [esi + 8]
test ax, ax
jne 0x40940c
mov ecx, dword [ebp - 0x218]
mov eax, dword [ebp - 0x228]
mov byte [0x426002], 1
mov dword [ecx + 8], eax
xor esi, esi
mov ecx, ebx
call fcn.004049f8
mov eax, esi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401200
mov esp, ebp
pop ebp
ret 4
cmp byte [esi + 1], 0xa
jne 0x407728
mov eax, dword [ebp - 0x224]
mov edi, esi
sub edi, 0x427800
mov byte [esi + 2], 0
push 0
add edi, 2
push 0
add eax, edi
push eax
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
jmp 0x407744
mov esi, ebx
add ebx, 2
mov dword [ebp - 0x224], ebx
cmp word [esi], 0xa
je 0x407ac8
cmp esi, 0x435800
je 0x407ac8
sub esi, 2
cmp word [esi], 0xa
jne 0x407ab7
cmp word [esi], 0x3a
je 0x407ad1
add esi, 2
mov edi, esi
test esi, esi
je 0x407b0f
movzx ebx, word [edi]
push ebx
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
je 0x407af2
cmp ebx, 0xa
je 0x407af2
add edi, 2
jmp 0x407ad7
push ebx
push 0x402200
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x41d5c8
mov ebx, dword [ebp - 0x224]
cmp word [edi], 0x3a
je 0x407b4d
test ebx, ebx
je 0x407b2f
push 0x3a
push ebx
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x407aa6
mov ebx, dword [ebp - 0x210]
cmp byte [0x426002], 1
je 0x407824
mov edi, dword [ebp - 0x220]
jmp 0x407648
test esi, esi
je 0x416846
push 0xa
push esi
call dword [sym.imp.msvcrt.dll_wcschr]
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x416819
push 0
push ecx
lea edx, [ebp - 0x20c]
mov ecx, edi
call fcn.0040747b
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x407b15
mov eax, dword [ebp - 0x230]
test byte [eax + 0x40], 1
je 0x41d63c
mov byte [0x426002], 1
call fcn.00407be4
test ebx, ebx
je 0x41d648
sub ebx, 0x435800
add ebx, 2
sar ebx, 1
test al, al
jne 0x41d65c
mov ecx, dword [ebp - 0x218]
add dword [ecx + 8], ebx
jmp 0x407b2f
xor eax, eax
jmp 0x407784
call fcn.004234e5
jmp 0x407655
mov edi, dword [ebp - 0x214]
jmp 0x409391
xor eax, eax
jmp 0x407784
test edi, edi
jne 0x41d69a
cmp dword [ebp - 0x220], 0
je 0x41d69a
mov ebx, dword [ebp - 0x210]
push 0
push 0
push 0
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
xor edi, edi
mov dword [ebp - 0x220], edi
jmp 0x407648
push eax
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
jne 0x40780e
jmp 0x407648
push 1
push 0
push 0
push dword [ebp - 0x210]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
cmp eax, dword [ebp - 0x228]
jne 0x41d5d6
jmp 0x407b6b
xor ebx, ebx
jmp 0x416819
call fcn.0041c651
int3
mov ecx, ebx
call fcn.00407403
mov eax, dword [ebx + 0x110]
push 0
push 0x2330
mov dword [0x426054], eax
call fcn.0040bd02
add esp, 8
mov eax, edi
jmp 0x40782f
lea eax, [ebp - 0x214]
mov edx, 0x435800
push eax
push 0x200
mov ecx, ebx
call fcn.0041f5d8
mov edi, dword [ebp - 0x214]
jmp 0x40778a
cmp byte [esi + 1], 0xd
jne 0x407720
jmp 0x407a7e
cmp ecx, 1
je 0x41d503
sub ecx, 2
add esi, 2
jmp 0x40773a
push 0x4261a4
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x21c]
inc esi
push eax
push 1
push esi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_ReadFile]
push 0x4261a4
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
test esi, esi
je 0x41d542
cmp dword [ebp - 0x21c], 0
je 0x41d542
inc edi
jmp 0x407744
xor edi, edi
xor eax, eax
jmp 0x40777e
cmp ecx, 0xc435
ja 0x41d58c
je 0x41d5c1
cmp ecx, 0xc431
ja 0x41d57e
je 0x41d5c1
cmp ecx, 0x2a
je 0x41d5c1
cmp ecx, 0xc42b
jbe 0x40775f
cmp ecx, 0xc42e
ja 0x40775f
jmp 0x41d5c1
cmp ecx, 0xc433
jne 0x40775f
jmp 0x41d5c1
cmp ecx, 0xdeb3
ja 0x41d5b2
cmp ecx, 0xdeaa
jae 0x41d5c1
cmp ecx, 0xcec8
je 0x41d5c1
cmp ecx, 0xd698
jne 0x40775f
jmp 0x41d5c1
lea eax, [ecx - 0xfde8]
cmp eax, 1
ja 0x40775f
xor eax, eax
jmp 0x407764
test bx, bx
jne 0x407aed
jmp 0x407b09
mov ecx, dword [ebp - 0x214]
cmp ecx, 0x200
je 0x407b6b
sub esi, 0x435800
sar esi, 1
sub ecx, esi
call fcn.00407be4
test al, al
je 0x41d619
push 0
push 0
push 0
push 0
push ecx
push 0x435800
push 0
push dword [0x426120]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov ecx, eax
mov ebx, dword [ebp - 0x210]
neg ecx
push 1
push 0
push ecx
push ebx
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
jmp 0x407b35
mov byte [0x426002], 0
jmp 0x407bb1
test al, al
je 0x41d686
push 0
push 0
push 0
push 0
push dword [ebp - 0x214]
jmp 0x41d665
push 0
push 0
push 0
push 0
push ebx
push 0x435800
push 0
push dword [0x426120]
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
mov ecx, dword [ebp - 0x218]
add dword [ecx + 8], eax
jmp 0x407b2f
mov ecx, dword [ebp - 0x218]
mov eax, dword [ebp - 0x214]
add dword [ecx + 8], eax
jmp 0x407b2f
mov ecx, esi
call fcn.00407403
mov eax, dword [esi + 0x110]
mov dword [0x426054], eax
lea eax, [ebp - 0x10c]
push eax
push 1
push 0x400023ab
call fcn.0040bd02
mov ebx, dword [ebp - 0x210]
add esp, 0xc
mov esi, 1
jmp 0x407826