Function at 0x40ccc9
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x433a0c
mov eax, dword fs:[0]
push eax
sub esp, 0x37c
mov eax, dword [0x462074]
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 ebx, edx
mov edi, ecx
cmp dword [ebx + 0x14], 8
mov ecx, ebx
jb 0x40cd05
mov ecx, dword [ebx]
mov edx, str..exe
call fcn.0040c108
mov esi, eax
xor ecx, ecx
mov dword [ebp - 0x388], ecx
test esi, esi
je 0x40cd26
cmp word [esi], cx
je 0x40cd26
mov eax, ecx
jmp 0x40cd29
xor eax, eax
inc eax
test eax, eax
jne 0x40d272
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x40cd3b
mov eax, dword [ebx]
sub esi, eax
mov dword [ebp - 0x37c], ecx
sar esi, 1
cmp esi, 0x104
jae 0x40d272
push esi
push ecx
mov ecx, ebx
call fcn.0040d6d3
mov edx, eax
mov dword [ebp - 0x36c], edx
cmp eax, 0xffffffff
je 0x40cd74
inc eax
mov ecx, esi
sub ecx, eax
mov dword [ebp - 0x37c], ecx
jmp 0x40cd7a
mov ecx, dword [ebp - 0x37c]
inc edx
xor eax, eax
cmp dword [ebp - 0x36c], 0xffffffff
cmove edx, eax
mov dword [ebp - 0x384], edx
test ecx, ecx
je 0x40d270
lea eax, [ecx + 4]
mov ecx, ebx
push eax
push edx
lea eax, [ebp - 0x40]
push eax
call fcn.0040d683
xor esi, esi
mov dword [ebp - 0x14], 7
push str.Kernel32.dll
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
jne 0x40ce21
lea eax, [ebp - 0x28]
mov ecx, edi
push eax
call fcn.0040deab
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x40ce04
mov ecx, dword [ebp - 0x28]
lea eax, [eax*2 + 2]
mov edx, ecx
cmp eax, 0x1000
jb 0x40cdfc
mov ecx, dword [edx - 4]
sub edx, ecx
lea eax, [edx - 4]
cmp eax, 0x1f
jbe 0x40cdfc
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
pop ecx
mov dword [ebp - 0x18], esi
xor eax, eax
mov dword [ebp - 0x14], 7
lea ecx, [ebp - 0x40]
mov word [ebp - 0x28], ax
call fcn.0040a89a
jmp 0x40d27e
push str.GetCurrentPackageId
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x380], eax
test eax, eax
je 0x40cdc3
push esi
lea ecx, [ebp - 0x36c]
mov dword [ebp - 0x36c], esi
push ecx
call eax
cmp eax, 0x7a
jne 0x40cdc3
mov ecx, dword [ebp - 0x36c]
xor eax, eax
mov dword [ebp - 0x370], ecx
mov dword [ebp - 0x378], eax
test ecx, ecx
je 0x40ced3
cmp ecx, 0x7fffffff
ja 0x40d29a
cmp ecx, 0x1000
jb 0x40cf5e
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x40d29f
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
pop ecx
test eax, eax
je 0x40cf70
lea esi, [eax + 0x23]
and esi, 0xffffffe0
mov dword [esi - 4], eax
mov ecx, dword [ebp - 0x370]
push ecx
lea eax, [esi + ecx]
mov dword [ebp - 0x378], eax
xor eax, eax
push eax
push esi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x370]
xor eax, eax
mov dword [ebp - 0x370], eax
call fcn.0040d95a
push esi
lea eax, [ebp - 0x36c]
push eax
call dword [ebp - 0x380]
test eax, eax
je 0x40cf76
lea eax, [ebp - 0x28]
mov ecx, edi
push eax
call fcn.0040deab
mov ebx, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test esi, esi
je 0x40cf24
mov eax, dword [ebp - 0x378]
sub eax, esi
cmp eax, 0x1000
jb 0x40cf20
mov ecx, dword [esi - 4]
sub esi, ecx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x40cdf6
mov esi, ecx
push esi
call ebx
pop ecx
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x40cf54
mov ecx, dword [ebp - 0x28]
lea eax, [eax*2 + 2]
mov edx, ecx
cmp eax, 0x1000
jb 0x40cf50
mov ecx, dword [edx - 4]
sub edx, ecx
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x40cdf6
push ecx
call ebx
pop ecx
xor eax, eax
mov dword [ebp - 0x18], eax
jmp 0x40ce07
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
pop ecx
test esi, esi
jne 0x40cea4
call dword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xbad_alloc_void_]
xor ecx, ecx
lea eax, [ebp - 0x374]
push eax
push ecx
push ecx
push 0x4363dc
mov dword [ebp - 0x374], ecx
call dword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
test eax, eax
js 0x40d23b
mov eax, dword [esi + 0x1c]
lea ecx, [ebp - 0x88]
mov dword [ebp - 0x370], eax
xor eax, eax
push 1
push 0x438ae0
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x74], 7
call fcn.0040a802
mov eax, dword [esi + 0x10]
lea ecx, [ebp - 0x70]
mov dword [ebp - 0x380], eax
xor eax, eax
push 0x17
push 0x438ae4
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], 7
call fcn.0040a802
mov ecx, dword [ebp - 0x374]
xor eax, eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], 7
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x388]
jne 0x40d006
sub ecx, edx
sar ecx, 1
push ecx
push dword [ebp - 0x374]
lea ecx, [ebp - 0x58]
call fcn.0040a802
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0x384]
lea ecx, [ebp - 0x118]
call fcn.0040d97d
push dword [ebp - 0x380]
lea ecx, [ebp - 0x118]
call fcn.0040a735
push eax
lea ecx, [ebp - 0x100]
call fcn.0040deab
lea eax, [ebp - 0x88]
push eax
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 0x384]
lea ecx, [ebp - 0xe8]
call fcn.0040d97d
push dword [ebp - 0x370]
lea ecx, [ebp - 0xe8]
call fcn.0040a735
push eax
lea ecx, [ebp - 0xd0]
call fcn.0040deab
push 0x4377b4
lea ecx, [ebp - 0xd0]
call fcn.0040a735
push eax
lea ecx, [ebp - 0xb8]
call fcn.0040deab
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
push dword [ebp - 0x30]
cmovae eax, dword [ebp - 0x40]
lea ecx, [ebp - 0xb8]
push eax
call fcn.0040a6d7
push eax
lea ecx, [ebp - 0xa0]
call fcn.0040deab
lea eax, [ebp - 0xa0]
push eax
lea ecx, [ebp - 0x28]
call fcn.0040de74
lea ecx, [ebp - 0xa0]
call fcn.0040a89a
lea ecx, [ebp - 0xb8]
call fcn.0040a89a
lea ecx, [ebp - 0xd0]
call fcn.0040a89a
lea ecx, [ebp - 0xe8]
call fcn.0040a89a
lea ecx, [ebp - 0x100]
call fcn.0040a89a
lea ecx, [ebp - 0x118]
call fcn.0040a89a
lea ecx, [ebp - 0x58]
call fcn.0040a89a
lea ecx, [ebp - 0x70]
call fcn.0040a89a
lea ecx, [ebp - 0x88]
call fcn.0040a89a
push dword [ebp - 0x374]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
cmp dword [ebp - 0x14], 8
lea ecx, [ebp - 0x368]
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
jne 0x40d1e4
mov eax, dword [ebp - 0x378]
xor ebx, ebx
sub eax, esi
mov dword [edi], ebx
mov dword [edi + 0x10], ebx
mov dword [edi + 0x14], 7
cmp eax, 0x1000
jb 0x40d1a2
mov ecx, dword [esi - 4]
sub esi, ecx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x40cdf6
mov esi, ecx
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
mov eax, dword [ebp - 0x14]
pop ecx
cmp eax, 8
jb 0x40d1dc
mov ecx, dword [ebp - 0x28]
lea eax, [eax*2 + 2]
mov edx, ecx
cmp eax, 0x1000
jb 0x40d1d8
mov ecx, dword [edx - 4]
sub edx, ecx
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x40cdf6
push ecx
call esi
pop ecx
mov dword [ebp - 0x18], ebx
jmp 0x40ce07
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebx + 0x14], 8
mov ecx, ebx
jb 0x40d1f5
mov ecx, dword [ebx]
mov edx, dword [ebx + 0x10]
push 1
push ecx
push ecx
call fcn.0040d869
cmp eax, 0xffffffff
je 0x40d20a
test eax, eax
je 0x40d23b
push 1
push 0x437764
xor eax, eax
mov ecx, ebx
push eax
call fcn.0040d728
mov edx, dword [ebp - 0x384]
mov ecx, ebx
mov eax, dword [ebp - 0x37c]
add edx, 5
push 2
push 0x4379d8
add eax, edx
push eax
call fcn.0040d728
test esi, esi
je 0x40d269
mov eax, dword [ebp - 0x378]
sub eax, esi
cmp eax, 0x1000
jb 0x40d261
mov ecx, dword [esi - 4]
sub esi, ecx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x40cdf6
mov esi, ecx
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
pop ecx
xor esi, esi
jmp 0x40cdc3
xor ecx, ecx
mov dword [edi + 0x14], 7
mov dword [edi + 0x10], ecx
mov dword [edi], ecx
mov eax, edi
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.0043182e
leave
ret
call fcn.0040db50
call fcn.0040aa36
int3