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

Disassembly:
sub esp, 0x824
push ebp
push esi
push edi
call fcn.1000890a
mov esi, eax
mov dword [esp + 0x10], esi
test esi, esi
jne 0x10008092
push 0x65b
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x10008530
push ebx
mov ebx, dword [esp + 0x840]
test ebx, ebx
je 0x1000851e
call fcn.10008862
test eax, eax
jne 0x1000851e
mov eax, ebx
mov ebp, eax
push 0
pop ebx
and ebp, 0xffffff00
je 0x10008512
test eax, 0xffffe00c
jne 0x10008508
mov edi, dword [esp + 0x838]
test edi, edi
je 0x10008508
cmp dword [esp + 0x83c], ebx
jne 0x10008508
movzx eax, al
mov dword [esp + 0x840], eax
mov eax, 0xe00
test ebp, 0x1000
je 0x10008108
and ebp, 0xffffefff
or ebp, eax
cmp ebp, eax
je 0x1000823f
call fcn.10008952
test eax, eax
je 0x1000811e
push edi
call eax
jmp 0x10008120
mov eax, ebx
mov ecx, ebp
and ecx, 0x100
mov dword [esp + 0x10], ecx
je 0x1000815d
test eax, eax
je 0x10008508
cmp eax, 3
je 0x10008508
cmp eax, 5
je 0x10008508
cmp ebp, 0xf00
jne 0x1000815d
or dword [esp + 0x840], 8
jmp 0x1000823f
mov esi, 0x400
test esi, ebp
jne 0x10008508
test byte [esp + 0x840], 0x62
je 0x1000830b
test eax, eax
je 0x1000818a
cmp eax, 3
je 0x1000818a
cmp eax, 5
jne 0x1000823b
test ebp, 0x200
je 0x10008298
push esi
lea eax, [esp + 0x38]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edx, eax
test edx, edx
je 0x10008501
cmp edx, esi
jae 0x10008501
movzx ecx, word [esp + edx*2 + 0x34]
mov eax, ecx
push 0x5c
mov dword [esp + 0x1c], eax
pop eax
cmp cx, ax
je 0x100081ff
mov eax, ecx
mov dword [esp + 0x18], 0x2f
push 0x5c
movzx eax, ax
pop ecx
cmp ax, word [esp + 0x18]
je 0x100081ff
test edx, edx
je 0x10008501
movzx eax, word [esp + edx*2 + 0x32]
dec edx
mov edi, eax
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x838]
cmp ax, cx
jne 0x100081d8
inc edx
mov ecx, edi
cmp word [edi], bx
je 0x10008220
cmp edx, esi
jae 0x10008501
mov ax, word [ecx]
add ecx, 2
mov word [esp + edx*2 + 0x34], ax
inc edx
cmp word [ecx], bx
jne 0x10008207
xor eax, eax
mov word [esp + edx*2 + 0x34], ax
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10008298
lea edi, [esp + 0x34]
mov esi, dword [esp + 0x14]
call fcn.10008982
mov ebp, eax
test ebp, ebp
je 0x10008254
lea eax, [esp + 0x28]
push eax
push ebx
call ebp
mov ebx, eax
push dword [esp + 0x840]
push dword [esp + 0x840]
push edi
call esi
mov edi, eax
test ebx, ebx
js 0x10008289
test ebp, ebp
je 0x10008289
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x2c]
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
test edi, edi
je 0x100084fd
mov eax, edi
jmp 0x1000852f
test ebp, 0x800
je 0x10008304
push esi
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, eax
test ecx, ecx
je 0x10008501
cmp ecx, esi
jae 0x10008501
push 0x5c
pop eax
cmp word [esp + ecx*2 + 0x34], ax
je 0x100082e4
inc ecx
mov word [esp + ecx*2 + 0x34], ax
jmp 0x100082e4
cmp ecx, esi
jae 0x10008501
mov ax, word [edi]
add edi, 2
mov word [esp + ecx*2 + 0x34], ax
inc ecx
cmp word [edi], bx
jne 0x100082d0
xor eax, eax
mov word [esp + ecx*2 + 0x34], ax
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10008237
push 0x7e
jmp 0x1000850a
call fcn.100088c2
mov dword [esp + 0x14], eax
test eax, eax
je 0x10008501
cmp dword [esp + 0x10], 0
mov esi, ebx
push 0x5c
pop ecx
je 0x1000839d
mov edx, edi
cmp word [edi], bx
je 0x10008501
mov dword [esp + 0x10], esi
cmp esi, 0x400
jae 0x10008501
movzx eax, word [edx]
add edx, 2
mov edi, eax
mov word [esp + esi*2 + 0x34], ax
inc esi
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x838]
cmp word [edx], bx
jne 0x10008333
test esi, esi
je 0x10008501
mov esi, dword [esp + 0x10]
cmp ax, cx
je 0x10008392
movzx edx, ax
push 0x2f
pop eax
cmp dx, ax
je 0x10008392
test esi, esi
je 0x10008501
movzx eax, word [esp + esi*2 + 0x32]
dec esi
mov edx, eax
cmp ax, cx
jne 0x10008375
push 0x3b
pop eax
mov word [esp + esi*2 + 0x36], ax
add esi, 2
test ebp, 0x200
je 0x10008402
mov eax, 0x400
sub eax, esi
push eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x38]
lea eax, [eax + esi*2]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x10008501
cmp eax, dword [esp + 0x10]
jae 0x10008501
dec eax
push 0x5c
add esi, eax
pop ecx
jmp 0x100083eb
push 0x2f
pop eax
cmp dx, ax
je 0x100083f7
test esi, esi
je 0x10008501
dec esi
movzx eax, word [esp + esi*2 + 0x34]
mov edx, eax
cmp ax, cx
jne 0x100083da
push 0x3b
pop eax
mov word [esp + esi*2 + 0x36], ax
add esi, 2
test ebp, 0x800
je 0x10008432
mov ebp, 0x400
lea eax, [esp + 0x34]
sub ebp, esi
lea eax, [eax + esi*2]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x10008501
cmp eax, ebp
jae 0x10008501
add esi, eax
xor eax, eax
mov word [esp + esi*2 + 0x34], ax
mov eax, edi
mov dword [esp + 0x30], eax
jmp 0x10008444
add edi, 2
cmp word [edi], bx
jne 0x10008441
sub edi, eax
and edi, 0xfffffffe
lea eax, [edi + 2]
cmp eax, 0xffff
ja 0x10008508
mov ecx, dword [esp + 0x840]
movzx eax, di
mov word [esp + 0x2c], ax
add eax, 2
mov word [esp + 0x2e], ax
mov eax, ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], ebx
test cl, 1
je 0x1000848d
push 2
mov dword [esp + 0x20], 2
pop eax
test cl, 0x10
je 0x1000849b
or eax, 0x1000
mov dword [esp + 0x1c], eax
test cl, cl
jns 0x100084a8
or eax, 0x800000
mov dword [esp + 0x1c], eax
call fcn.10008982
mov esi, eax
test esi, esi
je 0x100084bd
lea eax, [esp + 0x20]
push eax
push ebx
call esi
mov ebx, eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x40]
push eax
call dword [esp + 0x24]
mov edi, eax
test ebx, ebx
js 0x100084ea
test esi, esi
je 0x100084ea
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x24]
call esi
test edi, edi
jns 0x100084f5
mov ecx, edi
call fcn.100086a7
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x1000852f
xor eax, eax
jmp 0x1000852f
push 0x65b
jmp 0x1000850a
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x100084fd
mov edi, dword [esp + 0x838]
jmp 0x1000823f
push ebx
push dword [esp + 0x840]
push dword [esp + 0x840]
call esi
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x824
ret 0xc