Function at 0x102f6447
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
mov eax, dword [0x1065e7ec]
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 0x102f6c2b
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 0x102f64eb
movzx ecx, ax
sub edx, ecx
mov eax, dword [ebp + 0x18]
xor ecx, ecx
mov dword [ebp - 0x110], edx
cmp ecx, eax
jb 0x102f6508
ja 0x102f6500
cmp edx, ebx
jb 0x102f6508
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 0x102f6536
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 0x102f6bd4
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x102f6bd4
xor esi, esi
mov dword [ebp - 0x114], esi
test ebx, ebx
jle 0x102f6ba0
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 0x102f65f3
cmp dword [ebp - 0xc8], ecx
jbe 0x102f688e
cmp dword [ebp - 0xd4], esi
jne 0x102f6672
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 0x102f664a
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 0x102f6bd4
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 0x102f668a
and dword [ebp - 0xf4], 0
mov eax, dword [ebp - 0x110]
jmp 0x102f66b7
test ecx, ecx
jb 0x102f66ab
ja 0x102f669d
mov eax, dword [ebp - 0xc8]
cmp eax, 0x10000
jbe 0x102f66b1
and dword [ebp - 0x108], 0
mov eax, 0x10000
jmp 0x102f66b7
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 0x102f67ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x102f6bc9
mov eax, dword [ebp - 0xfc]
inc dword [ebp - 0xc4]
mov dword [eax], 1
jmp 0x102f67d0
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x102f67db
test esi, esi
je 0x102f67db
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 0x102f684a
mov ecx, dword [ebp - 0xd0]
mov eax, dword [ebp - 0xf8]
cmp eax, dword [ecx]
jne 0x102f6bc9
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 0x102f6bd4
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 0x102f688e
mov eax, dword [ebp - 0x100]
jmp 0x102f65dd
mov ebx, dword [ebp - 0xd4]
cmp ebx, esi
je 0x102f6b93
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 0x102f6b93
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x10]
test eax, eax
je 0x102f6919
imul eax, dword [ebp - 0xd8], 0x28
cmp dword [ebp + eax - 0x90], 1
jne 0x102f6919
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x102f6bd4
mov esi, dword [ebp - 0xd8]
push 0
push 0xffffffffffffffff
push dword [ebp + esi*4 - 0x14]
call fcn.101629b2
test eax, eax
jne 0x102f6bc9
mov dword [ebp - 0xbc], esi
cmp esi, 0xffffffff
jne 0x102f694a
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x18]
mov esi, eax
mov dword [ebp - 0xb8], esi
test esi, esi
js 0x102f6bd4
push 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.10162964
mov esi, eax
mov dword [ebp - 0xbc], esi
jmp 0x102f6950
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.102fdec3
add esp, 0x10
test al, al
jne 0x102f69b6
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 0x102f6bd4
mov esi, dword [ebp - 0xbc]
mov ecx, dword [ebp - 0xf4]
mov eax, dword [ebp - 0xf8]
cmp eax, dword [ebp + ecx - 0x94]
jne 0x102f6bc9
mov eax, dword [edi]
mov ecx, edi
dec dword [ebp - 0xc4]
call dword [eax + 0x10]
test eax, eax
je 0x102f69ec
cmp dword [ebp - 0xd8], esi
jne 0x102f6b93
mov eax, dword [ebp - 0xf4]
jmp 0x102f6b85
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 0x102f6bd4
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 0x102f6b76
xor ebx, ebx
cmp edx, ebx
jb 0x102f6a7b
ja 0x102f6a6e
cmp ecx, 0x10000
jbe 0x102f6a7b
mov eax, 0x10000
mov dword [ebp - 0x118], ebx
jmp 0x102f6a83
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 0x102f6b5b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x102f6bc9
inc dword [ebp - 0xc4]
mov dword [ebp + esi - 0x90], 1
jmp 0x102f6b76
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 0x102f69f7
cmp dword [ebp - 0xc4], 0
jg 0x102f68c0
mov eax, dword [ebp - 0xc8]
or eax, dword [ebp - 0x108]
jne 0x102f6bc9
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
cmp eax, dword [ebp - 0xc0]
jne 0x102f6bc9
cmp edx, dword [ebp - 0xcc]
jne 0x102f6bc9
xor esi, esi
jmp 0x102f6bce
mov esi, 0x80004005
mov dword [ebp - 0xb8], esi
mov ebx, dword [ebp - 0xd4]
test ebx, ebx
jle 0x102f6c28
mov esi, dword [ebp - 0x104]
lea edi, [ebp - 0x9c]
lea eax, [edi - 0x10]
cmp dword [eax + 0x1c], 1
jne 0x102f6c0d
and dword [ebp - 0x118], 0
lea ecx, [ebp - 0x118]
push 1
push ecx
push eax
push esi
call fcn.102fdec3
add esp, 0x10
cmp dword [edi], 0
je 0x102f6c1a
push dword [edi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, 0x28
sub ebx, 1
jne 0x102f6bea
mov esi, dword [ebp - 0xb8]
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.102790a9
mov esp, ebp
pop ebp
ret 0x1c