Function at 0x404fe0
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
sub esp, 0x1f8
mov ecx, dword [0x410e0c]
mov eax, dword [str.DosDevices]
mov dx, word [0x410e10]
mov dword [esp + 0x1c], ecx
mov ecx, dword [str.PortOwner]
push ebx
mov dword [esp + 0x28], ecx
mov ecx, dword [str.LTPort]
mov dword [esp + 0x1c], eax
mov al, byte [0x410e12]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
push ebp
mov dword [esp + 0x18], ecx
push esi
lea ecx, [esp + 0x14]
push edi
mov word [esp + 0x30], dx
mov edx, dword [0x410e00]
mov byte [esp + 0x32], al
mov ax, word [0x410e04]
push ecx
push 0x20019
mov dword [esp + 0x40], edx
mov dx, word [0x410df8]
mov word [esp + 0x44], ax
mov al, byte [0x410dfa]
push 0
push str.SystemCurrentControlSetServicesSerialParameters
push 0x80000002
mov word [esp + 0x38], dx
mov byte [esp + 0x3a], al
mov dword [esp + 0x28], 0x40
call ebx
test eax, eax
je 0x40509d
push 0
push str.Debug
push str.FoundOurPort___failed
push 0
call fcn.00404fa0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
lea edx, [esp + 0x40]
lea eax, [esp + 0x14]
push edx
mov edx, dword [esp + 0x1c]
push 0
push 0
push 0
lea ecx, [esp + 0x58]
push eax
push ecx
push 0
push edx
mov ebp, 1
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x40521b
or ecx, 0xffffffff
mov edi, str.SystemCurrentControlSetServicesSerialParameters
xor eax, eax
lea edx, [esp + 0x88]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, edx
lea edx, [esp + 0x88]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x410350
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x88]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x48]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x10]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
push 0x20019
lea ecx, [esp + 0x90]
push 0
push ecx
push 0x80000002
call ebx
test eax, eax
jne 0x405233
lea edx, [esp + 0x1c]
lea eax, [esp + 0x108]
push edx
mov edx, dword [esp + 0x14]
push eax
push 0
lea ecx, [esp + 0x40]
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405256
lea esi, [esp + 0x20]
lea eax, [esp + 0x108]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4051cf
test cl, cl
je 0x4051cb
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4051cf
add eax, 2
add esi, 2
test cl, cl
jne 0x4051ab
xor eax, eax
jmp 0x4051d4
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x405279
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], 0x40
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [esp + 0x40]
lea edx, [esp + 0x14]
push ecx
push 0
push 0
push 0
lea ecx, [esp + 0x58]
mov eax, ebp
push edx
mov edx, dword [esp + 0x2c]
push ecx
push eax
push edx
inc ebp
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
je 0x4050cc
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
push 0
push str.Error:_2
push str.FoundOurPort___failed
push 0
call fcn.00404fa0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
push 0
push str.Error:_3
push str.FoundOurPort___failed
push 0
call fcn.00404fa0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
push 0x20
call fcn.0040a280
mov edx, dword [esp + 0x14]
add esp, 4
mov esi, eax
lea eax, [esp + 0x1c]
push eax
push esi
push 0
lea ecx, [esp + 0x34]
push 0
push ecx
push edx
mov dword [esp + 0x34], 0x20
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4052ce
push 0
push str.Error:_3
push str.FoundOurPorts___failed
push 0
call fcn.00404fa0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
push esi
push 0x416380
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1f8
ret