Function at 0x407287
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1140
call fcn.0042b680
push ebx
push esi
push edi
push 1
xor ebx, ebx
mov edi, ecx
cmp word [0x45349a], bx
pop esi
mov dword [ebp - 8], edi
mov dword [ebp - 0x10], esi
je 0x4072bf
push str.COMMS:_Enumerate_printer_class_USB_devices
push dword [edi + 0x2b0]
call fcn.0041e63d
pop ecx
pop ecx
push 0x12
push ebx
push ebx
push 0x4354e8
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x407320
lea eax, [ebp - 0x1140]
push 0x1000
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
push str.Failed_to_get_handle_to_Device_Information_Set____s
push dword [ebp + 0x10]
call fcn.0042b964
add esp, 0xc
push dword [ebp + 0x10]
push str.COMMS:__s
push dword [edi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
mov ax, si
jmp 0x407613
mov dword [ebp - 0x14], ebx
mov esi, 0x1000
jmp 0x40732d
mov edi, dword [ebp - 8]
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0x1c
push eax
push dword [ebp - 0x14]
push 0x4354e8
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
je 0x40753e
push ebx
push ebx
lea eax, [ebp - 0x140]
inc dword [ebp - 0x14]
push 0x109
push eax
lea eax, [ebp - 0x34]
mov dword [ebp - 0x140], 5
push eax
push dword [ebp - 0xc]
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailA]
test eax, eax
je 0x407592
push 0x20019
lea eax, [ebp - 0x34]
push ebx
push eax
push dword [ebp - 0xc]
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDeviceInterfaceRegKey]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4073be
lea eax, [ebp - 0x13c]
push eax
mov eax, dword [ebp - 8]
push str.COMMS:_Failed_to_open_Device_Interface_registry_branch_for_printer_device_path___s_
push dword [eax + 0x2b0]
call fcn.0041e63d
add esp, 0xc
jmp 0x40752f
lea eax, [ebp - 4]
mov dword [ebp - 4], esi
push eax
lea eax, [ebp - 0x1140]
push eax
push ebx
push ebx
push str.Base_Name
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
cmp eax, ebx
je 0x40741f
lea eax, [ebp - 0x1140]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
lea eax, [ebp - 0x13c]
push eax
mov eax, dword [ebp - 8]
push str.COMMS:_Failed_to_get_port_name_prefix_for_printer_device_path___s___assuming__USB______s
push dword [eax + 0x2b0]
call fcn.0041e63d
add esp, 0x10
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40752f
lea eax, [ebp - 4]
mov dword [ebp - 4], 4
push eax
lea eax, [ebp - 0x18]
push eax
push ebx
push ebx
push str.Port_Number
push edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp word [0x45349a], bx
je 0x407473
lea eax, [ebp - 0x13c]
push eax
lea eax, [ebp - 0x1140]
push dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 8]
push str.COMMS:_Found_device:_Prefix___s___port_num__u__device_path___s_
push dword [eax + 0x2b0]
call fcn.0041e63d
add esp, 0x14
lea eax, [ebp - 0x1140]
push 0x4383dc
push eax
call fcn.004348e0
pop ecx
test eax, eax
pop ecx
jne 0x40752f
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ecx + 0x188]
jne 0x40752f
lea eax, [ebp - 0x13c]
lea edi, [ebp - 0x13c]
push eax
call fcn.0042bfb0
cmp eax, 8
pop ecx
mov dword [ebp - 4], eax
jbe 0x4075d2
push 8
push str.vid_08a6
push edi
call fcn.00434ad0
add esp, 0xc
test eax, eax
je 0x4074f1
push 8
push str.vid_17ef
push edi
call fcn.00434ad0
add esp, 0xc
test eax, eax
je 0x4074f1
inc edi
dec dword [ebp - 4]
cmp dword [ebp - 4], 8
ja 0x4074bf
cmp dword [ebp - 4], 8
jbe 0x4075d2
push dword [ebp + 0xc]
lea eax, [ebp - 0x13c]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
cmp word [0x45349a], bx
je 0x40752c
mov eax, dword [ebp - 8]
push str.COMMS:_Found_matching_device
push dword [eax + 0x2b0]
call fcn.0041e63d
pop ecx
pop ecx
mov dword [ebp - 0x10], ebx
cmp word [ebp - 0x10], bx
jne 0x40732a
jmp 0x407606
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x103
jne 0x407573
cmp word [0x45349a], bx
je 0x407566
push str.COMMS:_Not_found_matching_device
push dword [edi + 0x2b0]
call fcn.0041e63d
pop ecx
pop ecx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], ebx
mov byte [eax], bl
jmp 0x407606
lea eax, [ebp - 0x1140]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
push str.Failed_to_get_printer_Device_Interface_data____s
jmp 0x4075af
lea eax, [ebp - 0x1140]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
push str.Failed_to_get_printer_Device_Interface_detail_data____s
push dword [ebp + 0x10]
call fcn.0042b964
add esp, 0xc
push dword [ebp + 0x10]
push str.COMMS:__s
push dword [edi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
jmp 0x407606
mov edi, dword [ebp - 8]
lea eax, [ebp - 0x13c]
push eax
push str.COMMS:_Printer_device_path___s__is_not_a_Toshiba_or_Lenovo_device
push dword [edi + 0x2b0]
call fcn.0041e63d
add esp, 0xc
add edi, 0x32
push edi
push esi
push dword [ebp + 0x10]
push 0x1a
push 0x454168
call fcn.00420804
add esp, 0x14
push dword [ebp - 0xc]
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov ax, word [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret 0xc