Function at 0x401df0
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0x1e4
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x11], 0
call dword [sym.imp.utpapi.dll_GetExistControllers]
mov byte [esp + 0x12], al
mov byte [0x40bc5c], al
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0xf4]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x134]
push eax
call fcn.00401c00
add esp, 4
xor ebx, ebx
xor ebp, ebp
mov ecx, 0xa
xor eax, eax
lea edi, [esp + 0xcc]
rep stosd dword es:[edi], eax
mov ecx, 0xa
lea edi, [esp + 0x68]
rep stosd dword es:[edi], eax
mov edi, 0xa
push ebp
call fcn.00401ac0
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x401e8f
jle 0x401e98
lea ecx, [esp + 0x134]
push esi
push ecx
call fcn.00401dd0
add esp, 8
cmp eax, 0xffffffff
je 0x401e8f
mov ecx, dword [esp + esi*4 + 0xf4]
lea eax, [esp + esi*4 + 0xf4]
cmp ecx, ebx
jne 0x401e8f
mov dword [eax], esi
jmp 0x401e98
push ebp
call fcn.00401b60
add esp, 4
mov dword [ebp*4 + 0x40bc94], ebx
inc ebp
dec edi
jne 0x401e52
mov ecx, 0xf
xor eax, eax
lea edi, [esp + 0x90]
mov byte [esp + 0x14], 1
rep stosd dword es:[edi], eax
cmp byte [esp + 0x12], 1
jb 0x402285
mov ebp, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x90]
push 0x3c
push edx
push eax
call dword [sym.imp.utpapi.dll_GetControllerName]
push 0xc
lea ecx, [esp + 0x94]
push str.RS232_DEVICE
push ecx
call fcn.00403570
add esp, 0xc
test eax, eax
jne 0x40226f
lea edx, [esp + 0x90]
push edx
call dword [sym.imp.utpapi.dll_OpenController]
mov esi, eax
push esi
call dword [sym.imp.utpapi.dll_GetDisplayNumber]
push esi
mov byte [esp + 0x17], al
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x9c]
push eax
call fcn.00403557
mov byte [esp + 0x1c], al
add esp, 4
mov eax, dword [esp + 0x18]
and eax, 0xff
shl eax, 2
mov dword [esp + 0x40], eax
mov ecx, dword [eax + 0x40bc94]
mov dword [esp + eax + 0xcc], 1
cmp ecx, ebx
jne 0x40226f
push ebx
push ebx
push 3
push ebx
push 3
push 0xc0000000
push str..UtcRs232D
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
call dword [sym.imp.utpapi.dll_GetExistDisplays]
cmp esi, 0xffffffff
je 0x40226f
call fcn.00402c70
cmp eax, 0x190
jne 0x4020b4
mov byte [esp + 0x14], 0
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x174]
push ebx
rep stosd dword es:[edi], eax
push str.SYSTEMCurrentControlSetControlUtcRS232Device
lea ecx, [esp + 0x17c]
push str._s_d
push ecx
call fcn.004035a8
add esp, 0x10
lea edx, [esp + 0x30]
lea eax, [esp + 0x174]
push edx
push 0xf003f
push 0
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40209f
lea ecx, [esp + 0x44]
mov dword [esp + 0x2c], eax
lea edx, [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x34]
lea eax, [esp + 0x5c]
push edx
push eax
push 0
push str.COMPORT
push ecx
mov dword [esp + 0x5c], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [esp + 0x2c]
test eax, eax
jbe 0x402089
cmp eax, 0x10
jae 0x402089
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push str..UtcRs232D
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x48], edi
je 0x40208d
mov dl, byte [esp + 0x14]
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0x5c]
mov byte [esp + 0x4c], dl
and eax, 0xff
push 0
push ecx
lea edx, [esp + 0x68]
mov dword [esp + 0x55], eax
push 1
push edx
lea eax, [esp + 0x5c]
push 9
push eax
push 0x22002c
push edi
mov dword [esp + 0x71], 0x2580
call ebp
jmp 0x40208d
mov edi, dword [esp + 0x48]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x30]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, byte [esp + 0x14]
inc al
inc ebx
cmp al, 0xa
mov byte [esp + 0x14], al
jb 0x401f99
xor ebx, ebx
mov dl, byte [esp + 0x18]
xor edi, edi
mov byte [esp + 0x1c], dl
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0xc8
call ebx
mov eax, dword [0x40bddc]
lea ecx, [esp + 0x28]
push 0
push ecx
push 0
push 0
lea edx, [esp + 0x2c]
push 5
push edx
push 0x220018
push esi
mov dword [esp + 0x3d], eax
call ebp
test eax, eax
jne 0x402107
call dword [sym.imp.KERNEL32.dll_GetLastError]
inc edi
cmp edi, 3
jle 0x4020be
push 0
push esi
call dword [sym.imp.utpapi.dll_EnableUpSound]
mov al, byte [esp + 0x18]
xor edi, edi
mov byte [esp + 0x1c], al
push 0xc8
call ebx
mov ecx, dword [0x40bcc0]
lea edx, [esp + 0x28]
push 0
push edx
push 0
push 0
lea eax, [esp + 0x2c]
push 5
push eax
push 0x220014
push esi
mov dword [esp + 0x3d], ecx
call ebp
test eax, eax
jne 0x402155
call dword [sym.imp.KERNEL32.dll_GetLastError]
inc edi
cmp edi, 3
jle 0x402111
push 0
push esi
call dword [sym.imp.utpapi.dll_EnableDownSound]
cmp byte [esp + 0x11], 3
jae 0x40218b
mov eax, dword [0x40bc64]
test eax, eax
je 0x402184
push 0x64
call ebx
mov ecx, dword [0x40bc64]
push esi
push ecx
call dword [sym.imp.utpapi.dll_SetManualRightEvent]
test eax, eax
mov dword [0x40bc28], eax
jne 0x40218b
inc byte [esp + 0x11]
cmp byte [esp + 0x11], 3
jb 0x40215c
xor edi, edi
push 0x64
call ebx
mov dl, byte [esp + 0x18]
xor eax, eax
mov dword [esp + 0x34], eax
lea ecx, [esp + 0x28]
mov dword [esp + 0x38], eax
mov byte [esp + 0x1c], dl
push eax
push ecx
lea edx, [esp + 0x3c]
mov dword [esp + 0x44], eax
push 2
push edx
lea eax, [esp + 0x2c]
push 1
push eax
push 0x220070
push esi
call ebp
test eax, eax
jne 0x4021cd
inc edi
cmp edi, 3
jl 0x40218d
mov al, byte [esp + 0x13]
mov cl, byte [esp + 0x34]
cmp cl, al
je 0x40222d
mov dl, byte [esp + 0x18]
xor edi, edi
xor ecx, ecx
mov dword [esp + 0x1c], ecx
mov byte [esp + 0x1c], dl
mov dword [esp + 0x20], ecx
mov byte [esp + 0x1d], al
mov dword [esp + 0x24], ecx
push 0x64
call ebx
xor eax, eax
lea ecx, [esp + 0x28]
mov dword [esp + 0x34], eax
lea edx, [esp + 0x34]
mov dword [esp + 0x38], eax
push eax
push ecx
mov dword [esp + 0x44], eax
push 2
push edx
lea eax, [esp + 0x2c]
push 2
push eax
push 0x220074
push esi
call ebp
test eax, eax
jne 0x40222d
inc edi
cmp edi, 3
jl 0x4021f5
mov edi, dword [esp + 0x18]
push edi
push esi
call fcn.00401880
add esp, 8
push esi
call dword [sym.imp.utpapi.dll_GetReportMode]
cmp al, 3
jne 0x402250
push edi
push esi
call fcn.00401710
add esp, 8
push edi
push esi
call fcn.00401650
mov ecx, dword [esp + 0x48]
add esp, 8
push esi
mov dword [esp + ecx + 0x6c], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov al, byte [esp + 0x14]
mov cl, byte [esp + 0x12]
inc al
cmp al, cl
mov byte [esp + 0x14], al
jbe 0x401ec9
call fcn.00401350
xor eax, eax
mov edx, 0xa
mov esi, dword [esp + eax + 0x68]
mov ecx, dword [esp + eax + 0xcc]
cmp esi, 1
mov dword [eax + 0x40bc94], ecx
jne 0x4022b5
cmp ecx, ebx
jne 0x4022b5
mov dword [esp + eax + 0x68], ebx
mov dword [eax + 0x40bc94], ebx
add eax, 4
dec edx
jne 0x402291
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1e4
ret