Function at 0x10164640
Capabilities:
Check if file exists
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x102519c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push edi
push dword [ebp + 0xc]
mov edi, ecx
mov dword [ebp - 0x48], ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x101646c9
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov ecx, ebx
push 0x10202940
mov dword [ebx], eax
call fcn.10023e80
test al, al
jne 0x10164696
push 0
push 0x10202940
mov ecx, ebx
call fcn.10003740
mov eax, dword [ebp + 0xc]
or ecx, 0xffffffff
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x10164877
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
pop edi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.101f99c6
mov esp, ebp
pop ebp
ret 8
xor eax, eax
push esi
mov dword [ebp - 0x28], eax
xor esi, esi
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
lea eax, [ebp - 0x28]
push eax
push esi
push dword [ebp + 0xc]
mov dword [ebp - 0x38], esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
je 0x10164704
mov esi, dword [ebp - 8]
mov dword [ebp - 0x38], esi
call fcn.10002d70
mov ecx, eax
mov eax, dword [ecx]
call dword [eax + 0xc]
test esi, esi
jne 0x1016474c
add eax, 0x10
mov ecx, ebx
push 0x10202940
mov dword [ebx], eax
call fcn.10023e80
test al, al
jne 0x10164736
push esi
push 0x10202940
mov ecx, ebx
call fcn.10003740
mov edx, dword [ebp + 0xc]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jmp 0x1016486c
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
push dword [ebp + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x40], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x3c], eax
cmp eax, 0xffffffff
je 0x10164836
push 0
lea ecx, [ebp - 0x44]
push ecx
push 0xc
lea ecx, [ebp - 0x34]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1016482d
push 0
push 0
push dword [ebp - 0x34]
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x1016482d
mov eax, dword [edi + 0x18]
cmp eax, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
je 0x101647ba
cmp eax, dword [ebp - 0x38]
jae 0x1016482d
push eax
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
push dword [ebp - 0x2c]
mov dword [ebp - 0x38], eax
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0x10
lea eax, [ebp - 0x44]
push 0
push eax
push dword [ebp - 0x2c]
push dword [ebp - 0x38]
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10164822
xor esi, esi
cmp dword [ebp - 0x2c], esi
jbe 0x10164814
mov ebx, dword [ebp - 0x38]
cmp dword [edi + 0x14], 0x10
mov ecx, edi
jb 0x101647fe
mov ecx, dword [edi]
mov eax, esi
xor edx, edx
div dword [edi + 0x10]
mov al, byte [edx + ecx]
xor byte [esi + ebx], al
inc esi
cmp esi, dword [ebp - 0x2c]
jb 0x101647f4
mov ebx, dword [ebp - 0x48]
push dword [ebp - 0x38]
lea ecx, [ebp - 0x40]
call fcn.10033bf0
mov esi, dword [ebp - 0x40]
push dword [ebp - 0x38]
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
add esp, 4
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esi - 0x10]
push edi
call fcn.10002a60
add eax, 0x10
or esi, 0xffffffff
mov dword [ebx], eax
add esp, 4
mov eax, esi
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x1016485e
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x10164876
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
pop esi
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
xor ecx, ebp
pop ebx
call fcn.101f99c6
mov esp, ebp
pop ebp
ret 8