Function at 0x49c2cd
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
mov eax, dword [0x403b5c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xe4], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x14]
xor edx, edx
push edi
mov dword [ebp - 0x110], eax
mov edi, ecx
mov ecx, dword [ebp + 0x18]
mov dword [eax], edx
mov dword [eax + 4], edx
mov eax, ebx
or eax, ecx
mov dword [ebp - 0xf4], edi
mov dword [ebp - 0x100], ecx
je 0x49cac7
mov eax, dword [edi]
push esi
mov ecx, edi
mov dword [ebp - 0xb4], edx
mov dword [ebp - 0xb8], edx
mov dword [ebp - 0xc0], edx
call dword [eax + 0xc]
mov edx, dword [edi]
mov ecx, edi
mov dword [ebp - 0xf8], eax
call dword [edx + 0x14]
mov esi, dword [edi]
mov ecx, edi
mov dword [ebp - 0xb0], eax
mov dword [ebp - 0xbc], edx
call dword [esi + 0xc]
test eax, eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc8], eax
je 0x49c36c
movzx ecx, ax
mov eax, 0x10000
sub eax, ecx
jmp 0x49c371
mov eax, 0x10000
mov edx, dword [ebp + 0x18]
xor esi, esi
mov dword [ebp - 0x10c], eax
cmp esi, edx
jb 0x49c38e
ja 0x49c386
cmp eax, ebx
jb 0x49c38e
mov eax, ebx
mov dword [ebp - 0x10c], eax
mov ecx, ebx
sub ecx, eax
mov eax, edx
sbb eax, esi
add ecx, 0x1ffff
adc eax, esi
shrd ecx, eax, 0x10
push 4
pop esi
shr eax, 0x10
mov dword [ebp - 0xf0], esi
cmp ecx, esi
jg 0x49c3ba
mov esi, ecx
mov dword [ebp - 0xf0], ecx
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
jne 0x49c3d3
cmp esi, 0x40
jle 0x49c3d3
push 0x40
pop esi
mov dword [ebp - 0xf0], esi
mov eax, dword [edi]
push esi
mov ecx, edi
call dword [eax]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
xor esi, esi
mov dword [ebp - 0x108], esi
cmp dword [ebp - 0xf0], esi
jle 0x49ca44
mov ecx, dword [ebp + 0x10]
lea eax, [ebp - 0xa4]
mov dword [ebp - 0xac], eax
lea eax, [ebp - 0x80]
mov dword [ebp - 0xec], eax
lea eax, [ebp - 0x9c]
mov dword [ebp - 0xcc], eax
lea eax, [ebp - 0x90]
mov dword [ebp - 0xd4], eax
lea eax, [ebp - 0x94]
mov dword [ebp - 0xd8], eax
lea eax, [ebp - 0x88]
mov dword [ebp - 0xdc], eax
lea edx, [ebp - 0x84]
lea eax, [ebp - 0x8c]
mov dword [ebp - 0xc4], edx
mov dword [ebp - 0xe8], eax
mov dword [ebp - 0xd0], ecx
mov ecx, dword [ebp - 0x100]
test ecx, ecx
jne 0x49c48d
test ebx, ebx
je 0x49c72b
cmp dword [ebp - 0xb4], esi
jne 0x49c51d
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 - 0xe8]
mov dword [edx], eax
test eax, eax
jne 0x49c4f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0xa8], eax
test esi, esi
jle 0x49c4e0
and esi, 0xffff
or esi, 0x80070000
mov dword [ebp - 0xa8], esi
test esi, esi
jne 0x49ca72
mov esi, dword [ebp - 0x108]
mov edx, dword [ebp - 0xe8]
mov eax, dword [edx]
mov ecx, dword [ebp - 0xb4]
mov dword [ebp + ecx*4 - 0x120], eax
inc ecx
add edx, 0x28
mov dword [ebp - 0xb4], ecx
mov ecx, dword [ebp - 0x100]
mov dword [ebp - 0xe8], edx
mov edx, dword [ebp - 0xc4]
cmp dword [ebp - 0xf8], 0
je 0x49c535
and dword [ebp - 0xf8], 0
mov eax, dword [ebp - 0x10c]
jmp 0x49c559
test ecx, ecx
jb 0x49c551
ja 0x49c543
cmp ebx, 0x10000
jbe 0x49c551
and dword [ebp - 0x100], 0
mov eax, 0x10000
jmp 0x49c559
mov eax, ebx
mov dword [ebp - 0x100], ecx
push dword [ebp - 0xbc]
sub ebx, eax
push dword [ebp - 0xb0]
sbb ecx, 0
mov dword [edx], eax
mov eax, dword [edi]
mov dword [ebp - 0x100], ecx
push esi
mov ecx, edi
call dword [eax + 4]
mov ecx, dword [ebp - 0xdc]
mov edx, dword [ebp - 0xb0]
mov edi, dword [ebp - 0xc8]
push dword [ebp - 0xcc]
mov dword [ecx], eax
mov ecx, dword [ebp - 0xac]
mov dword [ecx], edx
mov edx, dword [ebp - 0xbc]
mov dword [ecx + 4], edx
mov ecx, dword [ebp - 0xc4]
mov edx, dword [ebp - 0xb0]
add edx, dword [ecx]
mov dword [ebp - 0xb0], edx
mov edx, dword [ebp - 0xbc]
adc edx, 0
mov dword [ebp - 0xbc], edx
mov edx, dword [ebp - 0xd8]
mov dword [edx], edi
mov edi, dword [ebp - 0xd0]
mov edx, dword [ebp - 0xd4]
mov dword [edx], edi
mov edx, dword [ebp - 0xc8]
add edx, dword [ecx]
mov dword [ebp - 0xc8], edx
lea edx, [ebp - 0xe0]
push edx
push dword [ecx]
adc edi, 0
and dword [ebp - 0xe0], 0
push eax
push dword [ebp - 0xe4]
mov dword [ebp - 0xd0], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0xf4]
test eax, eax
jne 0x49c641
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x49ca67
mov eax, dword [ebp - 0xec]
inc dword [ebp - 0xb8]
mov dword [eax], 1
jmp 0x49c669
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x49c674
test esi, esi
je 0x49c674
push dword [ebp + esi*4 - 0x120]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xec]
mov dword [eax], 2
mov edx, dword [ebp - 0xc4]
push 0x28
pop ecx
jmp 0x49c6e3
mov eax, dword [ebp - 0xe0]
mov ecx, dword [ebp - 0xc4]
cmp eax, dword [ecx]
jne 0x49ca67
push dword [ebp - 0x110]
mov eax, dword [edi]
push dword [ebp - 0xac]
mov ecx, edi
call dword [eax + 8]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
mov esi, dword [ebp - 0x108]
mov eax, dword [ebp - 0xec]
mov edx, dword [ebp - 0xc4]
push 0x28
pop ecx
sub dword [ebp - 0xdc], ecx
sub dword [ebp - 0xd8], ecx
sub dword [ebp - 0xd4], ecx
sub dword [ebp - 0xcc], ecx
dec esi
sub eax, ecx
sub edx, ecx
sub dword [ebp - 0xac], ecx
add dword [ebp - 0xdc], ecx
add dword [ebp - 0xd8], ecx
add dword [ebp - 0xd4], ecx
add dword [ebp - 0xcc], ecx
add dword [ebp - 0xac], ecx
inc esi
add eax, ecx
add edx, ecx
mov dword [ebp - 0x108], esi
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xc4], edx
cmp esi, dword [ebp - 0xf0]
jge 0x49c72b
mov eax, dword [ebp - 0xe8]
jmp 0x49c47b
mov eax, dword [ebp - 0xb4]
cmp eax, esi
je 0x49ca37
dec eax
mov esi, eax
imul esi, esi, 0x28
push dword [ebp + esi - 0x8c]
mov dword [ebp - 0xb4], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp + esi - 0x8c], 0
jmp 0x49ca37
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x49c7bd
mov eax, dword [ebp - 0xc0]
imul eax, eax, 0x28
cmp dword [ebp + eax - 0x80], 1
jne 0x49c7bd
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
mov esi, dword [ebp - 0xc0]
push 0
push 0xffffffffffffffff
push dword [ebp + esi*4 - 0x120]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
test eax, eax
jne 0x49ca67
mov eax, esi
mov dword [ebp - 0xac], esi
cmp esi, 0xffffffff
jne 0x49c7f3
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
push 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x120]
push eax
push dword [ebp - 0xb4]
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
mov dword [ebp - 0xac], eax
and dword [ebp - 0xe0], 0
mov esi, eax
imul esi, esi, 0x28
push 0
lea eax, [ebp - 0xe0]
push eax
lea eax, [ebp - 0x9c]
add eax, esi
push eax
push dword [ebp - 0xe4]
mov dword [ebp - 0xf8], esi
mov dword [ebp + esi - 0x80], 2
call fcn.00497dc4
add esp, 0x10
test al, al
jne 0x49c863
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0xa8], eax
test esi, esi
jle 0x49c857
and esi, 0xffff
or esi, 0x80070000
mov dword [ebp - 0xa8], esi
test esi, esi
jne 0x49ca72
mov esi, dword [ebp - 0xf8]
mov eax, dword [ebp - 0xe0]
cmp eax, dword [ebp + esi - 0x84]
jne 0x49ca67
mov eax, dword [edi]
dec dword [ebp - 0xb8]
mov ecx, edi
call dword [eax + 0x10]
mov ecx, dword [ebp - 0xac]
test eax, eax
je 0x49c899
cmp dword [ebp - 0xc0], ecx
jne 0x49ca37
cmp dword [ebp + esi - 0x80], 2
jne 0x49ca37
push dword [ebp - 0x110]
mov eax, ecx
imul eax, eax, 0x28
lea ecx, [ebp - 0xa4]
add ecx, eax
mov dword [ebp - 0xf8], eax
mov eax, dword [edi]
push ecx
mov ecx, edi
call dword [eax + 8]
mov esi, eax
mov dword [ebp - 0xa8], esi
test esi, esi
js 0x49ca72
mov esi, dword [ebp - 0xf8]
mov edx, dword [ebp - 0xc0]
and dword [ebp + esi - 0x80], 0
inc edx
mov dword [ebp - 0xc0], edx
cmp edx, dword [ebp - 0xb4]
jne 0x49c8ff
xor edx, edx
mov dword [ebp - 0xc0], edx
jmp 0x49c901
xor edx, edx
mov ecx, dword [ebp - 0x100]
mov eax, ebx
or eax, ecx
je 0x49ca1b
cmp ecx, edx
jb 0x49c92c
ja 0x49c91f
cmp ebx, 0x10000
jbe 0x49c92c
mov eax, 0x10000
mov dword [ebp - 0xf8], edx
jmp 0x49c934
mov eax, ebx
mov dword [ebp - 0xf8], ecx
push dword [ebp - 0xbc]
sub ebx, eax
push dword [ebp - 0xb0]
sbb ecx, edx
push dword [ebp - 0xac]
mov dword [ebp + esi - 0x84], eax
mov eax, dword [edi]
mov dword [ebp - 0x100], ecx
mov ecx, edi
call dword [eax + 4]
mov ecx, dword [ebp + esi - 0x84]
mov edi, dword [ebp - 0xd0]
mov edx, eax
mov eax, dword [ebp - 0xb0]
add dword [ebp - 0xb0], ecx
mov dword [ebp + esi - 0xa4], eax
mov eax, dword [ebp - 0xbc]
mov dword [ebp + esi - 0xa0], eax
adc eax, 0
mov dword [ebp - 0xbc], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp + esi - 0x94], eax
add eax, ecx
adc dword [ebp - 0xd0], 0
mov dword [ebp - 0xc8], eax
lea eax, [ebp - 0x9c]
add eax, esi
push eax
push 0
push ecx
push edx
push dword [ebp - 0xe4]
mov dword [ebp + esi - 0x88], edx
mov dword [ebp + esi - 0x90], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, dword [ebp - 0xf4]
test eax, eax
jne 0x49ca00
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x49ca67
inc dword [ebp - 0xb8]
mov dword [ebp + esi - 0x80], 1
jmp 0x49ca1b
mov eax, dword [ebp - 0xac]
push dword [ebp + eax*4 - 0x120]
mov dword [ebp + esi - 0x80], 2
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xc0]
mov ecx, eax
imul eax, eax, 0x28
cmp dword [ebp + eax - 0x80], 2
mov dword [ebp - 0xac], ecx
je 0x49c8a4
cmp dword [ebp - 0xb8], 0
jg 0x49c75f
or ebx, dword [ebp - 0x100]
jne 0x49ca67
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
cmp eax, dword [ebp - 0xb0]
jne 0x49ca67
cmp edx, dword [ebp - 0xbc]
jne 0x49ca67
xor esi, esi
jmp 0x49ca6c
mov esi, 0x80004005
mov dword [ebp - 0xa8], esi
mov ebx, dword [ebp - 0xb4]
test ebx, ebx
jle 0x49cac4
mov esi, dword [ebp - 0xe4]
lea edi, [ebp - 0x8c]
lea eax, [edi - 0x10]
cmp dword [eax + 0x1c], 1
jne 0x49caab
and dword [ebp - 0xf4], 0
push 1
lea ecx, [ebp - 0xf4]
push ecx
push eax
push esi
call fcn.00497dc4
add esp, 0x10
cmp dword [edi], 0
je 0x49cab8
push dword [edi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 0x28
dec ebx
jne 0x49ca88
mov esi, dword [ebp - 0xa8]
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.0043f894
leave
ret 0x18