Function at 0x10005310
Capabilities:
Check if file exists
Get common file path

Disassembly:
push 0xffffffffffffffff
push 0x100510a6
mov eax, dword fs:[0]
push eax
sub esp, 0x234
mov eax, dword [0x10066060]
xor eax, esp
mov dword [esp + 0x230], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x10066060]
xor eax, esp
push eax
lea eax, [esp + 0x248]
mov dword fs:[0], eax
mov edi, dword [esp + 0x25c]
mov esi, dword [esp + 0x258]
xor ebx, ebx
mov dword [esp + 0x1c], ebx
push 0x1006a028
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], 0x1006a028
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push edi
push str._FindFileByDocName:_s
mov dword [esp + 0x258], ebx
call fcn.10020ca3
mov eax, dword [0x1006aa70]
mov edi, dword [eax]
mov ebp, dword [0x1006aa5c]
add esp, 8
jmp 0x100053a0
mov ebx, dword [0x1006aa70]
test ebp, ebp
je 0x100053b2
cmp ebp, dword [0x1006aa5c]
je 0x100053b7
call fcn.100378c0
cmp edi, ebx
je 0x10005495
test ebp, ebp
jne 0x100053df
call fcn.100378c0
xor eax, eax
cmp edi, dword [eax + 0x14]
jne 0x100053d4
call fcn.100378c0
cmp dword [edi + 0x20], 8
jb 0x100053e4
mov eax, dword [edi + 0xc]
jmp 0x100053e7
mov eax, dword [ebp]
jmp 0x100053ca
lea eax, [edi + 0xc]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
call ebx
test eax, eax
je 0x10005436
cmp dword [esp + 0x18], 0
je 0x10005436
test ebp, ebp
jne 0x1000541b
call fcn.100378c0
xor eax, eax
cmp edi, dword [eax + 0x14]
jne 0x10005410
call fcn.100378c0
cmp dword [edi + 0x20], 8
jb 0x10005420
mov eax, dword [edi + 0xc]
jmp 0x10005423
mov eax, dword [ebp]
jmp 0x10005406
lea eax, [edi + 0xc]
mov ecx, dword [esp + 0x18]
push ecx
push eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x10005457
test ebp, ebp
jne 0x10005452
call fcn.100378c0
xor eax, eax
cmp edi, dword [eax + 0x14]
jne 0x1000544b
call fcn.100378c0
mov edi, dword [edi]
jmp 0x100053a0
mov eax, dword [ebp]
jmp 0x10005441
test ebp, ebp
jne 0x10005490
call fcn.100378c0
cmp edi, dword [ebp + 0x14]
jne 0x1000546a
call fcn.100378c0
xor edx, edx
push 0xffffffffffffffff
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
lea eax, [edi + 8]
push edx
mov ecx, esi
mov word [esi + 4], dx
call fcn.10008d90
jmp 0x10005708
mov ebp, dword [ebp]
jmp 0x10005460
mov edi, dword [esp + 0x18]
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x10005557
push 0x10058000
push edi
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
jne 0x10005520
push 0x206
push eax
lea ecx, [esp + 0x46]
push ecx
mov word [esp + 0x48], ax
call fcn.10039730
add esp, 0xc
lea edx, [esp + 0x3c]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push edi
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
xor ecx, ecx
lea eax, [esp + 0x3c]
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
mov word [esi + 4], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10005507
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x40]
jmp 0x10005703
xor edx, edx
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
mov eax, edi
mov word [esi + 4], dx
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10005540
sub eax, edx
sar eax, 1
push eax
mov eax, edi
jmp 0x10005703
mov eax, dword [0x1006aa70]
mov edi, dword [eax]
mov ebx, dword [0x1006aa5c]
mov ebp, dword [0x1006aa70]
test ebx, ebx
je 0x10005576
cmp ebx, dword [0x1006aa5c]
je 0x1000557b
call fcn.100378c0
cmp edi, ebp
je 0x100055f5
test ebx, ebx
jne 0x1000559f
call fcn.100378c0
xor eax, eax
cmp edi, dword [eax + 0x14]
jne 0x10005594
call fcn.100378c0
cmp dword [edi + 0x20], 8
jb 0x100055a3
mov eax, dword [edi + 0xc]
jmp 0x100055a6
mov eax, dword [ebx]
jmp 0x1000558a
lea eax, [edi + 0xc]
mov ecx, dword [esp + 0x18]
push ecx
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
jne 0x100055da
test ebx, ebx
jne 0x100055d6
call fcn.100378c0
xor eax, eax
cmp edi, dword [eax + 0x14]
jne 0x100055d2
call fcn.100378c0
mov edi, dword [edi]
jmp 0x10005564
mov eax, dword [ebx]
jmp 0x100055c8
test ebx, ebx
jne 0x100055eb
call fcn.100378c0
cmp edi, dword [ebx + 0x14]
jmp 0x10005463
mov ebx, dword [ebx]
cmp edi, dword [ebx + 0x14]
jmp 0x10005463
mov ebx, dword [esp + 0x18]
mov edi, dword [sym.imp.SHLWAPI.dll_StrStrIW]
push 0x10058004
push ebx
call edi
test eax, eax
je 0x100056e9
push 0x206
xor ebp, ebp
lea ecx, [esp + 0x42]
xor eax, eax
push ebp
push ecx
mov word [esp + 0x48], ax
call fcn.10039730
add esp, 0xc
push 0x104
push ebx
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
push 0x10058004
lea eax, [esp + 0x40]
push eax
call edi
mov edi, eax
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x24]
xor ecx, ecx
push eax
mov word [edi], cx
call fcn.10005310
add esp, 8
mov byte [esp + 0x250], 1
cmp dword [esp + 0x34], ebp
je 0x100056b3
xor ecx, ecx
mov edi, 7
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebp
push 0xffffffffffffffff
mov word [esi + 4], cx
push ebp
lea eax, [esp + 0x28]
mov ecx, esi
call fcn.10008d90
cmp dword [esp + 0x38], 8
jb 0x100056a2
mov edx, dword [esp + 0x24]
push edx
call fcn.100378fa
add esp, 4
xor eax, eax
mov dword [esp + 0x38], edi
mov dword [esp + 0x34], ebp
mov word [esp + 0x24], ax
jmp 0x10005708
add edi, 6
push edi
push esi
call fcn.10005310
add esp, 8
cmp dword [esp + 0x38], 8
jb 0x100056d4
mov ecx, dword [esp + 0x24]
push ecx
call fcn.100378fa
add esp, 4
xor edx, edx
mov dword [esp + 0x38], 7
mov dword [esp + 0x34], ebp
mov word [esp + 0x24], dx
jmp 0x10005708
xor eax, eax
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
mov word [esi + 4], ax
push eax
mov eax, 0x10057af0
call fcn.10009f80
push 0x1006a028
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
mov ecx, dword [esp + 0x248]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x230]
xor ecx, esp
call fcn.100370e4
add esp, 0x240
ret