Function at 0x40ee90
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push dword [0x433868]
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_EnterCriticalSection]
push dword [0x433868]
mov dword [0x42d54c], 0
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_LeaveCriticalSection]
mov eax, dword [0x43b8b4]
mov ecx, dword [0x43b8bc]
mov ax, word [eax - 2]
mov word [0x4338a0], ax
mov eax, ecx
and eax, 3
cmp eax, 3
jne 0x40f1af
cmp eax, 2
je 0x41d470
cmp dword [0x43b8b8], 0
je 0x41d470
push dword [0x433868]
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_EnterCriticalSection]
push dword [0x433868]
mov dword [0x42d54c], 0
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_LeaveCriticalSection]
mov eax, dword [0x43b8b8]
test eax, eax
je 0x41d4a0
push eax
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov ebx, eax
mov dword [ebp - 0x10], ebx
mov edi, 0x42d630
push 1
push 0
push 0
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
push 0x447f30
mov dword [ebp - 0x14], eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 4]
push eax
push 0x1fff
push edi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_ReadFile]
push 0x447f30
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
mov ebx, dword [ebp - 4]
test esi, esi
je 0x41d60e
test ebx, ebx
je 0x40f20e
mov ecx, ebx
mov dword [ebp - 0xc], ecx
test ebx, ebx
jle 0x40efec
cmp ecx, 3
jl 0x40efa3
mov al, byte [edi]
cmp al, 0xa
je 0x41d615
cmp al, 0xd
je 0x40efc4
movzx eax, byte [edi]
cmp byte [eax + 0x447f40], 0
jne 0x41d624
dec ecx
mov eax, 1
add edi, eax
mov dword [ebp - 0xc], ecx
test ecx, ecx
jg 0x40ef90
jmp 0x40efec
cmp byte [edi + 1], 0xa
jne 0x40efa3
mov eax, dword [ebp - 0x14]
mov ebx, edi
sub ebx, 0x42d630
mov byte [edi + 2], 0
push 0
add ebx, 2
push 0
add eax, ebx
push eax
push dword [ebp - 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_SetFilePointer]
mov ecx, dword [0x433864]
call fcn.0040f9a9
test eax, eax
je 0x41d67c
mov eax, 1
push 0x1fff
push 0x4378b0
push ebx
push 0x42d630
push eax
push ecx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov ebx, eax
mov dword [ebp - 4], ebx
cmp dword [0x42d54c], 0
jne 0x41d683
test eax, eax
je 0x40f215
test ebx, ebx
jle 0x40f215
mov dword [ebp - 8], 0
mov eax, dword [0x43b8b8]
test ebx, ebx
je 0x40f22d
cmp dword [0x448478], 0
jne 0x40f067
test ebx, ebx
je 0x40f067
test eax, eax
je 0x41d6cf
cmp ebx, 0x7ffffffe
ja 0x41d6de
mov eax, 0x4338a2
mov esi, 0x4378b0
mov edx, 0x2002
sub esi, eax
lea ecx, [edx - 0x2002]
add ecx, ebx
je 0x40f0a7
movzx ecx, word [esi + eax]
test cx, cx
je 0x40f0a7
mov word [eax], cx
add eax, 2
sub edx, 1
jne 0x40f084
jmp 0x41d6ec
test edx, edx
je 0x41d6ec
xor ecx, ecx
mov word [eax], cx
mov cx, word [0x4338a2]
mov ebx, 0x4338a2
lea edx, [ebx + 2]
mov ax, word [ebx]
add ebx, 2
test ax, ax
jne 0x40f0c3
sub ebx, edx
mov word [ebp - 0xc], cx
sar ebx, 1
xor edi, edi
mov dword [ebp - 4], ebx
mov eax, ebx
mov dword [ebp - 0x14], eax
mov esi, 0x4338a2
test cx, cx
je 0x40f118
mov eax, dword [ebp - 0xc]
lea ecx, [ecx]
push eax
push 0x4022ac
lea esi, [esi + 2]
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x40f112
movzx eax, word [esi]
inc edi
mov dword [ebp - 0xc], eax
test ax, ax
jne 0x40f0f0
mov ebx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], edi
cmp edi, eax
jae 0x40f1f9
movzx ecx, word [edi*2 + 0x4338a2]
lea eax, [edi*2 + 0x4338a2]
cmp ecx, 0x1a
je 0x41d77b
cmp ecx, 0xa
jne 0x40f23a
sub ebx, edi
mov dword [ebp - 8], 1
add eax, 2
dec ebx
xor ecx, ecx
mov word [eax], cx
mov ecx, dword [0x43b8b8]
call fcn.0040f521
test eax, eax
jne 0x40f18f
push dword [ebp - 8]
neg ebx
push eax
push ebx
push dword [0x43b8b8]
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 dword [0x43b8b8], 0
je 0x41d788
mov dword [0x43b8b4], 0x4338a2
call fcn.0040f250
mov eax, dword [0x43b8b4]
pop edi
pop esi
mov dword [0x43b8b0], eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, eax
sub edx, 1
jne 0x41d462
mov esi, dword [0x43b8b8]
xor eax, eax
push esi
mov edx, 0x2002
mov word [0x4378a2], ax
mov ecx, 0x4338a2
call fcn.00410820
mov ecx, 0x4338a2
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f1e0
sub ecx, edx
sar ecx, 1
lea eax, [esi + ecx*2]
mov dword [0x43b8b8], eax
jmp 0x40f18f
test ebx, ebx
je 0x40f123
cmp edi, 0x2000
jb 0x40f18f
jmp 0x41d6f4
xor eax, eax
jmp 0x40f021
mov dword [ebp - 4], 0
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov dword [ebp - 8], eax
mov ebx, dword [ebp - 4]
jmp 0x40f045
test eax, eax
jne 0x40f052
jmp 0x41d695
xor ebx, ebx
mov dword [ebp - 8], 2
jmp 0x40f151
sub edx, 1
je 0x40eee0
jmp 0x40f18f
test ecx, 0x8000
je 0x41d48c
push 0
push 0x2352
call fcn.00415469
add esp, 8
jmp 0x40eef6
call fcn.0041631f
or dword [0x43b8bc], 0x8000
jmp 0x40eef6
xor ecx, ecx
call fcn.00429713
test eax, eax
jne 0x41d5a2
xor ecx, ecx
call fcn.0040f521
test eax, eax
je 0x41d4c7
test byte [0x443ab0], 1
je 0x41d5a2
mov eax, dword [0x43b8b8]
test eax, eax
jne 0x40ef25
xor ecx, ecx
call fcn.0040f521
test eax, eax
je 0x41d598
test byte [0x443ab0], 1
je 0x41d598
cmp dword [0x44852c], 0
je 0x41d508
lea eax, [ebp - 4]
push eax
push ecx
call fcn.00427433
jmp 0x40f222
push dword [0x433868]
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_EnterCriticalSection]
push dword [0x433868]
mov dword [0x42d54c], 0
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_LeaveCriticalSection]
lea eax, [ebp - 4]
push eax
push 0x2000
push dword [0x43b8b8]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov edx, 0x4378b0
mov ecx, eax
call fcn.00423948
test eax, eax
je 0x40f215
mov ebx, dword [ebp - 4]
test ebx, ebx
jne 0x40f03e
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
push 0x40204c
cmp eax, 0x3e3
jne 0x41d588
call fcn.0040c37c
add esp, 4
push 0xffffffffffffffff
push 0x43b908
call dword [sym.imp.msvcrt.dll_longjmp]
call fcn.0040c37c
mov ebx, dword [ebp - 4]
add esp, 4
jmp 0x40f03e
mov eax, dword [0x43b8b8]
jmp 0x40ef25
xor ebx, ebx
mov dword [ebp - 4], ebx
lea eax, [ebp - 8]
push eax
push 1
push dword [0x43b8b8]
lea esi, [ebx*2 + 0x4378b0]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov edx, esi
mov ecx, eax
call fcn.00423db0
test eax, eax
jne 0x41d5e1
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
cmp eax, 0xea
jne 0x40f225
cmp dword [ebp - 8], 0
je 0x40f225
mov ebx, dword [ebp - 4]
inc ebx
mov dword [ebp - 4], ebx
cmp word [ebx*2 + 0x4378ae], 0xa
je 0x40f045
cmp ebx, 0x2000
jb 0x41d5a7
jmp 0x40f045
xor eax, eax
jmp 0x40f021
cmp byte [edi + 1], 0xd
je 0x40efca
jmp 0x40ef9f
cmp ecx, 1
je 0x41d636
sub ecx, 2
mov eax, 2
jmp 0x40efb9
push 0x447f30
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0xc]
push eax
push 1
lea eax, [edi + 1]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_ReadFile]
push 0x447f30
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_ReleaseSRWLockShared]
test esi, esi
je 0x41d673
cmp dword [ebp - 0xc], 0
je 0x41d673
inc ebx
jmp 0x40efec
xor ebx, ebx
xor eax, eax
jmp 0x40f01e
xor eax, eax
jmp 0x40f004
call fcn.00427333
push 0xffffffffffffffff
push 0x43b908
call dword [sym.imp.msvcrt.dll_longjmp]
xor ecx, ecx
call fcn.0040f521
test eax, eax
je 0x41d6bd
cmp dword [0x448478], 0
je 0x41d6bd
mov ebx, dword [ebp - 4]
mov eax, 0xa
mov word [0x4378b0], ax
inc ebx
jmp 0x40f067
call fcn.0042904e
push 2
push 0x43b8c8
call dword [sym.imp.msvcrt.dll_longjmp]
mov dword [0x448478], 1
jmp 0x40f067
xor ecx, ecx
mov word [0x4338a2], cx
jmp 0x40f0bb
sub eax, 2
jmp 0x40f0af
cmp dword [0x43f990], 3
jne 0x41d746
cmp dword [0x42d0c8], 1
jne 0x41d725
call fcn.0041631f
push 0x4338a2
call fcn.0040c37c
add esp, 4
push 0x40204c
call fcn.0040c37c
add esp, 4
push 0
push 0x233f
call fcn.00414802
add esp, 8
call fcn.0042904e
push 1
push 0x43b8c8
call dword [sym.imp.msvcrt.dll_longjmp]
push 0
push 0x233f
call fcn.00414802
add esp, 8
cmp dword [0x43b8b8], 0
jne 0x41d76e
xor ecx, ecx
call fcn.0040f521
test eax, eax
je 0x41d76e
call fcn.00429817
push 0xffffffffffffffff
push 0x43b908
call dword [sym.imp.msvcrt.dll_longjmp]
mov ecx, 0xa
mov word [eax], cx
jmp 0x40f144
cmp dword [0x448530], 0
jne 0x40f18f
mov edx, 0x4338a2
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x41d79d
sub edx, ecx
mov ecx, 0x4338a2
sar edx, 1
call fcn.0040c3b9
jmp 0x40f18f