Function at 0x40d110
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x42000c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x7cf
push 0x420050
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40d5e7
mov esi, 0x420050
lea ecx, [esi + 2]
nop dword [eax + eax]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40d150
sub esi, ecx
mov ecx, dword [0x421fac]
sar esi, 1
mov dword [ebp - 0x214], ecx
cmp esi, ecx
ja 0x40d1a0
cmp ecx, 8
mov dword [0x421fa8], esi
mov edi, 0x421f98
cmovae edi, dword [0x421f98]
add esi, esi
push esi
push 0x420050
push edi
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
xor eax, eax
mov word [esi + edi], ax
jmp 0x40d2a1
cmp esi, 0x7ffffffe
ja 0x40d5fa
mov ebx, esi
or ebx, 7
cmp ebx, 0x7ffffffe
jbe 0x40d1c5
mov ebx, SysReAllocString
mov eax, 0xfffffffe
jmp 0x40d1ff
mov edx, ecx
mov eax, SysReAllocString
shr edx, 1
sub eax, edx
cmp ecx, eax
jbe 0x40d1e0
mov ebx, SysReAllocString
mov eax, 0xfffffffe
jmp 0x40d1ff
lea eax, [edx + ecx]
cmp ebx, eax
cmovb ebx, eax
lea eax, [ebx + 1]
cmp eax, 0x7fffffff
ja 0x40d5ff
add eax, eax
cmp eax, 0x1000
jb 0x40d226
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x40d5ff
push ecx
call fcn.00410ea3
add esp, 4
test eax, eax
je 0x40d470
lea edi, [eax + 0x23]
and edi, 0xffffffe0
mov dword [edi - 4], eax
jmp 0x40d239
test eax, eax
je 0x40d237
push eax
call fcn.00410ea3
add esp, 4
mov edi, eax
jmp 0x40d239
xor edi, edi
mov dword [0x421fa8], esi
add esi, esi
push esi
push 0x420050
push edi
mov dword [0x421fac], ebx
call sub.VCRUNTIME140.dll_memcpy
xor eax, eax
add esp, 0xc
mov word [esi + edi], ax
mov eax, dword [ebp - 0x214]
cmp eax, 8
jb 0x40d29b
lea ecx, [eax*2 + 2]
mov eax, dword [0x421f98]
cmp ecx, 0x1000
jb 0x40d291
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d470
mov eax, edx
push ecx
push eax
call fcn.00411124
add esp, 8
mov dword [0x421f98], edi
mov edx, 0x5c
mov eax, 0x420fee
lea ebx, [edx - 0x2d]
nop
movzx ecx, word [eax]
cmp dx, cx
je 0x40d2bd
cmp bx, cx
jne 0x40d2c4
cmp eax, 0x420fee
jne 0x40d2d0
sub eax, 2
cmp eax, 0x420050
jae 0x40d2b0
jmp 0x40d2e7
sub eax, 0x420050
sar eax, 1
je 0x40d2e7
lea ecx, [eax*2 + 0x420052]
cmp eax, 0x7cf
jb 0x40d2ec
mov ecx, 0x420050
mov esi, ecx
mov dword [ebp - 0x214], ecx
lea edx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40d2f7
mov eax, dword [0x421fc4]
sub esi, edx
sar esi, 1
mov dword [ebp - 0x218], eax
cmp esi, eax
ja 0x40d342
cmp eax, 8
mov dword [0x421fc0], esi
mov edi, 0x421fb0
cmovae edi, dword [0x421fb0]
add esi, esi
push esi
push ecx
push edi
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
xor eax, eax
mov word [esi + edi], ax
jmp 0x40d444
cmp esi, 0x7ffffffe
ja 0x40d5fa
mov ebx, esi
or ebx, 7
cmp ebx, 0x7ffffffe
jbe 0x40d367
mov ebx, SysReAllocString
mov eax, 0xfffffffe
jmp 0x40d3a0
mov ecx, eax
mov edx, SysReAllocString
shr ecx, 1
sub edx, ecx
cmp eax, edx
jbe 0x40d382
mov ebx, SysReAllocString
mov eax, 0xfffffffe
jmp 0x40d3a0
add eax, ecx
cmp ebx, eax
cmovb ebx, eax
lea eax, [ebx + 1]
cmp eax, 0x7fffffff
ja 0x40d5ff
add eax, eax
cmp eax, 0x1000
jb 0x40d3c7
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x40d5ff
push ecx
call fcn.00410ea3
add esp, 4
test eax, eax
je 0x40d470
lea edi, [eax + 0x23]
and edi, 0xffffffe0
mov dword [edi - 4], eax
jmp 0x40d3da
test eax, eax
je 0x40d3d8
push eax
call fcn.00410ea3
add esp, 4
mov edi, eax
jmp 0x40d3da
xor edi, edi
mov dword [0x421fc0], esi
add esi, esi
push esi
push dword [ebp - 0x214]
mov dword [0x421fc4], ebx
push edi
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [ebp - 0x218]
xor eax, eax
add esp, 0xc
mov word [esi + edi], ax
cmp ecx, 8
jb 0x40d439
mov eax, dword [0x421fb0]
lea ecx, [ecx*2 + 2]
cmp ecx, 0x1000
jb 0x40d42f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40d470
mov eax, edx
push ecx
push eax
call fcn.00411124
add esp, 8
mov ebx, 0x2f
mov dword [0x421fb0], edi
mov eax, 0x420fee
mov edx, 0x5c
nop
movzx ecx, word [eax]
cmp dx, cx
je 0x40d45d
cmp bx, cx
jne 0x40d464
cmp eax, 0x420fee
jne 0x40d476
sub eax, 2
cmp eax, 0x420050
jae 0x40d450
jmp 0x40d490
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
sub eax, 0x420050
sar eax, 1
je 0x40d490
cmp eax, 0x7cf
jae 0x40d490
xor ecx, ecx
mov word [eax*2 + 0x420052], cx
push 0
push 0x1a
push 0x420ff0
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4b3
push ecx
mov ecx, 0x420ff0
call fcn.00410de0
add esp, 4
push 4
push 0
mov dword [ebp - 0x218], 0x24
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x421f94], eax
test eax, eax
je 0x40d5e7
mov dword [eax], 0
xor esi, esi
push 0x20c
lea eax, [ebp - 0x210]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov edi, dword [ebp + esi - 0x218]
lea eax, [ebp - 0x210]
add esp, 0xc
push 0
push edi
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
jne 0x40d539
cmp edi, 0x24
jne 0x40d5e2
push 0x104
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40d5e2
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40d542
sub ecx, edx
sar ecx, 1
cmp word [ebp + ecx*2 - 0x212], 0x5c
je 0x40d56a
mov eax, 0x5c
mov word [ebp + ecx*2 - 0x210], ax
inc ecx
lea edi, [ecx + ecx]
lea ebx, [edi + 2]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [0x421f94]
mov dword [esi + ecx], eax
mov eax, dword [0x421f94]
mov eax, dword [esi + eax]
test eax, eax
je 0x40d5e2
push ebx
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push edi
lea eax, [ebp - 0x210]
push eax
mov eax, dword [0x421f94]
push dword [esi + eax]
call sub.VCRUNTIME140.dll_memcpy
add esi, 4
add esp, 0x18
cmp esi, 4
jb 0x40d4e3
pop edi
pop esi
mov dword [0x421f90], 1
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00410e60
mov esp, ebp
pop ebp
ret
call fcn.0040d0a0
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00410e60
mov esp, ebp
pop ebp
ret
call fcn.0040185b
call fcn.004017fa
int3