Function at 0x40b720
Capabilities:
Get common file path
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x278
mov eax, dword [0x441070]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov edi, edx
mov dword [ebp - 0x274], ecx
test edi, edi
jne 0x40b754
mov eax, 0x80070057
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00410abf
mov esp, ebp
pop ebp
ret
push esi
push 0x104
push edi
call fcn.0040dd10
mov esi, eax
test esi, esi
js 0x40b997
mov eax, dword [edi]
xor esi, esi
push ebx
mov dword [ebp - 0x264], eax
call fcn.0040eb50
mov ebx, eax
test ebx, ebx
je 0x40b884
mov ecx, ebx
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b790
sub ecx, edx
sar ecx, 1
je 0x40b884
push ebx
lea eax, [ebp - 0x268]
mov dword [ebp - 0x268], esi
push 0x43cd70
push eax
call fcn.0040de80
push 0x208
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x260], esi
push 0
push eax
call fcn.00412cb0
add esp, 0x18
mov dword [ebp - 0x26c], 0x206
lea eax, [ebp - 0x260]
mov dword [ebp - 0x270], 1
push eax
push 0x20019
push 0
push dword [ebp - 0x268]
push 0x80000003
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40b87b
lea eax, [ebp - 0x26c]
push eax
lea eax, [ebp - 0x25c]
push eax
lea eax, [ebp - 0x270]
push eax
push 0
push 0x43cdf8
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40b86f
lea eax, [ebp - 0x25c]
push eax
lea eax, [ebp - 0x264]
push str._sTemp
push eax
call fcn.0040de80
mov esi, dword [ebp - 0x264]
add esp, 0xc
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40b860
sub esi, ecx
sar esi, 1
push dword [ebp - 0x260]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x40b897
push dword [ebp - 0x264]
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x40b8a3
cmp esi, 0x104
jb 0x40b8b2
push dword [edi]
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x40b967
cmp esi, 0x104
jae 0x40b967
push 0
push 0x43c844
push edi
call fcn.0040dd70
mov esi, eax
test esi, esi
js 0x40b996
mov ebx, dword [ebp - 0x274]
lea eax, [ebp - 0x54]
push 0x27
push eax
lea eax, [ebx + 0x8c]
push eax
call dword [sym.imp.ole32.dll_StringFromGUID2]
mov esi, eax
test esi, esi
js 0x40b996
push 0
lea eax, [ebp - 0x54]
push eax
push edi
call fcn.0040dd70
mov esi, eax
test esi, esi
js 0x40b996
push 0
push 0x43c844
push edi
call fcn.0040dd70
mov esi, eax
test esi, esi
js 0x40b996
push 0
push dword [edi]
call fcn.0040ea30
mov esi, eax
test esi, esi
js 0x40b996
push 0
lea eax, [ebx + 0xc]
push eax
push edi
call fcn.0040dd70
mov esi, eax
test esi, esi
js 0x40b996
push 2
push dword [edi]
push ebx
call fcn.0040e090
pop ebx
mov esi, eax
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00410abf
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40b97c
movzx esi, si
or esi, 0x80070000
test esi, esi
mov eax, 0x80004005
cmovns esi, eax
push esi
push 0x1ff
push str.c:_buildagentwork_ff5fabc9ec27ac7d_setupexe_setupexe.cpp
call fcn.0040eb40
pop ebx
mov ecx, dword [ebp - 4]
mov eax, esi
pop esi
xor ecx, ebp
pop edi
call fcn.00410abf
mov esp, ebp
pop ebp
ret