Function at 0x5ec460
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x80
mov eax, dword [edx + 8]
cmp dword [edx + 4], 0
mov dword [esp + 0x70], ecx
mov dword [edx + 4], 0
je 0x5ec48d
push eax
mov esi, edx
call sub.KERNEL32.dll_CloseHandle
mov edx, esi
mov eax, dword [0x6dd4e0]
mov ecx, dword [edx + 0xc]
mov dword [esp + 4], eax
mov dword [esp + 0x10], eax
mov eax, dword [edx + 0x10]
mov dword [edx + 0xc], 0
cmp ecx, 1
mov dword [esp + 8], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], 0
mov dword [esp + 0x18], 0
mov ebx, dword [edx + 0x18]
mov dword [esp + 0x1c], eax
mov eax, dword [edx + 0x14]
mov dword [edx + 0x14], 0
jne 0x5ec518
test eax, eax
mov dword [esp + 0x50], edx
je 0x5ec736
push 0
push 1
push 1
push 0
call sub.KERNEL32.dll_CreateEventW
test eax, eax
je 0x5ecd8b
mov esi, eax
mov eax, dword [0x6f1130]
mov edi, ebx
test eax, eax
je 0x5ec942
mov ebx, dword [esp + 0x1c]
jmp 0x5ec958
test eax, eax
je 0x5ecbf6
mov dword [esp + 0x50], edx
xor edx, edx
xor esi, esi
mov dword [esp + 0x54], ebx
jmp 0x5ec534
mov edx, dword [esp + 0x14]
cmp esi, edx
jne 0x5ec549
mov eax, dword [esp + 0x18]
mov ecx, edx
sub ecx, eax
cmp ecx, 0x1f
jbe 0x5ec6e9
mov eax, dword [esp + 0x18]
cmp eax, edx
jae 0x5ec55f
cmp edx, esi
mov dword [esp + 0x18], edx
jb 0x5ecd53
mov eax, edx
mov edi, eax
sub edi, esi
jb 0x5eccf9
mov eax, dword [esp + 0x10]
mov dword [esp], esi
mov dword [esp + 0x20], 0
add eax, esi
push 0
lea ecx, [esp + 0x24]
push ecx
push edi
push eax
push ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x5ec5b0
mov ebx, dword [esp + 0x20]
mov ecx, ebx
mov edx, ebx
and ecx, 0xffffff00
and edx, 0xffff0000
jmp 0x5ec5d2
call sub.KERNEL32.dll_GetLastError
mov ecx, eax
mov esi, eax
call fcn.005dc340
xor edx, edx
cmp al, 0xb
mov ecx, 0
mov ebx, 0
jne 0x5ec6c9
and ecx, 0xff00
movzx eax, bl
or ecx, edx
or eax, ecx
je 0x5ec726
mov ebx, dword [esp + 0x54]
mov esi, dword [esp]
cmp eax, edi
ja 0x5ecd04
mov ecx, dword [esp + 0x14]
add esi, eax
or ecx, esi
jne 0x5ec530
xorps xmm0, xmm0
mov dword [esp], esi
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x20], xmm0
nop word cs:[eax + eax]
nop dword [eax]
mov dword [esp + 0x58], 0
push 0
lea eax, [esp + 0x5c]
push eax
push 0x20
lea eax, [esp + 0x2c]
push eax
push ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
jne 0x5ec660
call sub.KERNEL32.dll_GetLastError
mov ecx, eax
mov esi, eax
call fcn.005dc340
cmp al, 0xb
je 0x5ec6e1
cmp al, 0x23
je 0x5ec620
jmp 0x5eccd5
mov eax, dword [esp + 0x58]
mov ecx, eax
mov edx, eax
and ecx, 0xffffff00
and edx, 0xffff0000
and ecx, 0xff00
movzx esi, al
or esi, ecx
or esi, edx
je 0x5ecb96
cmp esi, 0x21
jae 0x5ecd64
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
sub eax, edi
cmp eax, esi
jb 0x5ec70e
mov eax, dword [esp + 0x10]
add eax, edi
push esi
lea ecx, [esp + 0x24]
push ecx
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov eax, dword [esp]
add edi, esi
mov dword [esp + 0x18], edi
mov edx, dword [esp + 0x14]
add eax, esi
mov esi, eax
jmp 0x5ec534
cmp al, 0x23
jne 0x5eccd5
mov ebx, dword [esp + 0x54]
mov esi, dword [esp]
mov edx, dword [esp + 0x14]
jmp 0x5ec534
xor eax, eax
xor ecx, ecx
xor edx, edx
jmp 0x5ec674
mov edx, eax
lea ecx, [esp + 0x10]
push 0x20
call fcn.005c1170
add esp, 4
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
cmp eax, edx
jb 0x5ec551
jmp 0x5ec55f
lea ecx, [esp + 0x10]
mov edx, edi
push esi
call fcn.005c1170
add esp, 4
mov edi, dword [esp + 0x18]
jmp 0x5ec69e
mov eax, dword [esp]
mov ebx, dword [esp + 0x54]
mov dword [esp + 0x18], eax
jmp 0x5ecbb2
mov ebx, dword [esp + 0x1c]
xor edx, edx
xor esi, esi
jmp 0x5ec744
mov edx, dword [esp + 8]
cmp esi, edx
jne 0x5ec759
mov eax, dword [esp + 0xc]
mov ecx, edx
sub ecx, eax
cmp ecx, 0x1f
jbe 0x5ec8f9
mov eax, dword [esp + 0xc]
cmp eax, edx
jae 0x5ec76f
cmp edx, esi
mov dword [esp + 0xc], edx
jb 0x5ecd53
mov eax, edx
mov edi, eax
sub edi, esi
jb 0x5eccf9
mov eax, dword [esp + 4]
mov dword [esp], esi
mov dword [esp + 0x20], 0
add eax, esi
push 0
lea ecx, [esp + 0x24]
push ecx
push edi
push eax
push ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x5ec7c0
mov ebx, dword [esp + 0x20]
mov ecx, ebx
mov edx, ebx
and ecx, 0xffffff00
and edx, 0xffff0000
jmp 0x5ec7e2
call sub.KERNEL32.dll_GetLastError
mov ecx, eax
mov esi, eax
call fcn.005dc340
xor edx, edx
cmp al, 0xb
mov ecx, 0
mov ebx, 0
jne 0x5ec8d9
and ecx, 0xff00
movzx eax, bl
or ecx, edx
or eax, ecx
je 0x5ec936
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp]
cmp eax, edi
ja 0x5ecd04
mov ecx, dword [esp + 8]
add esi, eax
or ecx, esi
jne 0x5ec740
xorps xmm0, xmm0
mov dword [esp], esi
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x20], xmm0
nop word cs:[eax + eax]
nop dword [eax]
mov dword [esp + 0x58], 0
push 0
lea eax, [esp + 0x5c]
push eax
push 0x20
lea eax, [esp + 0x2c]
push eax
push ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
jne 0x5ec870
call sub.KERNEL32.dll_GetLastError
mov ecx, eax
mov esi, eax
call fcn.005dc340
cmp al, 0xb
je 0x5ec8f1
cmp al, 0x23
je 0x5ec830
jmp 0x5ecd1d
mov eax, dword [esp + 0x58]
mov ecx, eax
mov edx, eax
and ecx, 0xffffff00
and edx, 0xffff0000
and ecx, 0xff00
movzx esi, al
or esi, ecx
or esi, edx
je 0x5ecbab
cmp esi, 0x21
jae 0x5ecd64
mov eax, dword [esp + 8]
mov edi, dword [esp + 0xc]
sub eax, edi
cmp eax, esi
jb 0x5ec91e
mov eax, dword [esp + 4]
add eax, edi
push esi
lea ecx, [esp + 0x24]
push ecx
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov eax, dword [esp]
add edi, esi
mov dword [esp + 0xc], edi
mov edx, dword [esp + 8]
add eax, esi
mov esi, eax
jmp 0x5ec744
cmp al, 0x23
jne 0x5ecd1d
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp]
mov edx, dword [esp + 8]
jmp 0x5ec744
xor eax, eax
xor ecx, ecx
xor edx, edx
jmp 0x5ec884
mov edx, eax
lea ecx, [esp + 4]
push 0x20
call fcn.005c1170
add esp, 4
mov edx, dword [esp + 8]
mov eax, dword [esp + 0xc]
cmp eax, edx
jb 0x5ec761
jmp 0x5ec76f
lea ecx, [esp + 4]
mov edx, edi
push esi
call fcn.005c1170
add esp, 4
mov edi, dword [esp + 0xc]
jmp 0x5ec8ae
mov eax, dword [esp]
mov ebx, dword [esp + 0x1c]
jmp 0x5ecbae
call sub.KERNEL32.dll_GetProcessHeap
mov ebx, dword [esp + 0x1c]
test eax, eax
je 0x5ecd7a
mov dword [0x6f1130], eax
push 0x14
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x5ecd7a
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 [esp + 0x5c], esi
mov dword [esp + 0x58], ebx
mov dword [esp + 0x60], eax
lea eax, [esp + 4]
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], 0
push 0
push 1
push 1
push 0
call sub.KERNEL32.dll_CreateEventW
test eax, eax
je 0x5ecb7a
mov ebx, eax
mov eax, dword [0x6f1130]
test eax, eax
jne 0x5ec9d6
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x5ecd7a
mov dword [0x6f1130], eax
push 0x14
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x5ecd7a
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x10], ebx
mov dword [esp + 0x74], esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x78], ebx
lea ecx, [esp + 0x10]
lea esi, [esp + 0x74]
lea ebx, [esp + 0x44]
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], 0
nop word cs:[eax + eax]
nop dword [eax]
push 0xffffffffffffffff
push 0
push esi
push 2
call sub.KERNEL32.dll_WaitForMultipleObjects
cmp eax, 1
je 0x5eca90
test eax, eax
jne 0x5eccba
mov eax, dword [esp + 0x68]
test eax, eax
je 0x5ecb03
cmp eax, 1
jne 0x5ecac5
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x44], 0
push 1
push ebx
push ecx
push eax
call sub.KERNEL32.dll_GetOverlappedResult
test eax, eax
je 0x5ecad1
mov edi, dword [esp + 0x44]
jmp 0x5ecae8
mov eax, dword [esp + 0x30]
test eax, eax
je 0x5ecb57
cmp eax, 1
jne 0x5ecacb
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x44], 0
push 1
push ebx
push ecx
push eax
call sub.KERNEL32.dll_GetOverlappedResult
test eax, eax
je 0x5ecb29
mov edi, dword [esp + 0x44]
jmp 0x5ecb40
mov edi, dword [esp + 0x6c]
jmp 0x5ecaec
mov edi, dword [esp + 0x34]
jmp 0x5ecb44
xor edi, edi
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x26
je 0x5ecae8
mov esi, eax
cmp eax, 0x6d
jne 0x5eccd1
lea esi, [esp + 0x74]
mov dword [esp + 0x68], 0
mov eax, dword [esp + 0x64]
add dword [eax + 8], edi
test edi, edi
je 0x5ecbbe
mov ecx, ebx
lea edx, [esp + 0x58]
call fcn.005ecf00
cmp byte [esp + 0x44], 1
je 0x5ecb9f
cmp byte [esp + 0x45], 1
je 0x5eca40
jmp 0x5ecbbe
xor edi, edi
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x26
je 0x5ecb40
mov esi, eax
cmp eax, 0x6d
jne 0x5eccd1
lea esi, [esp + 0x74]
mov dword [esp + 0x30], 0
mov eax, dword [esp + 0x2c]
add dword [eax + 8], edi
test edi, edi
je 0x5ecb74
mov ecx, ebx
lea edx, [esp + 0x20]
call fcn.005ecf00
cmp byte [esp + 0x44], 1
je 0x5ecb9f
cmp byte [esp + 0x45], 1
je 0x5eca40
lea ecx, [esp + 0x58]
jmp 0x5ecbc2
call sub.KERNEL32.dll_GetLastError
mov esi, eax
push edi
call sub.KERNEL32.dll_CloseHandle
mov eax, esi
shl esi, 0x18
xor ebx, ebx
shr eax, 8
mov dword [esp], eax
jmp 0x5ecbe0
mov eax, dword [esp]
mov dword [esp + 0x18], eax
jmp 0x5ecbb2
mov esi, dword [esp + 0x4c]
mov eax, dword [esp + 0x48]
mov ecx, esi
jmp 0x5ecbcb
mov eax, dword [esp]
mov dword [esp + 0xc], eax
push ebx
call sub.KERNEL32.dll_CloseHandle
mov edx, dword [esp + 0x50]
jmp 0x5ecbf6
lea ecx, [esp + 0x20]
call fcn.005ed000
mov esi, edx
mov ecx, edx
shr ecx, 8
mov ebx, eax
shld esi, eax, 0x18
mov dword [esp], ecx
lea ecx, [esp + 0x20]
call fcn.005ecdf0
lea ecx, [esp + 0x58]
call fcn.005ecdf0
mov edx, dword [esp + 0x50]
cmp bl, 4
jne 0x5ecdae
mov dword [edx + 4], 0
mov esi, dword [edx]
push 0xffffffffffffffff
push esi
call sub.KERNEL32.dll_WaitForSingleObject
test eax, eax
je 0x5ecc60
call sub.KERNEL32.dll_GetLastError
mov ecx, dword [esp + 0x70]
cmp dword [esp + 0x14], 0
mov dword [ecx + 8], eax
mov dword [ecx + 4], 0
mov dword [ecx], 1
je 0x5ecc41
mov eax, dword [esp + 0x10]
test eax, eax
je 0x5ecc41
push eax
push 0
push dword [0x6f1130]
call sub.KERNEL32.dll_HeapFree
cmp dword [esp + 8], 0
je 0x5eccac
mov eax, dword [esp + 4]
test eax, eax
je 0x5eccac
push eax
push 0
push dword [0x6f1130]
call sub.KERNEL32.dll_HeapFree
jmp 0x5eccac
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0
push eax
push esi
call sub.KERNEL32.dll_GetExitCodeProcess
test eax, eax
je 0x5ecc0b
mov edx, dword [esp + 0x70]
movsd xmm0, qword [esp + 4]
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
movsd qword [edx + 8], xmm0
movsd xmm0, qword [esp + 0x10]
mov dword [edx + 0x10], ecx
mov dword [edx + 0x1c], edi
movsd qword [edx + 0x14], xmm0
mov dword [edx + 4], eax
mov dword [edx], 0
push esi
call sub.KERNEL32.dll_CloseHandle
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
call sub.KERNEL32.dll_GetLastError
mov esi, eax
shr eax, 8
shl esi, 0x18
xor ebx, ebx
mov dword [esp], eax
jmp 0x5ecbd7
mov eax, esi
jmp 0x5eccc1
mov eax, dword [esp]
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], eax
push 0x6d4d38
jmp 0x5ecd3f
mov ecx, esi
mov edx, eax
push 0x6d4918
jmp 0x5ecd5a
mov ecx, str.assertion_failed:_n___buf.len__
mov edx, 0x20
push 0x6d4948
call fcn.0045aec0
add esp, 4
ud2
mov eax, dword [esp]
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], 0
mov dword [esp + 0xc], eax
push 0x6d4d28
push 0x6d3888
lea eax, [esp + 0x28]
push eax
call fcn.0045d480
add esp, 0xc
ud2
mov ecx, esi
push 0x6d4908
call fcn.0045a820
add esp, 4
ud2
mov ecx, esi
mov edx, 0x20
push 0x6d4958
call fcn.0045ab50
add esp, 4
ud2
mov ecx, 0x14
mov edx, 4
call fcn.0040a640
ud2
call sub.KERNEL32.dll_GetLastError
mov esi, eax
push dword [esp + 0x1c]
call sub.KERNEL32.dll_CloseHandle
push ebx
call sub.KERNEL32.dll_CloseHandle
mov eax, esi
shl esi, 0x18
xor ebx, ebx
shr eax, 8
mov dword [esp], eax
mov eax, dword [esp]
mov byte [esp + 0x20], bl
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
mov dword [esp + 0x21], esi
mov word [esp + 0x25], ax
shr eax, 0x10
mov byte [esp + 0x27], al
lea eax, [esp + 0x20]
push 0x6d4d18
push 0x6d3888
push eax
call fcn.0045d480
add esp, 0xc
ud2