Function at 0x1008599
Capabilities:
Check if file exists
Check mutex on windows
Get common file path
Get file attributes
Set file attributes

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x454
mov eax, dword [0x1020104]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push 0x1002780
mov dword [ebp - 0x44c], eax
call fcn.01005858
mov dword [esp], 0x1002774
call fcn.01005858
xor ebx, ebx
pop ecx
cmp esi, ebx
je 0x10085f6
cmp byte [esi], bl
je 0x10085f6
push 0x1002764
push esi
call fcn.01005ce5
mov dword [0x1021794], 1
test eax, eax
je 0x10085fc
mov dword [0x1021794], ebx
call fcn.01008cf6
xor ecx, ecx
test al, al
sete cl
mov eax, ecx
mov dword [0x102179c], eax
cmp eax, ebx
jne 0x100861e
push 0x1002734
call fcn.01005858
pop ecx
call fcn.01008bb9
test al, al
jne 0x1008638
push 0x10026d8
call fcn.01005858
pop ecx
mov dword [0x102179c], ebx
push 0x10026c8
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
test eax, eax
jne 0x1008650
xor eax, eax
jmp 0x1008a31
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0xb7
je 0x1008649
push edi
mov edi, 0x104
push edi
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jne 0x100869c
push ebx
call esi
push eax
push 0x1001ee0
push 0x10026c0
push 0x325
push 0x10019f8
call fcn.010059aa
add esp, 0x18
jmp 0x1008a21
push edi
lea eax, [ebp - 0x108]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x10086c4
push ebx
call esi
push eax
push 0x10023b8
push 0x10026c0
push 0x32b
jmp 0x100868a
lea eax, [ebp - 0x108]
push 0x5c
push eax
call fcn.0100e2d0
pop ecx
pop ecx
cmp eax, ebx
je 0x10086da
mov byte [eax], bl
call fcn.01008518
test eax, eax
je 0x1008a2e
call fcn.01005d14
test eax, eax
jne 0x10086fd
push ebx
push 0x30
push 0x1b67
jmp 0x1008a29
call fcn.01007437
test eax, eax
je 0x10087dd
call fcn.010074ca
test eax, eax
jne 0x10087dd
mov esi, 0x10026b0
push esi
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.01006cba
test eax, eax
jne 0x100875f
push esi
lea eax, [ebp - 0x20c]
push eax
push 0x1001b90
push ebx
push ebx
push 0x10026c0
push 0x340
push 0x10019f8
call fcn.010059aa
add esp, 0x20
jmp 0x1008a2e
lea eax, [ebp - 0x448]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.0100c4f6
test al, al
jne 0x100878c
push 0x1002694
push ebx
push ebx
push 0x10026c0
push 0x345
jmp 0x100868a
mov eax, dword [ebp - 0x43c]
movzx ecx, ax
push ecx
shr eax, 0x10
push eax
mov eax, dword [ebp - 0x440]
movzx ecx, ax
push ecx
shr eax, 0x10
push eax
push 0x100266c
call fcn.01005858
mov eax, dword [ebp - 0x440]
shr eax, 0x10
add esp, 0x14
cmp ax, 5
jb 0x10087d0
jne 0x10087dd
cmp word [ebp - 0x440], 0x50
jae 0x10087dd
push ebx
push 0x30
push 0x178a
jmp 0x1008a29
mov esi, 0x100265c
push esi
push 0x1001384
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x310]
push eax
call fcn.01006d0d
test eax, eax
jne 0x100881d
push esi
lea eax, [ebp - 0x108]
push eax
push 0x1001dbc
push ebx
push ebx
push 0x10026c0
push 0x358
jmp 0x100874d
push ebx
lea eax, [ebp - 0x310]
push eax
call fcn.01006d63
test eax, eax
je 0x100885d
call fcn.01007607
test eax, eax
mov eax, 0x100264c
jne 0x1008841
mov eax, 0x100263c
lea ecx, [ebp - 0x108]
push ecx
push eax
lea eax, [ebp - 0x310]
push eax
call fcn.0100d46f
test eax, eax
je 0x1008a21
mov esi, 0x1002044
push esi
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.01006cba
test eax, eax
je 0x10089fb
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov edi, 0x10026c0
mov esi, 0x10019f8
cmp eax, 0xffffffff
je 0x10088cc
test al, 2
jne 0x10088ec
or eax, 2
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x10088ec
push 0x100262c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1002618
push edi
push 0x369
jmp 0x10088e3
push 0x1002608
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1001b3c
push edi
push 0x36c
push esi
call fcn.010059aa
add esp, 0x18
call dword [sym.imp.COMCTL32.dll_InitCommonControls]
lea eax, [ebp - 0x454]
push eax
mov dword [ebp - 0x454], 8
mov dword [ebp - 0x450], 0x8000
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
test eax, eax
jne 0x1008928
push 0x10025d0
call fcn.01005858
pop ecx
mov dword [0x102179c], ebx
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
cmp eax, ebx
jge 0x100894e
push ebx
push eax
push 0x10025c0
push edi
push 0x380
push esi
call fcn.010059aa
add esp, 0x18
jmp 0x1008a2e
push dword [0x102179c]
push dword [0x1021794]
push dword [ebp - 0x44c]
call fcn.0100b1a4
mov esi, eax
xor eax, eax
cmp esi, 1
sete al
push esi
push 0x100259c
mov edi, eax
call fcn.01005858
pop ecx
pop ecx
call dword [sym.imp.ole32.dll_CoUninitialize]
push ebx
lea eax, [ebp - 0x310]
push eax
call fcn.01006d63
test eax, eax
je 0x10089bc
lea eax, [ebp - 0x108]
push eax
push 0x1002594
lea eax, [ebp - 0x310]
push eax
call fcn.0100d46f
test eax, eax
jne 0x10089bc
push 0x1002558
call fcn.01005858
pop ecx
cmp dword [0x1021794], ebx
jne 0x10089e1
cmp edi, ebx
je 0x10089da
push 0x1002538
call fcn.01005858
pop ecx
mov eax, 0xaa000007
jmp 0x1008a30
mov eax, 0xaa000000
jmp 0x1008a30
cmp edi, ebx
je 0x10089ec
push 0x1002508
jmp 0x10089f1
push 0x10024e8
call fcn.01005858
pop ecx
mov eax, esi
jmp 0x1008a30
push esi
lea eax, [ebp - 0x20c]
push eax
push 0x1001b90
push ebx
push ebx
push 0x10026c0
push 0x36e
push 0x10019f8
call fcn.010059aa
add esp, 0x20
push ebx
push 0x30
push 0x1b61
call fcn.0100d628
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.0100e2ad
leave
ret 0x10