Function at 0x402720
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2c3c
call fcn.0043d750
mov eax, dword [0x47b014]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push dword [ebp + 0x10]
mov dword [ebp - 0x2c14], eax
xor eax, eax
mov dword [ebp - 0x2c10], ecx
lea ecx, [ebp - 0xc08]
mov dword [ebp - 0x2c38], edx
mov word [ebp - 0xc08], ax
mov dword [ebp - 0x2c24], eax
mov byte [ebp - 0x2c2d], al
mov dword [ebp - 0x2c28], eax
mov word [ebp - 0x408], ax
call fcn.00402300
add esp, 4
mov dword [ebp - 0x2c3c], eax
test eax, eax
jne 0x402d5c
lea ecx, [ebp - 0xc08]
mov edx, 0x200
cmp word [ebp - 0xc08], ax
je 0x4027be
test edx, edx
je 0x4027df
add ecx, 2
dec edx
cmp word [ecx], 0
jne 0x4027a7
test edx, edx
je 0x4027df
cmp edx, 1
jbe 0x4027da
mov esi, 0x4666a0
sub esi, ecx
movzx eax, word [esi + ecx]
test ax, ax
je 0x4027da
mov word [ecx], ax
dec edx
add ecx, 2
cmp edx, 1
ja 0x4027c5
xor eax, eax
mov word [ecx], ax
lea eax, [ebp - 0x2c24]
push eax
push 9
push 0
lea eax, [ebp - 0xc08]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, eax
test edi, edi
jne 0x402a70
xor eax, eax
mov dword [ebp - 0x2c34], eax
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x2c0c]
mov dword [ebp - 0x2c0c], 0x200
push ecx
lea ecx, [ebp - 0x1008]
push ecx
push eax
push dword [ebp - 0x2c24]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
inc dword [ebp - 0x2c34]
mov edi, eax
test edi, edi
jne 0x402a68
lea eax, [ebp - 0x808]
mov edx, 0x200
lea esi, [ebp - 0x1008]
mov ecx, eax
sub esi, ecx
movzx ecx, word [esi + eax]
test cx, cx
je 0x40287b
mov word [eax], cx
dec edx
add eax, 2
cmp edx, 1
ja 0x402866
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x808]
push eax
call fcn.0042cce0
add esp, 4
mov dword [ebp - 0x2c18], 0
lea eax, [ebp - 0x2c18]
push eax
push str.device_u
lea eax, [ebp - 0x808]
push 0x200
push eax
call fcn.00401070
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esp, 0x10
cmp eax, 1
mov eax, dword [ebp - 0x2c34]
jne 0x402814
mov ecx, dword [ebp - 0x2c28]
lea eax, [ebp - 0x408]
cmp dword [ebp - 0x2c18], ecx
lea esi, [ebp - 0xc08]
mov edx, 0x200
cmova ecx, dword [ebp - 0x2c18]
mov dword [ebp - 0x2c28], ecx
mov ecx, eax
sub esi, ecx
nop dword [eax]
movzx ecx, word [esi + eax]
test cx, cx
je 0x402915
mov word [eax], cx
dec edx
add eax, 2
cmp edx, 1
ja 0x402900
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x408]
mov dx, word [ebp - 0x408]
mov ecx, 0x200
test dx, dx
je 0x402948
test ecx, ecx
je 0x402971
add eax, 2
dec ecx
cmp word [eax], 0
jne 0x402931
test ecx, ecx
je 0x402971
cmp ecx, 1
jbe 0x402965
mov esi, 0x4664b4
sub esi, eax
nop
movzx edx, word [esi + eax]
test dx, dx
je 0x402965
mov word [eax], dx
dec ecx
add eax, 2
cmp ecx, 1
ja 0x402950
xor ecx, ecx
mov word [eax], cx
mov dx, word [ebp - 0x408]
lea eax, [ebp - 0x408]
mov ecx, 0x200
test dx, dx
je 0x402998
test ecx, ecx
je 0x4029ba
add eax, 2
dec ecx
cmp word [eax], 0
jne 0x402981
test ecx, ecx
je 0x4029ba
cmp ecx, 1
jbe 0x4029b5
lea esi, [ebp - 0x1008]
sub esi, eax
movzx edx, word [esi + eax]
test dx, dx
je 0x4029b5
mov word [eax], dx
dec ecx
add eax, 2
cmp ecx, 1
ja 0x4029a0
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x2c2c]
push eax
push 1
push 0
lea eax, [ebp - 0x408]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
mov eax, dword [ebp - 0x2c34]
jne 0x402814
lea eax, [ebp - 0x2c0c]
mov dword [ebp - 0x2c1c], 0
push eax
lea eax, [ebp - 0x2c1c]
mov dword [ebp - 0x2c0c], 4
push eax
lea eax, [ebp - 0x2c20]
push eax
push 0
push str.DeviceSerial
push dword [ebp - 0x2c2c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x402a42
cmp dword [ebp - 0x2c20], 4
jne 0x402a42
mov eax, dword [ebp - 0x2c38]
cmp dword [ebp - 0x2c1c], eax
je 0x402a5b
push dword [ebp - 0x2c2c]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call esi
mov eax, dword [ebp - 0x2c34]
jmp 0x402814
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov byte [ebp - 0x2c2d], 1
push dword [ebp - 0x2c24]
call esi
cmp edi, 5
je 0x402cc6
cmp byte [ebp - 0x2c2d], 0
jne 0x402d20
cmp byte [ebp + 0x10], 0
je 0x402d0a
mov eax, dword [ebp - 0x2c28]
inc eax
push eax
lea eax, [ebp - 0xc08]
push eax
push str._sDevice_u
lea eax, [ebp - 0x408]
push 0x200
push eax
call fcn.004019b0
add esp, 0x14
lea eax, [ebp - 0x2c24]
push 0
push eax
push 0
push 0x20006
push 0
push 0
push 0
lea eax, [ebp - 0x408]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x402d0a
mov eax, dword [ebp - 0x2c10]
cmp eax, 1
jne 0x402b14
push dword [ebp - 0x2c38]
push str.SM2_Bluetooth__05X
lea eax, [ebp - 0x610]
push 0x104
push eax
call fcn.004019b0
add esp, 0x10
jmp 0x402b4a
cmp eax, 2
jne 0x402b26
push dword [ebp - 0x2c38]
push str.Wi_Fi__05X
jmp 0x402afe
test eax, eax
lea eax, [ebp - 0x610]
jne 0x402b37
push str.SM2_USB
jmp 0x402b3c
push 0x466658
push 0x104
push eax
call fcn.004019b0
add esp, 0xc
lea eax, [ebp - 0x2c28]
push eax
push 1
push 0
push str.SoftwarePassThruSupport.04.04Scanmatik___SM2_USB
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x402cde
lea eax, [ebp - 0x2c10]
mov dword [ebp - 0x2c10], 0x2000
push eax
lea eax, [ebp - 0x2c08]
push eax
push 0
push 0
push 0x4664b8
push dword [ebp - 0x2c28]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x2c28]
test eax, eax
jne 0x402cdc
call esi
lea ecx, [ebp - 0x610]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402bb3
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x610]
push eax
push 1
push 0
push str.Name
push dword [ebp - 0x2c24]
call edi
mov esi, eax
test esi, esi
jne 0x402cb6
push 0x6a
push str.CAN__ISO15765__J1850VPW__J1850PWM__ISO9141__ISO14230
push 1
push eax
push str.ProtocolsSupported
push dword [ebp - 0x2c24]
call edi
mov esi, eax
test esi, esi
jne 0x402cb6
lea ecx, [ebp - 0x2c08]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402c20
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [ebp - 0x2c08]
push eax
push 1
push 0
push 0x4664b8
push dword [ebp - 0x2c24]
call edi
mov esi, eax
test esi, esi
jne 0x402cb6
mov esi, dword [ebp - 0x2c14]
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402c60
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push esi
push 1
push 0
push str.FunctionLibrary
push dword [ebp - 0x2c24]
call edi
mov esi, eax
test esi, esi
jne 0x402cb6
mov eax, dword [ebp - 0x2c38]
push 4
mov dword [ebp - 0x2c14], eax
lea eax, [ebp - 0x2c14]
push eax
push 4
push esi
push str.DeviceSerial
push dword [ebp - 0x2c24]
call edi
mov esi, eax
push dword [ebp - 0x2c24]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x402ced
mov eax, 0xe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00422009
mov esp, ebp
pop ebp
ret
call esi
push dword [ebp - 0x2c24]
mov edi, 3
call esi
jmp 0x402cf3
mov edi, dword [ebp - 0x2c3c]
test edi, edi
je 0x402d26
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00422009
mov esp, ebp
pop ebp
ret
mov eax, 0x15
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00422009
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x2c3c]
test ebx, ebx
je 0x402d5a
mov eax, dword [ebp + 0xc]
cmp eax, 1
jb 0x402d5a
jbe 0x402d55
lea edx, [ebp - 0x408]
sub edx, ebx
nop dword [eax]
movzx ecx, word [edx + ebx]
test cx, cx
je 0x402d55
mov word [ebx], cx
dec eax
add ebx, 2
cmp eax, 1
ja 0x402d40
xor eax, eax
mov word [ebx], ax
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00422009
mov esp, ebp
pop ebp
ret