Function at 0x40fa30
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
push dword [0x433858]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x433858]
mov dword [0x42d544], 0
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, dword [0x43b8a4]
mov ecx, dword [0x43b8ac]
mov ax, word [eax - 2]
mov word [0x433890], ax
mov eax, ecx
and eax, 3
cmp eax, 3
jne 0x40fd6d
cmp eax, 2
je 0x41c5a9
cmp dword [0x43b8a8], 0
je 0x41c5a9
push dword [0x433858]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x433858]
mov dword [0x42d544], 0
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, dword [0x43b8a8]
test eax, eax
je 0x41c5d9
push eax
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov ebx, eax
mov dword [ebp - 0x18], ebx
mov edi, 0x42d620
push 1
push 0
push 0
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
push 0x447f20
mov dword [ebp - 0x14], eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_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_1_0.dll_ReadFile]
push 0x447f20
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
test esi, esi
je 0x41c750
test ecx, ecx
je 0x40fdce
cmp dword [0x433854], 0xfde9
mov esi, ecx
mov edx, dword [ebp - 0x14]
mov ebx, ecx
mov dword [ebp - 0x10], esi
je 0x41c757
mov ecx, edi
mov dword [ebp - 0x14], ecx
test ebx, ebx
jle 0x40fb82
lea ecx, [ecx]
cmp esi, 3
jl 0x40fb63
mov al, byte [edi]
cmp al, 0xa
je 0x41c79c
cmp al, 0xd
je 0x40fb87
movzx eax, byte [edi]
cmp byte [eax + 0x447f30], 0
jne 0x41c7ab
dec esi
mov eax, 1
add edi, eax
mov dword [ebp - 0x10], esi
test esi, esi
jg 0x40fb50
mov ebx, dword [ebp - 8]
jmp 0x40fba9
cmp byte [edi + 1], 0xa
jne 0x40fb63
mov ebx, edi
mov byte [edi + 2], 0
sub ebx, ecx
add ebx, 2
push 0
push 0
lea eax, [ebx + edx]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov ecx, dword [0x433854]
call fcn.00410638
test eax, eax
je 0x41c806
mov eax, 1
push 0x1fff
push 0x4378a0
push ebx
push dword [ebp - 0x14]
push eax
push ecx
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_MultiByteToWideChar]
mov ecx, eax
mov dword [ebp - 4], ecx
mov dword [ebp - 8], ecx
cmp dword [0x42d544], 0
jne 0x41c80d
test eax, eax
je 0x40fdd5
test ecx, ecx
jle 0x40fdd5
mov dword [ebp - 0xc], 0
mov eax, dword [0x43b8a8]
test ecx, ecx
je 0x40fdf0
cmp dword [0x448060], 0
jne 0x40fc25
test ecx, ecx
je 0x40fc25
test eax, eax
je 0x41c85c
cmp ecx, 0x7ffffffe
ja 0x41c86b
mov eax, 0x433892
mov esi, 0x4378a0
mov edx, 0x2002
sub esi, eax
add ecx, 0xffffdffe
add ecx, edx
je 0x40fc68
movzx ecx, word [esi + eax]
test cx, cx
je 0x40fc68
mov word [eax], cx
add eax, 2
mov ecx, dword [ebp - 8]
sub edx, 1
jne 0x40fc42
jmp 0x41c879
test edx, edx
je 0x41c879
xor ecx, ecx
mov word [eax], cx
mov dx, word [0x433892]
mov ecx, 0x433892
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fc84
sub ecx, esi
mov word [ebp - 0x14], dx
sar ecx, 1
xor edi, edi
mov dword [ebp - 4], ecx
mov ebx, ecx
mov esi, 0x433892
test dx, dx
je 0x40fcd5
mov eax, dword [ebp - 0x14]
jmp 0x40fcb0
push eax
push 0x402108
lea esi, [esi + 2]
call dword [sym.imp.msvcrt.dll_wcschr]
add esp, 8
test eax, eax
jne 0x40fcd2
movzx eax, word [esi]
inc edi
mov dword [ebp - 0x14], eax
test ax, ax
jne 0x40fcb0
mov ecx, dword [ebp - 4]
mov dword [ebp - 0xc], edi
cmp edi, ebx
jae 0x40fdb9
movzx eax, word [edi*2 + 0x433892]
lea edx, [edi*2 + 0x433892]
mov esi, eax
cmp eax, 0x1a
je 0x41c908
cmp esi, 0xa
jne 0x40fdfd
sub edi, ecx
add edx, 2
mov eax, 1
inc edi
mov ecx, dword [0x43b8a8]
mov dword [ebp - 0xc], eax
xor eax, eax
mov word [edx], ax
call fcn.00410178
test eax, eax
jne 0x40fd4d
push dword [ebp - 0xc]
push eax
push edi
push dword [0x43b8a8]
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 [0x43b8a8], 0
je 0x41c915
mov dword [0x43b8a4], 0x433892
call fcn.0040fe10
mov eax, dword [0x43b8a4]
pop edi
pop esi
mov dword [0x43b8a0], eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, eax
sub edx, 1
jne 0x41c59b
mov esi, dword [0x43b8a8]
xor eax, eax
push esi
mov edx, 0x2002
mov word [0x437892], ax
mov ecx, 0x433892
call fcn.00411040
mov ecx, 0x433892
lea edx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fda0
sub ecx, edx
sar ecx, 1
lea eax, [esi + ecx*2]
mov dword [0x43b8a8], eax
jmp 0x40fd4d
test ecx, ecx
je 0x40fce0
cmp edi, 0x2000
jb 0x40fd4d
jmp 0x41c881
xor eax, eax
jmp 0x40fbdf
mov dword [ebp - 4], 0
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], eax
jmp 0x40fc03
test eax, eax
jne 0x40fc10
jmp 0x41c81f
mov eax, 2
xor edi, edi
jmp 0x40fd0e
sub edx, 1
je 0x40fa80
jmp 0x40fd4d
test ecx, 0x8000
je 0x41c5c5
push 0
push 0x2352
call fcn.0040c108
add esp, 8
jmp 0x40fa96
call fcn.00426ff0
or dword [0x43b8ac], 0x8000
jmp 0x40fa96
xor ecx, ecx
call fcn.00429953
test eax, eax
jne 0x41c6da
xor ecx, ecx
call fcn.00410178
test eax, eax
je 0x41c600
test byte [0x443aa0], 1
je 0x41c6da
mov eax, dword [0x43b8a8]
test eax, eax
jne 0x40fac5
xor ecx, ecx
call fcn.00410178
test eax, eax
je 0x41c6d0
test byte [0x443aa0], 1
je 0x41c6d0
cmp dword [0x44852c], 0
je 0x41c641
lea eax, [ebp - 4]
push eax
push ecx
call fcn.00426f63
jmp 0x40fde2
push dword [0x433858]
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
push dword [0x433858]
mov dword [0x42d544], 0
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
lea eax, [ebp - 4]
push eax
push 0x2000
push dword [0x43b8a8]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov edx, 0x4378a0
mov ecx, eax
call fcn.00423506
test eax, eax
je 0x40fdd5
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
test ecx, ecx
jne 0x41c6c9
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
push 0x401eb4
mov esi, eax
call fcn.004125d9
add esp, 4
cmp esi, 0x3e3
jne 0x41c6c3
push 0xffffffffffffffff
push 0x43b8f8
call dword [sym.imp.msvcrt.dll_longjmp]
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
xor eax, eax
jmp 0x40fde8
mov eax, dword [0x43b8a8]
jmp 0x40fac5
mov dword [ebp - 4], 0
xor ecx, ecx
lea eax, [ebp - 0xc]
push eax
push 1
push dword [0x43b8a8]
lea esi, [ecx*2 + 0x4378a0]
call dword [sym.imp.msvcrt.dll__get_osfhandle]
add esp, 4
mov edx, esi
mov ecx, eax
call fcn.0042396e
test eax, eax
jne 0x41c719
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0xea
jne 0x41c745
cmp dword [ebp - 0xc], 0
je 0x41c745
mov ecx, dword [ebp - 4]
inc ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], ecx
cmp word [ecx*2 + 0x43789e], 0xa
je 0x40fc03
cmp ecx, 0x2000
jb 0x41c6e3
jmp 0x40fc03
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
jmp 0x40fc03
xor eax, eax
jmp 0x40fbdf
test edx, edx
jne 0x40fb44
push 3
push 0x403270
push 0x42d620
call sub.msvcrt.dll_memcmp
add esp, 0xc
mov ecx, ebx
test eax, eax
jne 0x41c794
lea ebx, [ecx - 3]
mov edi, 0x42d623
mov esi, ebx
mov dword [ebp - 8], ebx
lea edx, [eax + 3]
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], esi
jmp 0x40fb44
mov edx, dword [ebp - 0x14]
jmp 0x40fb44
cmp byte [edi + 1], 0xd
je 0x40fb8d
jmp 0x40fb63
cmp esi, 1
je 0x41c7bd
add esi, 0xfffffffe
mov eax, 2
jmp 0x40fb79
push 0x447f20
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_AcquireSRWLockShared]
push 0
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [edi + 1]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
push 0x447f20
mov esi, eax
call dword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_ReleaseSRWLockShared]
test esi, esi
je 0x41c7fd
cmp dword [ebp - 0x10], 0
je 0x41c7fd
mov ebx, dword [ebp - 8]
inc ebx
jmp 0x40fba9
xor ecx, ecx
xor eax, eax
jmp 0x40fbd9
xor eax, eax
jmp 0x40fbc1
call fcn.00426e63
push 0xffffffffffffffff
push 0x43b8f8
call dword [sym.imp.msvcrt.dll_longjmp]
xor ecx, ecx
call fcn.00410178
test eax, eax
je 0x41c84a
cmp dword [0x448060], 0
je 0x41c84a
mov ecx, dword [ebp - 4]
mov eax, 0xa
inc ecx
mov word [0x4378a0], ax
mov dword [ebp - 8], ecx
jmp 0x40fc25
call fcn.00429287
push 2
push 0x43b8b8
call dword [sym.imp.msvcrt.dll_longjmp]
mov dword [0x448060], 1
jmp 0x40fc25
xor edx, edx
mov word [0x433892], dx
jmp 0x40fc7c
sub eax, 2
jmp 0x40fc70
cmp dword [0x43f980], 3
jne 0x41c8d3
cmp dword [0x42d0c8], 1
jne 0x41c8b2
call fcn.00426ff0
push 0x433892
call fcn.004125d9
add esp, 4
push 0x401eb4
call fcn.004125d9
add esp, 4
push 0
push 0x233f
call fcn.0040c5a2
add esp, 8
call fcn.00429287
push 1
push 0x43b8b8
call dword [sym.imp.msvcrt.dll_longjmp]
push 0
push 0x233f
call fcn.0040c5a2
add esp, 8
cmp dword [0x43b8a8], 0
jne 0x41c8fb
xor ecx, ecx
call fcn.00410178
test eax, eax
je 0x41c8fb
call fcn.00429a57
push 0xffffffffffffffff
push 0x43b8f8
call dword [sym.imp.msvcrt.dll_longjmp]
mov eax, 0xa
mov word [edx], ax
jmp 0x40fd03
cmp dword [0x448530], 0
jne 0x40fd4d
mov edx, 0x433892
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x41c92a
sub edx, ecx
mov ecx, 0x433892
sar edx, 1
call fcn.00412616
jmp 0x40fd4d