Function at 0x408540
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58770c
mov eax, dword fs:[0]
push eax
sub esp, 0x24c
mov eax, dword [0x5f50fc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [ebp + 8]
xor ebx, ebx
mov ecx, dword [ebp + 0x10]
dec eax
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x250], ecx
cmp eax, 6
ja case.0x408587.5
jmp dword [eax*4 + 0x4089ac]
mov eax, dword [ebp + 0x14]
push esi
shr eax, 1
push eax
push ecx
call fcn.0056b3b9
add esp, 0xc
mov ebx, 4
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005663a7
mov esp, ebp
pop ebp
ret 0x10
push esi
call fcn.0056e337
mov ecx, dword [ebp - 0x250]
add esp, 4
mov dword [ecx], eax
jmp 0x40859e
call fcn.00423a43
mov ecx, eax
test ecx, ecx
je 0x408998
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24c], eax
mov dword [ebp - 4], 0
test esi, esi
jne 0x408602
xor ecx, ecx
jmp 0x408616
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x408607
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x24c]
call fcn.00407520
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00568420
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, esi
mov dword [ebp - 0x238], 0
xor eax, eax
mov dword [ebp - 0x234], 7
mov word [ebp - 0x248], ax
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x408670
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x248]
call fcn.00405e10
mov ebx, dword [ebp - 0x238]
lea eax, [ebp - 0x218]
push eax
push str._SysFolder_
lea ecx, [ebp - 0x24c]
mov byte [ebp - 4], 1
call fcn.0040e190
mov esi, eax
test esi, esi
jle 0x4086dd
push 0xc
push str._SysFolder_
call fcn.0056d04f
imul eax, esi
push 0x104
sub ebx, eax
lea eax, [ebp - 0x218]
push eax
call fcn.0056d04f
imul eax, esi
add esp, 0x10
add ebx, eax
push dword [edi + 0x644]
lea ecx, [ebp - 0x24c]
push str._InsFolder_
call fcn.0040e190
mov esi, eax
test esi, esi
jle 0x40871b
push 0xc
push str._InsFolder_
call fcn.0056d04f
imul eax, esi
add esp, 8
sub ebx, eax
mov eax, dword [edi + 0x644]
mov eax, dword [eax - 0xc]
imul eax, esi
add ebx, eax
push dword [edi + 0x648]
lea ecx, [ebp - 0x24c]
push str._LanguageID_
call fcn.0040e190
mov esi, eax
test esi, esi
jle 0x408759
push 0xd
push str._LanguageID_
call fcn.0056d04f
imul eax, esi
add esp, 8
sub ebx, eax
mov eax, dword [edi + 0x648]
mov eax, dword [eax - 0xc]
imul eax, esi
add ebx, eax
push dword [edi + 0x64c]
lea ecx, [ebp - 0x24c]
push str._Language_
call fcn.0040e190
mov esi, eax
test esi, esi
jle 0x408797
push 0xb
push str._Language_
call fcn.0056d04f
imul eax, esi
add esp, 8
sub ebx, eax
mov eax, dword [edi + 0x64c]
mov eax, dword [eax - 0xc]
imul eax, esi
add ebx, eax
call fcn.00423a43
mov ecx, eax
test ecx, ecx
je 0x4089a2
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x258], esi
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
mov byte [ebp - 4], 2
jge 0x4087e2
push 0x104
lea ecx, [ebp - 0x258]
call fcn.00407480
mov esi, dword [ebp - 0x258]
push 0x104
push esi
call fcn.00402780
push dword [esi - 8]
push esi
call fcn.0056d04f
add esp, 8
test eax, eax
js 0x40898e
cmp eax, dword [esi - 8]
jg 0x40898e
xor ecx, ecx
mov dword [esi - 0xc], eax
push esi
mov word [esi + eax*2], cx
lea ecx, [ebp - 0x24c]
push str._UiLanguage_
call fcn.0040e190
mov dword [ebp - 0x254], eax
test eax, eax
jle 0x408852
push 0xd
push str._UiLanguage_
call fcn.0056d04f
imul eax, dword [ebp - 0x254]
add esp, 8
sub ebx, eax
mov eax, dword [esi - 0xc]
imul eax, dword [ebp - 0x254]
add ebx, eax
push dword [edi + 0x63c]
lea ecx, [ebp - 0x24c]
push str._ProductName_
call fcn.0040e190
mov dword [ebp - 0x254], eax
test eax, eax
jle 0x40889c
push 0xe
push str._ProductName_
call fcn.0056d04f
imul eax, dword [ebp - 0x254]
add esp, 8
sub ebx, eax
mov eax, dword [edi + 0x63c]
mov eax, dword [eax - 0xc]
imul eax, dword [ebp - 0x254]
add ebx, eax
xor eax, eax
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
lea eax, [ebp - 0x230]
mov byte [ebp - 4], 3
push eax
mov ecx, edi
call fcn.0040ce20
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
lea ecx, [ebp - 0x24c]
cmovae eax, dword [ebp - 0x230]
push eax
push str._Version_
call fcn.0040e190
mov edi, eax
test edi, edi
jle 0x408912
push 0xa
push str._Version_
call fcn.0056d04f
mov ecx, dword [ebp - 0x220]
add esp, 8
sub ecx, eax
imul ecx, edi
add ebx, ecx
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp - 0x24c]
mov ecx, dword [ebp - 0x250]
push edi
shr eax, 1
push eax
push ecx
call fcn.0056b3b9
add esp, 0xc
lea ecx, [ebp - 0x230]
lea ebx, [ebx*2 + 2]
call fcn.00405d60
lea edx, [esi - 0x10]
mov byte [ebp - 4], 1
or esi, 0xffffffff
mov eax, esi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40895e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x248]
call fcn.00405d60
mov dword [ebp - 4], 0xffffffff
add edi, 0xfffffff0
lock xadd dword [edi + 0xc], esi
dec esi
test esi, esi
jg case.0x408587.5
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
jmp case.0x408587.5
push 0x80070057
call fcn.00406af0
push 0x80004005
call fcn.00406af0
push 0x80004005
call fcn.00406af0
salc
test dword [eax], eax
salc
test dword [eax], eax
mov es, word [ebp - 0x7a3cffc0]
inc eax
add byte [ebx - 0x5cffbf7b], ah
test dword [eax], eax
salc
test dword [eax], eax
int3