Function at 0x40cbf0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x78
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x417360
mov edx, dword [ebp + 0xc]
lea eax, [ebp - 0x18]
mov ecx, dword fs:[0]
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
mov eax, dword [edx + 8]
cmp dword [edx + 4], 0
mov dword [edx + 4], 0
je 0x40cc36
push eax
call sub.KERNEL32.dll_CloseHandle
mov eax, dword [0x424dac]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x58], eax
mov eax, dword [edx + 0x10]
mov ecx, dword [edx + 0xc]
mov dword [edx + 0xc], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x50], 0
mov esi, dword [edx + 0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [edx + 0x14]
cmp ecx, 1
mov dword [edx + 0x14], 0
mov dword [ebp - 0x24], esi
jne 0x40cebb
test eax, eax
je 0x40cfd4
push 0
push 1
push 1
push 0
call sub.KERNEL32.dll_CreateEventW
test eax, eax
je 0x40d3b8
mov esi, eax
push 4
push 0x14
call fcn.004036e0
add esp, 8
test eax, eax
je 0x40d3aa
mov ecx, dword [ebp - 0x20]
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x10], esi
mov dword [ebp - 0x78], esi
mov dword [ebp - 0x7c], ecx
mov dword [ebp - 0x74], eax
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], 0
push 0
push 1
push 1
push 0
call sub.KERNEL32.dll_CreateEventW
test eax, eax
je 0x40d0e9
mov edi, eax
push 4
push 0x14
call fcn.004036e0
add esp, 8
test eax, eax
je 0x40d3aa
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x84], esi
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x10], edi
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x80], edi
mov dword [ebp - 0x40], ecx
lea ecx, [ebp - 0x58]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], 0
nop
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x84]
push eax
push 2
call sub.KERNEL32.dll_WaitForMultipleObjects
cmp eax, 1
je 0x40cdc0
test eax, eax
jne 0x40d137
mov eax, dword [ebp - 0x6c]
test eax, eax
je 0x40ce5c
cmp eax, 1
jne 0x40ce3d
mov eax, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x64], 0
push 1
lea edx, [ebp - 0x64]
push edx
push ecx
push eax
call sub.KERNEL32.dll_GetOverlappedResult
test eax, eax
je 0x40cea5
mov esi, dword [ebp - 0x64]
jmp 0x40ce40
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x40ce12
cmp eax, 1
jne 0x40cdf3
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x64], 0
push 1
lea edx, [ebp - 0x64]
push edx
push ecx
push eax
call sub.KERNEL32.dll_GetOverlappedResult
test eax, eax
je 0x40ce87
mov esi, dword [ebp - 0x64]
jmp 0x40cdf6
mov esi, dword [ebp - 0x2c]
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x34]
add dword [eax + 8], esi
test esi, esi
mov dword [ebp - 0x10], 3
je 0x40d11d
lea ecx, [ebp - 0x64]
lea edx, [ebp - 0x40]
mov dword [ebp - 0x10], 3
call fcn.004124f0
cmp byte [ebp - 0x64], 1
je 0x40d10f
test byte [ebp - 0x63], 1
jne 0x40cd60
jmp 0x40d11d
mov esi, dword [ebp - 0x68]
mov dword [ebp - 0x6c], 0
mov eax, dword [ebp - 0x70]
add dword [eax + 8], esi
test esi, esi
mov dword [ebp - 0x10], 3
je 0x40d127
lea ecx, [ebp - 0x64]
lea edx, [ebp - 0x7c]
mov dword [ebp - 0x10], 3
call fcn.004124f0
cmp byte [ebp - 0x64], 1
je 0x40d10f
test byte [ebp - 0x63], 1
jne 0x40cd60
jmp 0x40d127
xor esi, esi
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x6d
je 0x40cdf6
cmp eax, 0x26
je 0x40cdf6
jmp 0x40d13c
xor esi, esi
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x6d
je 0x40ce40
cmp eax, 0x26
je 0x40ce40
jmp 0x40d13c
test eax, eax
je 0x40d1cf
lea eax, [ebp - 0x58]
xor edx, edx
xor ebx, ebx
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], 0
nop word cs:[eax + eax]
nop
cmp ebx, edx
jne 0x40cf20
mov eax, dword [ebp - 0x54]
mov ecx, eax
sub ecx, edx
cmp ecx, 0x1f
ja 0x40cf13
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x10], 0xb
lea ecx, [ebp - 0x58]
mov dword [ebp - 0x28], edx
push 0x20
call fcn.004229e0
add esp, 4
mov eax, dword [ebp - 0x54]
mov ebx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x28]
cmp eax, edx
mov dword [ebp - 0x50], eax
jb 0x40d2e5
mov edx, eax
mov edi, edx
sub edi, ebx
jb 0x40d28f
mov eax, dword [ebp - 0x58]
mov esi, ebx
mov dword [ebp - 0x7c], 0
add eax, ebx
push 0
lea ecx, [ebp - 0x7c]
push ecx
push edi
push eax
push dword [ebp - 0x24]
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x40cf70
mov edx, dword [ebp - 0x7c]
mov ecx, edx
mov ebx, edx
and ecx, 0xffffff00
and ebx, 0xffff0000
jmp 0x40cf91
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x20], eax
push eax
call fcn.00415b80
add esp, 4
xor ebx, ebx
cmp al, 8
mov ecx, 0
mov edx, 0
jne 0x40cfb7
and ecx, 0xff00
movzx eax, dl
or ecx, ebx
or eax, ecx
je 0x40cfc9
cmp eax, edi
ja 0x40d2aa
mov edx, dword [ebp - 0x50]
mov ebx, esi
add ebx, eax
mov dword [ebp - 0x3c], ebx
jmp 0x40cee0
cmp al, 0xf
jne 0x40d33b
mov edx, dword [ebp - 0x50]
mov ebx, esi
jmp 0x40cee0
mov dword [ebp - 0x50], esi
push dword [ebp - 0x24]
jmp 0x40d0df
lea eax, [ebp - 0x4c]
xor edx, edx
xor ebx, ebx
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], 0
nop word cs:[eax + eax]
nop
cmp ebx, edx
jne 0x40d030
mov eax, dword [ebp - 0x48]
mov ecx, eax
sub ecx, edx
cmp ecx, 0x1f
ja 0x40d023
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x10], 8
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x28], edx
push 0x20
call fcn.004229e0
add esp, 4
mov eax, dword [ebp - 0x48]
mov ebx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x28]
cmp eax, edx
mov dword [ebp - 0x44], eax
jb 0x40d320
mov edx, eax
mov edi, edx
sub edi, ebx
jb 0x40d2ca
mov eax, dword [ebp - 0x4c]
mov esi, ebx
mov dword [ebp - 0x7c], 0
add eax, ebx
push 0
lea ecx, [ebp - 0x7c]
push ecx
push edi
push eax
push dword [ebp - 0x20]
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x40d080
mov edx, dword [ebp - 0x7c]
mov ecx, edx
mov ebx, edx
and ecx, 0xffffff00
and ebx, 0xffff0000
jmp 0x40d0a1
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x24], eax
push eax
call fcn.00415b80
add esp, 4
xor ebx, ebx
cmp al, 8
mov ecx, 0
mov edx, 0
jne 0x40d0c7
and ecx, 0xff00
movzx eax, dl
or ecx, ebx
or eax, ecx
je 0x40d0d9
cmp eax, edi
ja 0x40d300
mov edx, dword [ebp - 0x44]
mov ebx, esi
add ebx, eax
mov dword [ebp - 0x3c], ebx
jmp 0x40cff0
cmp al, 0xf
jne 0x40d374
mov edx, dword [ebp - 0x44]
mov ebx, esi
jmp 0x40cff0
mov dword [ebp - 0x44], esi
push dword [ebp - 0x20]
call sub.KERNEL32.dll_CloseHandle
jmp 0x40d1cf
call sub.KERNEL32.dll_GetLastError
mov esi, eax
push dword [ebp - 0x24]
call sub.KERNEL32.dll_CloseHandle
mov eax, esi
shl esi, 0x18
mov dword [ebp - 0x24], 0
shr eax, 8
mov dword [ebp - 0x28], esi
jmp 0x40d18f
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], ecx
jmp 0x40d14d
lea ecx, [ebp - 0x7c]
call fcn.004125e0
jmp 0x40d12f
lea ecx, [ebp - 0x40]
call fcn.004125e0
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], edx
jmp 0x40d14d
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x10], 4
lea eax, [ebp - 0x40]
mov dword [ebp - 0x10], 4
push eax
call fcn.00412690
add esp, 4
push dword [ebp - 0x40]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x3c]
call sub.KERNEL32.dll_CloseHandle
push 4
push 0x14
push dword [ebp - 0x38]
call fcn.004036f0
add esp, 0xc
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
shrd ecx, eax, 8
shr eax, 8
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x7c]
mov dword [ebp - 0x10], 5
push eax
call fcn.00412690
add esp, 4
push dword [ebp - 0x7c]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x78]
call sub.KERNEL32.dll_CloseHandle
push 4
push 0x14
push dword [ebp - 0x74]
call fcn.004036f0
add esp, 0xc
mov eax, dword [ebp - 0x24]
cmp al, 4
jne 0x40d3df
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov dword [eax + 4], 0
mov edi, dword [eax]
push 0xffffffffffffffff
push edi
call sub.KERNEL32.dll_WaitForSingleObject
test eax, eax
je 0x40d235
call sub.KERNEL32.dll_GetLastError
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x58]
mov dword [esi + 4], 0
mov dword [esi], 1
test eax, eax
je 0x40d219
mov ecx, dword [ebp - 0x54]
test ecx, ecx
je 0x40d219
push 1
push ecx
push eax
call fcn.004036f0
add esp, 0xc
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x40d276
mov ecx, dword [ebp - 0x48]
test ecx, ecx
je 0x40d276
push 1
push ecx
push eax
call fcn.004036f0
add esp, 0xc
jmp 0x40d276
lea eax, [ebp - 0x40]
mov dword [ebp - 0x40], 0
push eax
push edi
call sub.KERNEL32.dll_GetExitCodeProcess
test eax, eax
je 0x40d1ea
movsd xmm0, qword [ebp - 0x4c]
mov ecx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x50]
movsd qword [esi + 8], xmm0
movsd xmm0, qword [ebp - 0x58]
mov dword [esi + 0x10], ecx
mov dword [esi + 0x1c], edx
movsd qword [esi + 0x14], xmm0
mov dword [esi + 4], eax
mov dword [esi], 0
push edi
call sub.KERNEL32.dll_CloseHandle
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
mov eax, esi
add esp, 0x78
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x10], 0xb
push 0x42542c
push edx
push ebx
call fcn.00423070
add esp, 0xc
jmp 0x40d419
mov dword [ebp - 0x10], 0xb
push 0x42545c
push 0x20
push str.assertion_failed:_n___buf.len__
call fcn.00422f10
add esp, 0xc
jmp 0x40d419
mov dword [ebp - 0x10], 8
push 0x42542c
push edx
push ebx
call fcn.00423070
add esp, 0xc
jmp 0x40d419
mov dword [ebp - 0x10], 0xb
push 0x42541c
push eax
push edx
call fcn.00423070
add esp, 0xc
jmp 0x40d419
mov dword [ebp - 0x10], 8
push 0x42545c
push 0x20
push str.assertion_failed:_n___buf.len__
call fcn.00422f10
add esp, 0xc
jmp 0x40d419
mov dword [ebp - 0x10], 8
push 0x42541c
push eax
push edx
call fcn.00423070
add esp, 0xc
jmp 0x40d419
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x10], 0xa
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x40]
push 0x42560c
push 0x4248f4
push eax
push 0x2b
push str.called__Result::unwrap____on_an__Err__value
call fcn.00422ff0
add esp, 0x14
jmp 0x40d419
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x10], 7
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x40]
push 0x4255fc
push 0x4248f4
push eax
push 0x2b
push str.called__Result::unwrap____on_an__Err__value
call fcn.00422ff0
add esp, 0x14
jmp 0x40d419
push 4
push 0x14
call fcn.00422e00
add esp, 8
ud2
call sub.KERNEL32.dll_GetLastError
mov esi, eax
push dword [ebp - 0x20]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x24]
call sub.KERNEL32.dll_CloseHandle
mov eax, esi
shl esi, 0x18
shr eax, 8
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x20], eax
xor eax, eax
mov byte [ebp - 0x40], al
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x3f], eax
mov eax, dword [ebp - 0x20]
mov word [ebp - 0x3b], ax
shr eax, 0x10
mov byte [ebp - 0x39], al
lea eax, [ebp - 0x40]
push 0x4255ec
push 0x4248f4
push eax
push 0x2b
push str.called__Result::unwrap____on_an__Err__value
call fcn.00422ff0
add esp, 0x14
ud2