Function at 0x402040
Capabilities:
Get disk information
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
sub esp, 0x424
push esi
push str.Enumerate9XDrive_n
call fcn.00401100
add esp, 4
lea eax, [esp + 0xc]
xor esi, esi
mov dword [esp + 8], 3
push eax
push str.Config_ManagerEnum
push 0x80000006
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x402426
mov edx, dword [esp + 0xc]
lea ecx, [esp + 0x128]
push 0xff
push ecx
push esi
push edx
mov dword [esp + 0x2c], 1
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
jne 0x402426
push ebx
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
push ebp
push edi
lea eax, [esp + 0x134]
lea ecx, [esp + 0x234]
push eax
push str.Config_ManagerEnum_s
push ecx
mov dword [esp + 0x20], 3
call ebx
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
add esp, 0xc
lea edx, [esp + 0x20]
lea eax, [esp + 0x234]
push edx
push 0xf003f
push 0
push eax
push 0x80000006
call esi
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x24]
lea edx, [esp + 0x34]
push ecx
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x18]
push edx
push eax
push 0
push str.HardWareKey
push ecx
mov dword [esp + 0x3c], 0xfe
call edi
mov edx, dword [esp + 0x20]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edx
call ebp
push 4
lea eax, [esp + 0x38]
push str.SCSI
push eax
call fcn.00403600
add esp, 0xc
test eax, eax
jne 0x4023f7
lea ecx, [esp + 0x34]
lea edx, [esp + 0x234]
push ecx
push str.Enum_s
push edx
call ebx
add esp, 0xc
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x234]
push eax
push 0xf003f
push 0
push ecx
push 0x80000002
call esi
lea edx, [esp + 0x24]
lea eax, [esp + 0x334]
push edx
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x18]
push eax
push ecx
push 0
push str.CurrentDriveLetterAssignment
push edx
mov dword [esp + 0x2c], 1
mov dword [esp + 0x3c], 0xfe
call edi
mov eax, dword [esp + 0x1c]
push eax
call ebp
movsx ecx, byte [esp + 0x334]
push ecx
lea edx, [esp + 0x30]
push str._c:_
push edx
call fcn.0040346f
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 2
jne 0x4023f7
mov cl, byte [esp + 0x334]
mov dl, byte [esp + 0x50]
sub cl, 0x41
and ecx, 0xff
cmp dl, 1
mov ebp, ecx
jb 0x40220f
cmp dl, 9
ja 0x40220f
add dl, 0x30
mov byte [esp + 0x50], dl
cmp dl, 0x5f
jne 0x40221c
mov dl, 0x31
mov byte [esp + 0x50], dl
jmp 0x40222e
cmp dl, 0x31
jb 0x4022cb
cmp dl, 0x39
ja 0x4022cb
cmp bp, 0x1a
jae 0x4023f7
mov eax, ebp
sub dl, 0x30
and eax, 0xffff
mov ecx, 0x121
and edx, 0xff
push 8
lea esi, [eax + eax*8]
shl esi, 5
add esi, eax
xor eax, eax
shl esi, 2
lea edi, [esi + 0x40e390]
rep stosd dword es:[edi], eax
mov word [esi + 0x40e812], dx
lea edx, [esp + 0x3d]
lea eax, [esi + 0x40e792]
push edx
push eax
call fcn.00403500
lea ecx, [esp + 0x4d]
push 0x10
lea edx, [esi + 0x40e7d2]
push ecx
push edx
call fcn.00403500
lea eax, [esp + 0x14c]
lea ecx, [esi + 0x40e392]
push eax
push 0x40c358
push ecx
call ebx
xor ecx, ecx
mov cx, word [esi + 0x40e812]
mov eax, ecx
shl eax, 6
add eax, ecx
shl eax, 3
lea edx, [eax + 0x40d03c]
lea eax, [eax + 0x40cf38]
push edx
push eax
jmp 0x4023ee
cmp bp, 0x1a
jae 0x4023f7
mov eax, ebp
mov ecx, 0x121
and eax, 0xffff
mov byte [esp + 0x11], dl
lea edx, [esp + 0x10]
lea esi, [eax + eax*8]
push edx
shl esi, 5
add esi, eax
xor eax, eax
shl esi, 2
push 0x40c108
mov byte [esp + 0x1a], al
lea edi, [esi + 0x40e390]
rep stosd dword es:[edi], eax
mov cl, byte [esp + 0x57]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
mov byte [esp + 0x18], cl
call edi
test eax, eax
jne 0x402327
mov word [esi + 0x40e812], 1
jmp 0x402391
lea eax, [esp + 0x10]
push eax
push 0x40c104
call edi
test eax, eax
jne 0x402342
mov word [esi + 0x40e812], 2
jmp 0x402391
lea ecx, [esp + 0x10]
push ecx
push 0x40c100
call edi
test eax, eax
jne 0x40235d
mov word [esi + 0x40e812], 3
jmp 0x402391
lea edx, [esp + 0x10]
push edx
push 0x40c0fc
call edi
test eax, eax
jne 0x402378
mov word [esi + 0x40e812], 4
jmp 0x402391
lea eax, [esp + 0x10]
push eax
push 0x40c0f8
call edi
test eax, eax
jne 0x4023f7
mov word [esi + 0x40e812], 5
lea ecx, [esp + 0x39]
push 8
lea edx, [esi + 0x40e792]
push ecx
push edx
call fcn.00403500
lea eax, [esp + 0x4d]
push 0x10
lea ecx, [esi + 0x40e7d2]
push eax
push ecx
call fcn.00403500
lea edx, [esp + 0x14c]
lea eax, [esi + 0x40e392]
push edx
push 0x40c358
push eax
call ebx
xor ecx, ecx
mov cx, word [esi + 0x40e812]
mov eax, ecx
shl eax, 6
add eax, ecx
shl eax, 3
lea ecx, [eax + 0x40d03c]
lea edx, [eax + 0x40cf38]
push ecx
push edx
push ebp
call fcn.00401cf0
add esp, 0x30
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
mov eax, ecx
inc ecx
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x134]
push 0xff
push ecx
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
test eax, eax
je 0x4020b9
pop edi
pop ebp
pop ebx
xor eax, eax
pop esi
add esp, 0x424
ret