Function at 0x4039c0
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff98
push esi
push edi
mov dword [ebp - 0x30], eax
mov eax, 0x5296e8
call fcn.00519d2c
xor edx, edx
mov dword [ebp - 0x34], edx
lea ecx, [ebp - 0x34]
push ecx
push 0xf003f
push 0
push str.SYSTEMCurrentControlSetControlSession_ManagerEnvironment
push SysReAllocStringLen
call sub.ADVAPI32.DLL_RegOpenKeyExW
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x403a0e
xor eax, eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
jmp 0x403c16
mov dword [ebp - 0x3c], 2
xor ecx, ecx
mov dword [ebp - 0x40], ecx
lea eax, [ebp - 0x40]
push eax
push 0
lea edx, [ebp - 0x3c]
push edx
push 0
push 0x528dda
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegQueryValueExW
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x403a55
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegCloseKey
xor eax, eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
jmp 0x403c16
add dword [ebp - 0x40], 2
mov word [ebp - 0x1c], 0xc
lea eax, [ebp - 4]
mov edx, dword [ebp - 0x40]
call fcn.00403c1c
inc dword [ebp - 0x10]
mov word [ebp - 0x1c], 0x18
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x44], ecx
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x48], eax
lea edx, [ebp - 0x48]
push edx
push dword [ebp - 0x44]
lea ecx, [ebp - 0x3c]
push ecx
push 0
push 0x528de4
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegQueryValueExW
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x403acd
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegCloseKey
xor eax, eax
push eax
dec dword [ebp - 0x10]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00403c60
pop eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
jmp 0x403c16
add dword [ebp - 0x40], 0x208
mov word [ebp - 0x1c], 0x24
lea eax, [ebp - 8]
mov edx, dword [ebp - 0x40]
call fcn.00403c1c
inc dword [ebp - 0x10]
mov word [ebp - 0x1c], 0x18
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x4c], ecx
push dword [ebp - 0x40]
push 0
push dword [ebp - 8]
call fcn.0051960f
add esp, 0xc
push dword [ebp - 0x30]
push 0x104
push dword [ebp - 0x4c]
call fcn.00519ad0
add esp, 0xc
push 0x528dee
push 0x104
push dword [ebp - 0x4c]
call fcn.00519b98
add esp, 0xc
push dword [ebp - 0x4c]
push dword [ebp - 0x44]
call fcn.00519cb4
add esp, 8
test eax, eax
je 0x403b7c
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegCloseKey
mov eax, 1
push eax
dec dword [ebp - 0x10]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00403c60
dec dword [ebp - 0x10]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00403c60
pop eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
jmp 0x403c16
push dword [ebp - 0x44]
mov ecx, dword [ebp - 0x40]
shr ecx, 1
push ecx
push dword [ebp - 0x4c]
call fcn.00519b98
add esp, 0xc
push dword [ebp - 0x40]
push dword [ebp - 0x4c]
push dword [ebp - 0x3c]
push 0
push str.Path
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegSetValueExW
mov dword [ebp - 0x38], eax
push dword [ebp - 0x34]
call sub.ADVAPI32.DLL_RegCloseKey
cmp dword [ebp - 0x38], 0
sete al
and eax, 1
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
je 0x403be7
mov esi, str.Environment
lea edi, [ebp - 0x68]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x68]
push eax
push 0
push 0x1a
push 0xffff
call sub.USER32.DLL_SendMessageW
mov eax, dword [ebp - 0x50]
push eax
dec dword [ebp - 0x10]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00403c60
dec dword [ebp - 0x10]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00403c60
pop eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
pop edi
pop esi
mov esp, ebp
pop ebp
ret