Function at 0x405810
Capabilities:
Get common file path
Get program files directory

Disassembly:
push 0xffffffffffffffff
push 0x45625c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x428
mov eax, dword [0x463058]
push ebx
push ebp
push esi
push edi
mov ebx, ecx
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x448]
xor ebp, ebp
push ecx
mov ecx, ebx
mov dword [esp + 0x444], ebp
call fcn.00405ba0
push 0x200
lea ecx, [esp + 0x14]
mov edi, eax
mov esi, edx
call fcn.00403bf0
test eax, eax
je 0x405882
mov edx, dword [esp + 0x10]
mov dword [edx - 8], 0x200
mov eax, dword [esp + 0x10]
mov word [eax + 0x400], bp
mov eax, dword [esp + 0x10]
push 0x200
push eax
push esi
push edi
mov ecx, ebx
call fcn.00405c10
lea ecx, [esp + 0x10]
call fcn.004073c0
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [esp + 0x10]
cmp esi, ebp
mov dword [esp + 0x24], ebp
mov dword [edx - 8], eax
mov ecx, dword [esp + 0x10]
mov word [ecx + eax*2], bp
ja 0x4058ce
jb 0x4058c6
cmp edi, 0xc800000
ja 0x4058ce
mov dword [esp + 0x24], 1
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x232]
mov word [esp + 0x230], bp
rep stosd dword es:[edi], eax
lea edx, [esp + 0x230]
push 0x104
push edx
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov eax, dword [esp + 0x230]
mov cx, ax
cmp cx, 0x61
jb 0x405914
cmp cx, 0x7a
ja 0x405914
add eax, 0xffffffe0
mov ebp, dword [esp + 0x450]
cmp bp, 0x61
jb 0x40592d
cmp bp, 0x7a
ja 0x40592d
add ebp, 0xffe0
cmp bp, ax
mov dword [esp + 0x20], 0
jne 0x405942
mov dword [esp + 0x20], 1
mov eax, dword [0x463058]
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], eax
mov ecx, 0x82
xor eax, eax
lea edi, [esp + 0x28]
push eax
rep stosd dword es:[edi], eax
lea eax, [esp + 0x2c]
push 0x26
push eax
push 0
mov byte [esp + 0x450], 2
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x405a9a
mov ecx, dword [0x463058]
mov edx, 0x46358c
test edx, edx
mov dword [esp + 0x18], ecx
je 0x4059ea
mov eax, edx
shr eax, 0x10
jne 0x4059a9
xor eax, eax
mov ecx, edx
mov ax, cx
lea ecx, [esp + 0x18]
push eax
call fcn.00406f90
jmp 0x4059ea
push 0x46358c
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
test esi, esi
je 0x4059ea
push esi
lea ecx, [esp + 0x1c]
call fcn.00403db0
test eax, eax
je 0x4059ea
lea ecx, [esi + esi]
lea edx, [esi + esi + 2]
cmp edx, ecx
jb 0x4059ea
mov edi, dword [esp + 0x18]
mov eax, ecx
mov esi, 0x46358c
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x28]
push ecx
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + 0x44c], 3
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea ecx, [esp + 0x28]
mov word [esp + 0x28], bp
test ecx, ecx
jne 0x405a18
xor esi, esi
jmp 0x405a25
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
push esi
lea ecx, [esp + 0x18]
call fcn.00407470
test eax, eax
je 0x405a5f
mov edx, dword [esp + 0x14]
lea edi, [esi + esi]
lea eax, [esp + 0x28]
push edi
lea ecx, [esi + esi + 2]
push eax
push ecx
push edx
call fcn.00402e50
mov eax, dword [esp + 0x24]
add esp, 0x10
mov dword [eax - 8], esi
mov ecx, dword [esp + 0x14]
mov word [edi + ecx], 0
mov eax, dword [esp + 0x18]
mov ecx, dword [0x46305c]
mov byte [esp + 0x440], 2
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x405ab5
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x405abb
mov eax, dword [esp + 0x18]
add eax, 0xfffffff4
push eax
call fcn.0043733c
add esp, 4
jmp 0x405abb
mov ecx, ebp
lea edx, [esp + 0x14]
and ecx, 0xffff
push ecx
push 0x463550
push edx
call fcn.00406f70
add esp, 0xc
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x14]
push eax
push ecx
mov ecx, ebx
call fcn.00404d40
mov edx, dword [esp + 0x20]
mov esi, eax
push edx
push ecx
lea eax, [esp + 0x18]
mov ecx, esp
mov dword [esp + 0x28], esp
push eax
call fcn.00406e80
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x454]
push ebp
push esi
push ecx
push edx
mov ecx, ebx
call fcn.00404c50
mov eax, dword [esp + 0x1c]
mov edx, dword [0x46305c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x405b25
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x405b25
mov edx, dword [esp + 0x1c]
add edx, 0xfffffff4
push edx
call fcn.0043733c
add esp, 4
mov eax, dword [esp + 0x14]
mov edx, dword [0x46305c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x405b50
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x405b50
mov edx, dword [esp + 0x14]
add edx, 0xfffffff4
push edx
call fcn.0043733c
add esp, 4
mov eax, dword [esp + 0x10]
mov edx, dword [0x46305c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x405b7b
add eax, 0xfffffff4
push eax
call edi
test eax, eax
jg 0x405b7b
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0043733c
add esp, 4
mov ecx, dword [esp + 0x438]
pop edi
pop esi
pop ebp
mov eax, 1
mov dword fs:[0], ecx
pop ebx
add esp, 0x434
ret 0xc