Function at 0x4aebc5
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
mov eax, dword [0x6029bc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
xor edx, edx
mov ecx, dword [ebp + 0x18]
mov dword [ebp - 0x104], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x120], eax
mov dword [eax], edx
mov dword [eax + 4], edx
mov eax, ebx
or eax, ecx
mov dword [ebp - 0xc8], ebx
push edi
mov edi, dword [ebp + 0x20]
mov dword [ebp - 0x118], edi
mov dword [ebp - 0x108], ecx
je 0x4af3a9
mov eax, dword [edi]
mov ecx, edi
push esi
mov dword [ebp - 0xd4], edx
mov dword [ebp - 0xc4], edx
mov dword [ebp - 0xd8], edx
call dword [eax + 0xc]
mov edx, dword [edi]
mov ecx, edi
mov dword [ebp - 0xf4], eax
call dword [edx + 0x14]
mov esi, dword [edi]
mov ecx, edi
mov dword [ebp - 0xc0], eax
mov dword [ebp - 0xcc], edx
call dword [esi + 0xc]
test eax, eax
mov edx, 0x10000
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xec], eax
je 0x4aec69
movzx ecx, ax
sub edx, ecx
mov eax, dword [ebp + 0x18]
xor ecx, ecx
mov dword [ebp - 0x110], edx
cmp ecx, eax
jb 0x4aec86
ja 0x4aec7e
cmp edx, ebx
jb 0x4aec86
mov edx, ebx
mov dword [ebp - 0x110], edx
sub ebx, edx
push 4
sbb eax, ecx
add ebx, 0x1ffff
adc eax, ecx
mov ecx, edi
shrd ebx, eax, 0x10
shr eax, 0x10
pop eax
cmp ebx, eax
cmovg ebx, eax
mov eax, dword [edi]
call dword [eax + 0x10]
test eax, eax
jne 0x4aecb4
push 0x40
pop eax
cmp ebx, eax
cmovg ebx, eax
mov eax, dword [edi]
mov ecx, edi
push ebx
call dword [eax]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
xor esi, esi
mov dword [ebp - 0x114], esi
test ebx, ebx
jle 0x4af31e
mov ecx, dword [ebp + 0x10]
lea eax, [ebp - 0xb4]
mov dword [ebp - 0xbc], eax
lea edx, [ebp - 0x94]
lea eax, [ebp - 0x90]
mov dword [ebp - 0xd0], edx
mov dword [ebp - 0xfc], eax
lea eax, [ebp - 0xac]
mov dword [ebp - 0xe8], eax
lea eax, [ebp - 0xa0]
mov dword [ebp - 0xe4], eax
lea eax, [ebp - 0xa4]
mov dword [ebp - 0xe0], eax
lea eax, [ebp - 0x98]
mov dword [ebp - 0xdc], eax
lea eax, [ebp - 0x9c]
mov dword [ebp - 0x100], eax
mov dword [ebp - 0xf0], ecx
mov ecx, dword [ebp - 0x108]
test ecx, ecx
jne 0x4aed71
cmp dword [ebp - 0xc8], ecx
jbe 0x4af00c
cmp dword [ebp - 0xd4], esi
jne 0x4aedf0
xor ecx, ecx
push 0x1f0003
push ecx
push ecx
push ecx
mov dword [eax + 0xc], ecx
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_CreateEventExW]
mov edx, dword [ebp - 0x100]
mov dword [edx], eax
test eax, eax
jne 0x4aedc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
jne 0x4af352
mov esi, dword [ebp - 0x114]
mov edx, dword [ebp - 0x100]
mov ecx, dword [ebp - 0xd4]
mov eax, dword [edx]
mov dword [ebp + ecx*4 - 0x14], eax
inc ecx
add edx, 0x28
mov dword [ebp - 0xd4], ecx
mov ecx, dword [ebp - 0x108]
mov dword [ebp - 0x100], edx
mov edx, dword [ebp - 0xd0]
cmp dword [ebp - 0xf4], 0
je 0x4aee08
and dword [ebp - 0xf4], 0
mov eax, dword [ebp - 0x110]
jmp 0x4aee35
test ecx, ecx
jb 0x4aee29
ja 0x4aee1b
mov eax, dword [ebp - 0xc8]
cmp eax, 0x10000
jbe 0x4aee2f
and dword [ebp - 0x108], 0
mov eax, 0x10000
jmp 0x4aee35
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0x108], ecx
push dword [ebp - 0xcc]
mov dword [edx], eax
mov eax, dword [ebp - 0xc8]
sub eax, dword [edx]
push dword [ebp - 0xc0]
mov dword [ebp - 0xc8], eax
sbb ecx, 0
mov eax, dword [edi]
mov dword [ebp - 0x108], ecx
mov ecx, edi
push esi
call dword [eax + 4]
mov ecx, dword [ebp - 0xdc]
mov edx, dword [ebp - 0xc0]
mov edi, dword [ebp - 0xec]
push dword [ebp - 0xe8]
mov dword [ecx], eax
mov ecx, dword [ebp - 0xbc]
mov dword [ecx], edx
mov edx, dword [ebp - 0xcc]
mov dword [ecx + 4], edx
mov ecx, dword [ebp - 0xd0]
mov edx, dword [ebp - 0xc0]
add edx, dword [ecx]
mov dword [ebp - 0xc0], edx
mov edx, dword [ebp - 0xcc]
adc edx, 0
mov dword [ebp - 0xcc], edx
mov edx, dword [ebp - 0xe0]
mov dword [edx], edi
mov edx, dword [ebp - 0xe4]
mov edi, dword [ebp - 0xf0]
mov dword [edx], edi
mov edx, dword [ebp - 0xec]
add edx, dword [ecx]
mov dword [ebp - 0xec], edx
lea edx, [ebp - 0xf8]
push edx
push dword [ecx]
adc edi, 0
and dword [ebp - 0xf8], 0
push eax
push dword [ebp - 0x104]
mov dword [ebp - 0xf0], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0x118]
test eax, eax
jne 0x4aef29
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4af347
mov eax, dword [ebp - 0xfc]
inc dword [ebp - 0xc4]
mov dword [eax], 1
jmp 0x4aef4e
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x4aef59
test esi, esi
je 0x4aef59
push dword [ebp + esi*4 - 0x14]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xfc]
mov dword [eax], 2
mov edx, dword [ebp - 0xd0]
push 0x28
pop ecx
jmp 0x4aefc8
mov ecx, dword [ebp - 0xd0]
mov eax, dword [ebp - 0xf8]
cmp eax, dword [ecx]
jne 0x4af347
push dword [ebp - 0x120]
mov eax, dword [edi]
mov ecx, edi
push dword [ebp - 0xbc]
call dword [eax + 8]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
mov esi, dword [ebp - 0x114]
mov eax, dword [ebp - 0xfc]
dec esi
mov edx, dword [ebp - 0xd0]
push 0x28
pop ecx
sub dword [ebp - 0xdc], ecx
sub eax, ecx
sub dword [ebp - 0xe0], ecx
sub edx, ecx
sub dword [ebp - 0xe4], ecx
sub dword [ebp - 0xe8], ecx
sub dword [ebp - 0xbc], ecx
add dword [ebp - 0xdc], ecx
inc esi
add dword [ebp - 0xe0], ecx
add eax, ecx
add dword [ebp - 0xe4], ecx
add edx, ecx
add dword [ebp - 0xe8], ecx
add dword [ebp - 0xbc], ecx
mov dword [ebp - 0x114], esi
mov dword [ebp - 0xfc], eax
mov dword [ebp - 0xd0], edx
cmp esi, ebx
jge 0x4af00c
mov eax, dword [ebp - 0x100]
jmp 0x4aed5b
mov ebx, dword [ebp - 0xd4]
cmp ebx, esi
je 0x4af311
dec ebx
imul esi, ebx, 0x28
mov dword [ebp - 0xd4], ebx
push dword [ebp + esi - 0x9c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp + esi - 0x9c], 0
jmp 0x4af311
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x4af097
imul eax, dword [ebp - 0xd8], 0x28
cmp dword [ebp + eax - 0x90], 1
jne 0x4af097
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
mov esi, dword [ebp - 0xd8]
push 0
push 0xffffffffffffffff
push dword [ebp + esi*4 - 0x14]
call fcn.0048c962
test eax, eax
jne 0x4af347
mov dword [ebp - 0xbc], esi
cmp esi, 0xffffffff
jne 0x4af0c8
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
push 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.0048c914
mov esi, eax
mov dword [ebp - 0xbc], esi
jmp 0x4af0ce
mov esi, dword [ebp - 0xbc]
and dword [ebp - 0xf8], 0
lea ecx, [ebp - 0xf8]
imul eax, esi, 0x28
push 0
push ecx
mov dword [ebp - 0xf4], eax
mov dword [ebp + eax - 0x90], 2
lea eax, [ebp + eax - 0xac]
push eax
push dword [ebp - 0x104]
call fcn.004b445f
add esp, 0x10
test al, al
jne 0x4af134
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
jne 0x4af352
mov esi, dword [ebp - 0xbc]
mov ecx, dword [ebp - 0xf4]
mov eax, dword [ebp - 0xf8]
cmp eax, dword [ebp + ecx - 0x94]
jne 0x4af347
mov eax, dword [edi]
mov ecx, edi
dec dword [ebp - 0xc4]
call dword [eax + 0x10]
test eax, eax
je 0x4af16a
cmp dword [ebp - 0xd8], esi
jne 0x4af311
mov eax, dword [ebp - 0xf4]
jmp 0x4af303
push dword [ebp - 0x120]
imul eax, esi, 0x28
lea ecx, [ebp - 0xb4]
add ecx, eax
mov dword [ebp - 0x118], eax
mov eax, dword [edi]
push ecx
mov ecx, edi
call dword [eax + 8]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x4af352
mov esi, dword [ebp - 0x118]
xor ecx, ecx
mov eax, dword [ebp - 0xd8]
mov edx, dword [ebp - 0x108]
and dword [ebp + esi - 0x90], 0
inc eax
cmp eax, ebx
cmove eax, ecx
mov ecx, dword [ebp - 0xc8]
mov dword [ebp - 0xd8], eax
mov eax, ecx
or eax, edx
je 0x4af2f4
xor ebx, ebx
cmp edx, ebx
jb 0x4af1f9
ja 0x4af1ec
cmp ecx, 0x10000
jbe 0x4af1f9
mov eax, 0x10000
mov dword [ebp - 0x118], ebx
jmp 0x4af201
mov eax, ecx
mov dword [ebp - 0x118], edx
push dword [ebp - 0xcc]
sub ecx, eax
mov dword [ebp + esi - 0x94], eax
push dword [ebp - 0xc0]
mov eax, dword [edi]
sbb edx, ebx
push dword [ebp - 0xbc]
mov dword [ebp - 0xc8], ecx
mov ecx, edi
mov dword [ebp - 0x108], edx
call dword [eax + 4]
mov ecx, dword [ebp + esi - 0x94]
mov edx, eax
mov eax, dword [ebp - 0xc0]
add dword [ebp - 0xc0], ecx
mov dword [ebp + esi - 0xb4], eax
mov eax, dword [ebp - 0xcc]
mov dword [ebp + esi - 0xb0], eax
adc eax, ebx
mov ebx, dword [ebp - 0xf0]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0xec]
mov dword [ebp + esi - 0xa4], eax
add eax, ecx
mov dword [ebp - 0xec], eax
lea eax, [ebp - 0xac]
adc dword [ebp - 0xf0], 0
add eax, esi
push eax
push 0
push ecx
push edx
push dword [ebp - 0x104]
mov dword [ebp + esi - 0x98], edx
mov dword [ebp + esi - 0xa0], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, dword [ebp - 0xd4]
test eax, eax
jne 0x4af2d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4af347
inc dword [ebp - 0xc4]
mov dword [ebp + esi - 0x90], 1
jmp 0x4af2f4
mov eax, dword [ebp - 0xbc]
mov dword [ebp + esi - 0x90], 2
push dword [ebp + eax*4 - 0x14]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov esi, dword [ebp - 0xd8]
mov dword [ebp - 0xbc], esi
imul eax, esi, 0x28
cmp dword [ebp + eax - 0x90], 2
je 0x4af175
cmp dword [ebp - 0xc4], 0
jg 0x4af03e
mov eax, dword [ebp - 0xc8]
or eax, dword [ebp - 0x108]
jne 0x4af347
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
cmp eax, dword [ebp - 0xc0]
jne 0x4af347
cmp edx, dword [ebp - 0xcc]
jne 0x4af347
xor esi, esi
jmp 0x4af34c
mov esi, 0x80004005
mov dword [ebp - 0xb8], esi
mov ebx, dword [ebp - 0xd4]
test ebx, ebx
jle 0x4af3a6
mov esi, dword [ebp - 0x104]
lea edi, [ebp - 0x9c]
lea eax, [edi - 0x10]
cmp dword [eax + 0x1c], 1
jne 0x4af38b
and dword [ebp - 0x118], 0
lea ecx, [ebp - 0x118]
push 1
push ecx
push eax
push esi
call fcn.004b445f
add esp, 0x10
cmp dword [edi], 0
je 0x4af398
push dword [edi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 0x28
sub ebx, 1
jne 0x4af368
mov esi, dword [ebp - 0xb8]
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.004cd104
mov esp, ebp
pop ebp
ret 0x1c