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

Disassembly:
push 0xffffffffffffffff
push 0x45db97
mov eax, dword fs:[0]
push eax
sub esp, 0x820
mov eax, dword [0x491104]
xor eax, esp
mov dword [esp + 0x81c], eax
push ebx
mov eax, dword [0x491104]
xor eax, esp
push eax
lea eax, [esp + 0x828]
mov dword fs:[0], eax
xor ebx, ebx
lea ecx, [esp + 8]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x1c], 0x400
mov dword [esp + 0x18], ebx
call fcn.00406fc0
mov dword [esp + 0x830], ebx
mov edx, dword [esp + 8]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x104
or eax, ecx
jge 0x40d2b4
push 0x104
lea ecx, [esp + 0xc]
call fcn.00406c20
mov edx, dword [esp + 8]
push edx
push ebx
push ebx
push 0x29
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esp + 8]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00442d0b
add esp, 8
cmp eax, ebx
jl 0x40d459
mov ecx, dword [esp + 8]
cmp eax, dword [ecx - 8]
jg 0x40d459
mov dword [ecx - 0xc], eax
mov edx, dword [esp + 8]
xor ecx, ecx
mov word [edx + eax*2], cx
lea eax, [esp + 0xc]
push eax
push 0x2001f
push ebx
push str.SystemCurrentControlSetControlSession_ManagerEnvironment
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40d43e
lea ecx, [esp + 0x1c]
push ecx
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x20]
push eax
push ebx
push str.HL_LICENSEDIR
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x40d463
mov edx, dword [esp + 8]
mov eax, dword [edx - 8]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x105
or eax, ecx
jge 0x40d368
push 0x105
lea ecx, [esp + 0xc]
call fcn.00406c20
mov edx, dword [esp + 8]
push edx
lea edx, [esp + 0x24]
push 0x105
push edx
call fcn.004438af
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.00442d0b
add esp, 0x14
cmp eax, ebx
jl 0x40d459
mov ecx, dword [esp + 8]
cmp eax, dword [ecx - 8]
jg 0x40d459
mov dword [ecx - 0xc], eax
mov edx, dword [esp + 8]
xor ecx, ecx
mov word [edx + eax*2], cx
lea eax, [esp + 0x20]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d3b2
sub eax, edx
mov edx, dword [esp + 0xc]
sar eax, 1
add eax, eax
push eax
lea ecx, [esp + 0x24]
push ecx
push 1
push ebx
push str.HL_LICENSEDIR
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x40d463
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x14]
call fcn.00406e00
mov byte [esp + 0x830], 1
push eax
lea ecx, [esp + 0x18]
push str.setting_HL_LICENSEDIR:_error_while_setting_to:
push ecx
call fcn.00406220
add esp, 0xc
mov byte [esp + 0x830], 2
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x830], 1
lea ecx, [esp + 0x14]
call fcn.00406ed0
mov byte [esp + 0x830], bl
lea ecx, [esp + 0x10]
call fcn.00406ed0
mov dword [esp + 0x830], 0xffffffff
lea ecx, [esp + 8]
call fcn.00406ed0
xor al, al
jmp 0x40d4f5
push 0x80070057
call fcn.00406f30
mov edx, dword [esp + 0xc]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push str.Environment
push ebx
push 0x1a
push 0xffff
mov dword [esp + 0x1c], ebx
call dword [sym.imp.USER32.dll_SendMessageW]
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x18]
call fcn.00406e00
mov byte [esp + 0x830], 3
push eax
lea ecx, [esp + 0x14]
push str.setting_HL_LICENSEDIR:
push ecx
call fcn.00406220
add esp, 0xc
mov byte [esp + 0x830], 4
push eax
mov ecx, esi
call fcn.00411500
mov byte [esp + 0x830], 3
lea ecx, [esp + 0x10]
call fcn.00406ed0
mov byte [esp + 0x830], bl
lea ecx, [esp + 0x14]
call fcn.00406ed0
mov dword [esp + 0x830], 0xffffffff
lea ecx, [esp + 8]
call fcn.00406ed0
mov al, 1
mov ecx, dword [esp + 0x828]
mov dword fs:[0], ecx
pop ecx
pop ebx
mov ecx, dword [esp + 0x81c]
xor ecx, esp
call fcn.00442851
add esp, 0x82c
ret