Function at 0x401989
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41250f
mov eax, dword fs:[0]
push eax
sub esp, 0x38
push ebx
push esi
push edi
mov eax, dword [0x415008]
xor eax, esp
push eax
lea eax, [esp + 0x48]
mov dword fs:[0], eax
mov eax, ecx
mov dword [esp + 0x10], eax
xor ecx, ecx
mov ebx, ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x50], 2
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], ecx
mov byte [esp + 0x50], 5
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], ecx
mov byte [esp + 0x50], 8
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
mov byte [esp + 0x50], 0xc
test byte [ebp + 8], 1
je 0x401a89
mov ecx, eax
call fcn.00401f6e
mov esi, eax
cmp dword [esp + 0x28], ebx
jne 0x403fff
xor ecx, ecx
mov dword [esp + 0x24], esi
test esi, esi
je 0x4022b8
mov dword [esp + 0x28], 1
cmp word [esi], cx
je 0x404017
mov dword [esp + 0x28], ecx
mov byte [esp + 0x50], 8
lea ecx, [esp + 0x24]
call fcn.00407dc8
mov byte [esp + 0x50], 5
lea ecx, [esp + 0x3c]
call fcn.00401964
mov byte [esp + 0x50], 2
lea ecx, [esp + 0x2c]
call fcn.00401964
or dword [esp + 0x50], 0xffffffff
lea ecx, [esp + 0x34]
call fcn.00401964
mov eax, esi
mov ecx, dword [esp + 0x48]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [esp + 0x24]
jmp 0x4022bc
mov esi, dword [esp + 0x24]
jmp 0x401a3a
mov eax, dword [esp + 0x10]
test byte [ebp + 8], 0xe
je 0x401a3a
cmp dword [ebp + 0xc], 0
je 0x4022db
mov ecx, eax
call fcn.004010a7
test eax, eax
je 0x401a3a
test byte [ebp + 8], 2
je 0x40239a
mov edi, dword [0x41502c]
xor esi, esi
cmp edi, 0xffffffff
jne 0x40402e
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x38]
call fcn.00402281
mov byte [esp + 0x50], 0x28
xor ebx, ebx
inc ebx
mov dword [esp + 0x18], ebx
push dword [eax]
push 0x20019
push 0
push 0x402470
push SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4041c9
mov cl, 1
mov dword [esp + 0x50], 0xc
test bl, 1
je 0x40235c
and ebx, 0xfffffffe
mov dword [esp + 0x18], ebx
mov byte [esp + 0x50], 0xc
mov eax, dword [esp + 0x20]
cmp dword [eax], 0
je 0x40235c
mov dword [eax + 4], 1
test cl, cl
je 0x40239a
lea eax, [esp + 0x14]
xor edi, edi
push eax
push edi
lea eax, [esp + 0x24]
push eax
push edi
push dword [esp + 0x20]
push dword [esp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x40405e
neg esi
sbb esi, esi
not esi
and esi, dword [esp + 0x38]
mov dword [esp + 0x38], esi
test edi, edi
jne 0x401a92
test byte [ebp + 8], 4
je 0x402459
mov edi, dword [0x415030]
xor esi, esi
cmp edi, 0xffffffff
jne 0x4040ca
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x30]
call fcn.00402281
mov byte [esp + 0x50], 0x33
or ebx, 2
mov dword [esp + 0x18], ebx
push dword [eax]
push 0x20019
push 0
push 0x402470
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4041d0
mov cl, 1
mov dword [esp + 0x50], 0xc
test bl, 2
je 0x40241b
and ebx, 0xfffffffd
mov dword [esp + 0x18], ebx
mov byte [esp + 0x50], 0xc
mov eax, dword [esp + 0x20]
cmp dword [eax], 0
je 0x40241b
mov dword [eax + 4], 1
test cl, cl
je 0x402459
lea eax, [esp + 0x14]
xor edi, edi
push eax
push edi
lea eax, [esp + 0x24]
push eax
push edi
push dword [esp + 0x20]
push dword [esp + 0x40]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x4040fa
neg esi
sbb esi, esi
not esi
and esi, dword [esp + 0x30]
mov dword [esp + 0x30], esi
test edi, edi
jne 0x401a92
test byte [ebp + 8], 8
jne 0x404166
xor esi, esi
jmp 0x401a3a
mov edx, dword [esp + 0x24]
test edx, edx
je 0x40400c
call fcn.00402093
xor ecx, ecx
mov dword [esp + 0x28], ecx
jmp 0x401a19
mov edx, esi
call fcn.00402093
and dword [esp + 0x28], 0
xor esi, esi
mov dword [esp + 0x24], esi
jmp 0x4022b8
inc esi
cmp dword [esp + 0x38], 0
je 0x404045
push dword [esp + 0x34]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
and dword [esp + 0x38], 0
mov dword [esp + 0x34], edi
test edi, edi
je 0x402331
mov dword [esp + 0x38], 1
jmp 0x402331
cmp dword [esp + 0x1c], 1
jne 0x402384
mov ecx, dword [esp + 0x14]
call fcn.004024e5
mov edi, eax
cmp dword [esp + 0x28], 0
je 0x40408d
mov edx, dword [esp + 0x24]
test edx, edx
je 0x404088
call fcn.00402093
and dword [esp + 0x28], 0
mov dword [esp + 0x24], edi
test edi, edi
je 0x4040c2
xor eax, eax
mov dword [esp + 0x28], 1
mov word [edi], ax
lea eax, [esp + 0x14]
push eax
push dword [esp + 0x28]
push 0
push 0
push dword [esp + 0x20]
push dword [esp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
and dword [esp + 0x28], 0
xor edi, edi
inc edi
jmp 0x402384
inc esi
cmp dword [esp + 0x30], 0
je 0x4040e1
push dword [esp + 0x2c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
and dword [esp + 0x30], 0
mov dword [esp + 0x2c], edi
test edi, edi
je 0x4023f0
mov dword [esp + 0x30], 1
jmp 0x4023f0
cmp dword [esp + 0x1c], 1
jne 0x402443
mov ecx, dword [esp + 0x14]
call fcn.004024e5
mov edi, eax
cmp dword [esp + 0x28], 0
je 0x404129
mov edx, dword [esp + 0x24]
test edx, edx
je 0x404124
call fcn.00402093
and dword [esp + 0x28], 0
mov dword [esp + 0x24], edi
test edi, edi
je 0x40415e
xor eax, eax
mov dword [esp + 0x28], 1
mov word [edi], ax
lea eax, [esp + 0x14]
push eax
push dword [esp + 0x28]
push 0
push 0
push dword [esp + 0x20]
push dword [esp + 0x40]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
and dword [esp + 0x28], 0
xor edi, edi
inc edi
jmp 0x402443
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x40]
call fcn.00402281
mov byte [esp + 0x50], 0x37
or ebx, 4
mov dword [esp + 0x18], ebx
push dword [eax]
push 0x20019
push 0
push 0x40425c
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov edi, dword [esp + 0x10]
test eax, eax
jne 0x4041d7
lea eax, [esp + 0x14]
push eax
push 0
lea eax, [esp + 0x24]
push eax
push 0
push edi
push dword [esp + 0x50]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4041d7
cmp dword [esp + 0x1c], 1
jne 0x4041d7
mov dl, 1
jmp 0x4041d9
xor cl, cl
jmp 0x402333
xor cl, cl
jmp 0x4023f2
xor dl, dl
mov dword [esp + 0x50], 0xc
test bl, 4
je 0x4041f6
and ebx, 0xfffffffb
lea ecx, [esp + 0x20]
mov dword [esp + 0x18], ebx
call fcn.004057a6
test dl, dl
je 0x402463
mov ecx, dword [esp + 0x14]
call fcn.004024e5
mov esi, eax
cmp dword [esp + 0x28], 0
je 0x40421e
mov ecx, dword [esp + 0x24]
call fcn.00408058
and dword [esp + 0x28], 0
mov dword [esp + 0x24], esi
test esi, esi
je 0x402463
mov dword [esp + 0x28], 1
xor eax, eax
mov word [esi], ax
lea eax, [esp + 0x14]
push eax
push dword [esp + 0x28]
push 0
push 0
push edi
push dword [esp + 0x50]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
and dword [esp + 0x28], 0
jmp 0x401a92