Function at 0x40a710
Capabilities:
Get common file path
Get file attributes
Get program files directory
Query environment variable
Query or enumerate registry value

Disassembly:
push 0xffffffffffffffff
push 0x4721b2
mov eax, dword fs:[0]
push eax
sub esp, 0x22c
mov eax, dword [0x48dd78]
xor eax, esp
mov dword [esp + 0x228], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x48dd78]
xor eax, esp
push eax
lea eax, [esp + 0x240]
mov dword fs:[0], eax
mov ebp, ecx
mov ecx, dword [esp + 0x250]
xor esi, esi
push 0x475570
mov dword [esp + 0x24c], esi
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x30], esi
call fcn.004056c0
push 0x206
lea ecx, [esp + 0x3a]
xor eax, eax
push esi
push ecx
mov dword [esp + 0x254], esi
mov dword [esp + 0x38], 1
mov word [esp + 0x40], ax
call fcn.0043e9f0
mov eax, dword [ebp + 0x4c]
mov ebx, dword [eax]
mov edi, dword [ebp + 0x38]
add esp, 0xc
mov dword [esp + 0x20], ebx
mov dword [esp + 0x1c], edi
lea esp, [esp]
mov esi, dword [ebp + 0x4c]
mov eax, dword [ebp + 0x38]
test edi, edi
je 0x40a7be
cmp edi, eax
je 0x40a7c3
call fcn.004405b3
cmp ebx, esi
je 0x40aa3a
mov dword [esp + 0x14], 0
test edi, edi
jne 0x40a89a
call fcn.004405b3
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x40a7ec
call fcn.004405b3
lea edx, [esp + 0x14]
push edx
push 1
push 0
lea esi, [ebx + 8]
push esi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp dword [esp + 0x14], 0
je 0x40a87e
xor eax, eax
mov dword [esp + 0x30], 1
mov dword [esp + 0x24], 0x208
mov word [esp + 0x34], ax
test edi, edi
jne 0x40a8a1
call fcn.004405b3
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x40a837
call fcn.004405b3
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x38]
push eax
push 0
add esi, 0x208
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp word [esp + 0x34], 0
je 0x40a87e
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
test esi, esi
jne 0x40a8a9
test edi, edi
jne 0x40a8a5
call fcn.004405b3
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x40a893
call fcn.004405b3
mov ebx, dword [ebx]
jmp 0x40a7b0
mov eax, dword [edi]
jmp 0x40a7e2
mov eax, dword [edi]
jmp 0x40a82d
mov eax, dword [edi]
jmp 0x40a889
push 4
lea ecx, [esp + 0x38]
push 0x475b28
push ecx
mov dword [esp + 0x2c], ebx
call fcn.004405ce
add esp, 0xc
test eax, eax
je 0x40a8dd
push 4
lea edx, [esp + 0x38]
push 0x475b1c
push edx
call fcn.004405ce
add esp, 0xc
test eax, eax
jne 0x40a912
cmp word [esp + 0x3c], 0
lea ecx, [esp + 0x34]
je 0x40a90d
lea eax, [esp + 0x3c]
lea ecx, [ecx]
mov dx, word [eax]
mov word [ecx], dx
add eax, 2
lea edx, [esp + 0x23a]
add ecx, 2
cmp eax, edx
jae 0x40a90d
cmp word [eax], 0
jne 0x40a8f0
xor eax, eax
mov word [ecx], ax
lea ecx, [esp + 0x34]
push 0x5c
push ecx
call fcn.00440255
add esp, 8
mov ebp, eax
test esi, 0x10
jne 0x40a948
mov ecx, dword [esp + 0x18]
xor edx, edx
mov word [ebp], dx
lea edx, [esp + 0x34]
push edx
call fcn.00405030
mov ebp, dword [esp + 0x28]
jmp 0x40aa3e
test edi, edi
jne 0x40a9fb
call fcn.004405b3
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x40a961
call fcn.004405b3
cmp word [ebx + 0x418], 0
lea esi, [ebx + 0x418]
je 0x40aa26
test edi, edi
jne 0x40aa02
call fcn.004405b3
cmp ebx, dword [edi + 0x14]
jne 0x40a98c
call fcn.004405b3
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a991
sub eax, edx
sar eax, 1
mov esi, eax
lea eax, [esp + 0x34]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a9b0
sub eax, edx
sar eax, 1
cmp eax, esi
jb 0x40aa09
lea ecx, [esp + 0x1c]
call fcn.00409930
add eax, 0x410
push eax
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
je 0x40aa09
xor ecx, ecx
lea edx, [esp + 0x34]
mov word [eax + esi*2], cx
mov ecx, dword [esp + 0x18]
push edx
call fcn.00405030
mov ebp, dword [esp + 0x28]
jmp 0x40aa3e
mov eax, dword [edi]
jmp 0x40a957
mov edi, dword [edi]
jmp 0x40a982
inc esi
push esi
lea ecx, [esp + 0x20]
call fcn.00409930
add eax, 0x410
push eax
add ebp, 2
push ebp
call fcn.0043fecb
add esp, 0xc
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x34]
push edx
call fcn.00405030
mov ebp, dword [esp + 0x28]
jmp 0x40aa3e
mov dword [esp + 0x20], ebx
mov ebx, dword [esp + 0x18]
mov eax, dword [ebx]
cmp dword [eax - 8], 0
jne 0x40ab6f
xor ecx, ecx
mov word [esp + 0x34], cx
call fcn.004075a0
test eax, eax
je 0x40aa6f
push 0x104
lea edx, [esp + 0x38]
push edx
push str._ProgramW6432_
jmp 0x40aac6
lea eax, [esp + 0x14]
push eax
push 0x26
push 0
mov dword [esp + 0x20], 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x40aaae
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x34]
push ecx
push edx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
test eax, eax
jne 0x40aaa3
mov word [esp + 0x34], ax
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
xor edx, edx
cmp dx, word [esp + 0x34]
jne 0x40aacc
push 0x104
lea eax, [esp + 0x38]
push eax
push 0x475adc
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 1
lea ecx, [esp + 0x38]
push 0x475814
push ecx
call fcn.0043fbc9
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax - 8]
push ecx
push eax
lea edx, [esp + 0x48]
push edx
call fcn.0043fbc9
add esp, 0x18
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
mov eax, dword [ebx]
cmp dword [eax - 0xc], 1
lea ecx, [eax - 0xc]
jg 0x40ab0f
cmp esi, dword [eax - 4]
jle 0x40ab47
add eax, 0xfffffff4
cmp eax, dword [0x48d12c]
je 0x40ab3b
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40ab33
mov eax, dword [ebx]
sub eax, 0xc
push eax
call fcn.0043f1b9
add esp, 4
mov ecx, dword [0x48d130]
mov dword [ebx], ecx
push esi
mov ecx, ebx
call fcn.00403870
test eax, eax
je 0x40ab6f
mov eax, dword [ebx]
lea edi, [esi + esi]
lea edx, [edi + 2]
cmp edx, edi
jb 0x40ab62
push edi
lea ecx, [esp + 0x38]
push ecx
push eax
call fcn.0043ea70
add esp, 0xc
mov edx, dword [ebx]
mov dword [edx - 8], esi
mov eax, dword [ebx]
xor ecx, ecx
mov word [edi + eax], cx
mov eax, ebx
mov ecx, dword [esp + 0x240]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x228]
xor ecx, esp
call fcn.0043e9e1
add esp, 0x238
ret 4