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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8014
call fcn.004041d0
mov eax, dword [0x41f1d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x8014], eax
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push str.FriendlyName
push edi
mov dword [ebp - 0x8010], edi
mov dword [ebp - 0x8008], 0x3fff
mov byte [ebp - 0x4004], 0
call ebx
test eax, eax
jne 0x401fd9
mov eax, dword [ebp - 0x8008]
cmp eax, 0x3fff
jae 0x401fd4
mov ecx, dword [ebp + 0xc]
mov byte [ebp + eax - 0x4004], 0
lea eax, [ebp - 0x4004]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x401fc2
test dl, dl
je 0x401fbe
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x401fc2
add eax, 2
add ecx, 2
test dl, dl
jne 0x401fa2
xor eax, eax
jmp 0x401fc7
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4023c1
jmp 0x402077
call fcn.004040ca
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push str.DeviceDesc
push edi
mov byte [ebp - 0x4004], 0
mov dword [ebp - 0x8008], 0x3fff
call ebx
test eax, eax
jne 0x4023c1
mov ecx, dword [ebp + 0xc]
mov edx, ecx
lea edi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x402014
mov eax, dword [ebp - 0x8008]
sub edx, edi
inc edx
cmp eax, 0x3fff
jae 0x401fd4
mov byte [ebp + eax - 0x4004], 0
cmp eax, edx
jb 0x4023c1
sub eax, edx
lea eax, [ebp + eax - 0x4004]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x402064
test dl, dl
je 0x402060
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x402064
add eax, 2
add ecx, 2
test dl, dl
jne 0x402044
xor eax, eax
jmp 0x402069
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4023c1
mov edi, dword [ebp - 0x8010]
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push str.Driver
push edi
mov byte [ebp - 0x4004], 0
mov dword [ebp - 0x8008], 0x3fff
call ebx
test eax, eax
jne 0x4023b3
mov eax, dword [ebp - 0x8008]
cmp eax, 0x3fff
jae 0x401fd4
mov byte [ebp + eax - 0x4004], 0
lea eax, [ebp - 0x4004]
push eax
push str.SYSTEMCurrentControlSetControlClass
lea eax, [ebp - 0x8004]
push str._s_s
push eax
call fcn.00403e88
lea eax, [ebp - 0x8004]
push eax
push str.Device_SW_Key___s__n
call fcn.00403c2e
add esp, 0x18
lea eax, [ebp - 0x800c]
push eax
push 0x2001f
push 0
lea eax, [ebp - 0x8004]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4023c1
mov byte [ebp - 0x4004], al
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push dword [ebp - 0x8014]
mov dword [ebp - 0x8008], 0x3fff
push dword [ebp - 0x800c]
call ebx
test eax, eax
je 0x402173
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push str.AssignedPortForQCDevice
push dword [ebp - 0x800c]
call ebx
test eax, eax
jne 0x4021c2
mov eax, dword [ebp - 0x8008]
lea ecx, [ebp - 0x4004]
add ecx, eax
cmp eax, 0x3fff
jae 0x401fd4
lea eax, [ebp - 0x4004]
mov byte [ecx], 0
cmp ecx, eax
jbe 0x4021b0
lea esp, [esp]
cmp byte [ecx], 0x5c
je 0x4021b5
dec ecx
lea eax, [ebp - 0x4004]
cmp ecx, eax
ja 0x4021a0
cmp byte [ecx], 0x5c
jne 0x4021b6
inc ecx
sub esi, ecx
mov al, byte [ecx]
mov byte [esi + ecx], al
inc ecx
test al, al
jne 0x4021b8
cmp byte [0x420e28], 0
je 0x40238f
mov eax, dword [0x420eac]
cmp eax, 1
jne 0x4022ed
cmp dword [0x420ebc], eax
jne 0x40225a
mov ecx, 0x420ec0
lea edx, [ecx + 1]
lea ecx, [ecx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4021f0
sub ecx, edx
lea eax, [ecx + 1]
push eax
push 0x420ec0
push 1
push 0
push 0x420e28
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x4022b6
push 0x420ec0
push 0x420e28
push str.Entry___s__set_to__s_n
call fcn.00403c2e
add esp, 0xc
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14
push 4
push 0x420ea8
push 4
push 0
push 0x420e28
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x4022b6
push dword [0x420ea8]
push 0x420e28
push str.Entry___s__set_to_0x_x_n
call fcn.00403c2e
add esp, 0xc
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14
push eax
push 0x420e28
push str.Error:_Entry___s__failure:__u_n
call fcn.00403c2e
add esp, 0xc
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14
test eax, eax
jne 0x40238f
mov byte [ebp - 0x4004], al
lea eax, [ebp - 0x8008]
push eax
lea eax, [ebp - 0x4004]
push eax
push 0
push 0
push 0x420e28
push dword [ebp - 0x800c]
mov dword [ebp - 0x8008], 0x3fff
call ebx
test eax, eax
jne 0x40237d
mov eax, dword [ebp - 0x8008]
cmp eax, 0x3fff
jae 0x401fd4
mov byte [ebp + eax - 0x4004], 0
push dword [ebp - 0x4004]
push 0x420e28
push str.Entry___s__has_value_of_0x_x_n
call fcn.00403c2e
add esp, 0xc
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14
push 0x420e28
push str.Error:_Entry___s__does_not_exist_n
call fcn.00403c2e
add esp, 8
push dword [ebp - 0x800c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14
push eax
push str.Error:_cannot_get_device_software_key__retCode__u_n
call fcn.00403c2e
add esp, 8
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.00404041
mov esp, ebp
pop ebp
ret 0x14