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

Disassembly:
sub esp, 0x7c
push ebx
push ebp
mov ebp, dword [esp + 0x8c]
mov eax, dword [ebp]
push esi
xor ebx, ebx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x94]
xor esi, esi
cmp eax, 2
push edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x20], ebx
mov dword [ebp], ebx
je 0x403c32
cmp eax, 1
je 0x403c32
push 2
push ebx
push ebx
lea ecx, [esp + 0x38]
push ecx
mov dword [esp + 0x3c], 0x4d36e978
mov word [esp + 0x40], 0xe325
mov word [esp + 0x42], 0x11ce
mov byte [esp + 0x44], 0xbf
mov byte [esp + 0x45], 0xc1
mov byte [esp + 0x46], 8
mov byte [esp + 0x47], 0
mov byte [esp + 0x48], 0x2b
mov byte [esp + 0x49], 0xe1
mov byte [esp + 0x4a], 3
mov byte [esp + 0x4b], 0x18
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
mov edi, eax
cmp edi, 0xffffffff
je 0x403c28
lea edx, [esp + 0x4c]
push edx
push ebx
push edi
mov dword [esp + 0x58], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x403c21
mov ebp, dword [esp + 0x90]
lea eax, [esp + 0x6c]
sub ebp, eax
nop
push 0x20019
push 1
push 0
push 1
lea ecx, [esp + 0x5c]
push ecx
push edi
inc ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov esi, eax
cmp esi, 0xffffffff
je 0x403c08
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x70]
push eax
push 0
push 0
push str.PortName
push esi
mov dword [esp + 0x34], 0x20
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x403c01
push 3
lea ecx, [esp + 0x70]
push 0x41290c
push ecx
call fcn.00408470
add esp, 0xc
test eax, eax
jne 0x403c01
push eax
push eax
push 3
push eax
push eax
push 0xc0000000
lea edx, [esp + 0x84]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x403c01
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x20]
cmp edx, dword [esp + 0x24]
jge 0x403be8
lea eax, [esp + 0x6c]
mov cl, byte [eax]
mov byte [eax + ebp], cl
inc eax
test cl, cl
jne 0x403bd4
mov dword [esp + 0x10], 1
jmp 0x403bf0
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x94]
inc edx
mov dword [esp + 0x20], edx
add ebp, 0x20
mov dword [eax], edx
push esi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [esp + 0x4c]
push ecx
push ebx
push edi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x403b40
mov esi, dword [esp + 0x10]
push edi
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x7c
ret
mov ecx, 7
mov esi, str.HARDWAREDEVICEMAPSERIALCOMM
lea edi, [esp + 0x4c]
rep movsd dword es:[edi], dword [esi]
lea edx, [esp + 0x14]
push edx
push 0x20019
push 0
lea eax, [esp + 0x58]
push eax
push 0x80000002
mov dword [esp + 0x28], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x34], ebx
movsw word es:[edi], word [esi]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x403db3
push eax
push eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x24]
push edx
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x30]
push eax
push 0
push 0
lea ecx, [esp + 0x44]
push ecx
push 0
push 0
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
test eax, eax
jne 0x403da8
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x20]
test eax, eax
jbe 0x403da8
mov esi, dword [esp + 0x90]
lea eax, [esp + 0x2c]
sub esi, eax
xor eax, eax
push eax
push eax
push eax
push eax
mov ecx, 8
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x80]
push edx
push eax
push ecx
mov dword [esp + 0x38], 0x20
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
test eax, eax
jne 0x403d93
lea edx, [esp + 0x18]
push edx
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x30]
push eax
push 0
push 0
lea ecx, [esp + 0x7c]
push ecx
push edx
mov dword [esp + 0x30], 0x20
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push 3
lea eax, [esp + 0x30]
push 0x4128fc
push eax
call fcn.00408470
add esp, 0xc
test eax, eax
jne 0x403d93
push eax
push eax
push 3
push eax
push eax
push 0xc0000000
lea ecx, [esp + 0x44]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x403d93
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, dword [esp + 0x24]
jge 0x403d84
lea eax, [esp + 0x2c]
lea esp, [esp]
mov cl, byte [eax]
mov byte [esi + eax], cl
inc eax
test cl, cl
jne 0x403d70
mov dword [esp + 0x10], 1
jmp 0x403d8c
mov dword [esp + 0x10], 0
inc ebx
add esi, 0x20
mov dword [ebp], ebx
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jb 0x403cc4
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x7c
ret