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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x436239
mov eax, dword fs:[0]
push eax
sub esp, 0x62c
mov eax, dword [0x446414]
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
push 0x104
lea eax, [ebp - 0x628]
mov ebx, edx
push eax
mov esi, ecx
mov dword [ebp - 0x630], ebx
mov dword [ebp - 0x62c], 0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push 0
push 0x26
lea ecx, [ebp - 0x420]
push ecx
push 0
call edi
push 0
push 0x2b
lea edx, [ebp - 0x218]
push edx
push 0
call edi
mov ecx, dword [esi]
mov edi, dword [ebx]
lea eax, [ecx - 0x10]
sub edi, 0x10
cmp eax, edi
je 0x40df81
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x40df6b
mov edx, dword [eax]
cmp edx, dword [edi]
jne 0x40df6b
call fcn.00402050
mov dword [ebp - 0x634], eax
or eax, 0xffffffff
lock xadd dword [ebx], eax
dec eax
test eax, eax
jg 0x40df56
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov ecx, dword [ebp - 0x634]
mov edx, dword [ebp - 0x630]
add ecx, 0x10
mov dword [edx], ecx
mov ebx, edx
jmp 0x40df81
mov eax, dword [ebp - 0x630]
mov ebx, dword [ecx - 0xc]
push ecx
push eax
call fcn.00401f90
mov ebx, dword [ebp - 0x630]
mov eax, dword [esi]
mov ecx, dword [eax - 0xc]
test ecx, ecx
js 0x40dfc4
push str.sys
push eax
call fcn.00421c1b
add esp, 8
test eax, eax
je 0x40dfc4
sub eax, dword [esi]
mov edi, 1
sar eax, 1
cmp eax, 0xffffffff
je 0x40dfc9
lea ecx, [ebp - 0x628]
push ecx
push str.sys
push ebx
mov dword [ebp - 0x62c], edi
call fcn.0040e7e0
jmp 0x40dfc9
mov edi, 1
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jl 0x40e004
push str.prog
push eax
call fcn.00421c1b
add esp, 8
test eax, eax
je 0x40e004
sub eax, dword [esi]
sar eax, 1
cmp eax, 0xffffffff
je 0x40e004
lea edx, [ebp - 0x420]
push edx
push str.prog
push ebx
mov dword [ebp - 0x62c], edi
call fcn.0040e7e0
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jl 0x40e03f
push str.common
push eax
call fcn.00421c1b
add esp, 8
test eax, eax
je 0x40e03f
sub eax, dword [esi]
sar eax, 1
cmp eax, 0xffffffff
je 0x40e03f
lea eax, [ebp - 0x218]
push eax
push str.common
push ebx
mov dword [ebp - 0x62c], edi
call fcn.0040e7e0
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jl 0x40e0e4
push str.platform
push eax
call fcn.00421c1b
add esp, 8
test eax, eax
je 0x40e0e4
sub eax, dword [esi]
sar eax, 1
cmp eax, 0xffffffff
je 0x40e0e4
mov edx, dword [section..data]
mov eax, dword [edx + 0xc]
mov ecx, section..data
mov dword [ebp - 0x62c], edi
call eax
add eax, 0x10
mov dword [ebp - 0x630], eax
lea ecx, [ebp - 0x218]
push ecx
push str._sKingdeeKISKISAppPlatForm
lea edi, [ebp - 0x630]
mov dword [ebp - 4], 0
call fcn.00404180
mov edi, dword [ebp - 0x630]
add esp, 8
push edi
push str.platform
push ebx
call fcn.0040e7e0
lea eax, [edi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e0df
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, 1
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jl 0x40e180
push 0x440244
push eax
call fcn.00421c1b
add esp, 8
test eax, eax
je 0x40e180
sub eax, dword [esi]
sar eax, 1
cmp eax, 0xffffffff
je 0x40e180
test byte [0x449000], 1
mov esi, edi
jne 0x40e138
or dword [0x449000], edi
mov dword [ebp - 4], edi
call fcn.00401000
push 0x437470
call fcn.004204a6
add esp, 4
mov dword [ebp - 4], 0xffffffff
push 0x449004
mov ecx, str.setpath
lea edx, [ebp - 0x634]
call fcn.00401ad0
mov eax, dword [ebp - 0x634]
cmp eax, dword [0x44900c]
jne 0x40e16d
xor eax, eax
push eax
push 0x440244
push ebx
call fcn.0040e7e0
mov eax, esi
jmp 0x40e186
mov eax, dword [eax + 0x10]
push eax
push 0x440244
push ebx
call fcn.0040e7e0
mov eax, esi
jmp 0x40e186
mov eax, dword [ebp - 0x62c]
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.0041fcea
mov esp, ebp
pop ebp
ret