Function at 0x402020
Capabilities:
Get disk information
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0xbfc
mov dl, byte [0x421d68]
push ebx
push ebp
push esi
push edi
mov ecx, 0x31
xor eax, eax
lea edi, [esp + 0x11d]
mov byte [esp + 0x11c], dl
mov byte [esp + 0x54], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x31
xor eax, eax
lea edi, [esp + 0x55]
mov esi, dword [esp + 0xc10]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, 0x4170ec
or ecx, 0xffffffff
xor eax, eax
mov byte [esp + 0x17], 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ecx + esi + 0x84]
push eax
call fcn.0040ce63
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x30], eax
push ecx
call dword [0x4392c0]
test eax, eax
je 0x4020a9
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x24]
push edx
push 0
lea eax, [esp + 0x3c]
push 0x20
push eax
push ecx
call dword [0x439454]
mov edi, dword [esp + 0xc14]
mov eax, edi
and eax, 7
je 0x4020d9
lea ecx, [eax - 1]
mov bl, 1
shl bl, cl
jmp 0x4020db
mov bl, 0x80
mov al, byte [0x54815c]
push 0xc8
test al, al
jne 0x4020fb
mov eax, dword [0x548158]
lea edx, [esp + 0x120]
push edx
push 5
push eax
jmp 0x40210c
mov edx, dword [0x548158]
lea ecx, [esp + 0x120]
push ecx
push 0x47
push edx
call dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [esp + 0x11c]
push edi
lea ecx, [esp + 0x58]
push eax
push ecx
call fcn.0040cce6
add esp, 0xc
dec edi
shr edi, 3
test byte [esp + edi + 0x34], bl
je 0x402167
mov eax, dword [0x439344]
push 0x44
lea edx, [esp + 0x58]
push str.ModifyCOMLPT
push edx
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 7
jne 0x402167
mov ecx, dword [esp + 0x10]
push ecx
call dword [0x43955c]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
mov ebp, dword [sym.imp.KERNEL32.dll_QueryDosDeviceA]
lea edx, [esp + 0x40c]
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0x40c]
add esi, 0x84
push 0x1ff
push edx
rep stosd dword es:[edi], eax
push esi
mov dword [esp + 0x24], esi
call ebp
test eax, eax
jne 0x4021a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor bl, bl
jmp 0x4022b1
mov edi, str.._
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x34]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, dword [esp + 0x18]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x34]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x80
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]
push 3
mov ecx, edx
push eax
push eax
and ecx, 3
lea eax, [esp + 0x48]
push 0x80000000
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov al, byte [0x54815c]
test al, al
push 0xc8
jne 0x40223a
mov edx, dword [0x548158]
lea ecx, [esp + 0x120]
push ecx
push 0x3b
push edx
jmp 0x40224b
mov ecx, dword [0x548158]
lea eax, [esp + 0x120]
push eax
push 0x45
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea edx, [esp + 0x11c]
push ebx
lea eax, [esp + 0x58]
push edx
push eax
call fcn.0040cce6
add esp, 0xc
cmp esi, 0xffffffff
jne 0x4022a2
mov edx, dword [0x439344]
push 0x14
lea ecx, [esp + 0x58]
push str.ModifyCOMLPT
push ecx
push edx
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 7
jne 0x4022a2
mov eax, dword [esp + 0x10]
push eax
call dword [0x43955c]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bl, byte [esp + 0x17]
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0xc14]
lea edx, [esp + 0x1e4]
push ecx
push 0x4174d4
push edx
call fcn.0040cce6
lea edi, [esp + 0x1f0]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
test bl, bl
mov dword [esp + 0x20], ecx
je 0x4024d6
lea eax, [esp + 0x40c]
push 0x1ff
push eax
push esi
call ebp
test eax, eax
jne 0x402361
mov al, byte [0x54815c]
push 0xc8
test al, al
jne 0x40231d
mov edx, dword [0x548158]
lea ecx, [esp + 0x58]
push ecx
push 0x3c
push edx
jmp 0x40232b
mov ecx, dword [0x548158]
lea eax, [esp + 0x58]
push eax
push 0x44
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
mov eax, dword [0x439344]
push 0x10
lea edx, [esp + 0x58]
push str.ModifyCOMLPT
push edx
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [esp + 0x10]
push ecx
call dword [0x43955c]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
push 0
push esi
mov esi, dword [sym.imp.KERNEL32.dll_DefineDosDeviceA]
push 2
call esi
mov edi, eax
lea edx, [esp + 0x40c]
lea eax, [esp + 0x1e4]
push edx
push eax
push 1
call esi
test eax, eax
jne 0x4023ff
test edi, edi
je 0x40239d
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x40c]
push ecx
push edx
push 1
call esi
mov al, byte [0x54815c]
push 0xc8
test al, al
jne 0x4023bb
mov ecx, dword [0x548158]
lea eax, [esp + 0x58]
push eax
push 0x3c
push ecx
jmp 0x4023c8
mov eax, dword [0x548158]
lea edx, [esp + 0x58]
push edx
push 0x44
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
mov edx, dword [0x439344]
push 0x10
lea ecx, [esp + 0x58]
push str.ModifyCOMLPT
push ecx
push edx
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [esp + 0x10]
push eax
call dword [0x43955c]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
lea ecx, [esp + 0x1c]
push ecx
push 0xf003f
push 0
push str.HardwareDeviceMapSerialComm
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4024cb
mov ebp, dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
xor edi, edi
mov ebx, 0x200
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x80c]
push edx
lea edx, [esp + 0x28]
push ecx
push edx
lea ecx, [esp + 0x34]
push 0
lea edx, [esp + 0xa1c]
mov eax, edi
push ecx
push edx
push eax
mov eax, dword [esp + 0x38]
push eax
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
inc edi
call ebp
test eax, eax
jne 0x4024cb
cmp dword [esp + 0x24], 1
jne 0x402430
mov esi, dword [esp + 0x18]
lea eax, [esp + 0x80c]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40249e
test cl, cl
je 0x40249a
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40249e
add eax, 2
add esi, 2
test cl, cl
jne 0x40247a
xor eax, eax
jmp 0x4024a3
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402430
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x1e4]
push eax
mov eax, dword [esp + 0x20]
push ecx
push 1
lea edx, [esp + 0xa18]
push 0
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
je 0x402506
mov edx, dword [esp + 0x30]
push edx
push eax
call dword [0x439348]
mov eax, dword [esp + 0xc14]
mov ecx, dword [esp + 0x10]
push 0
push 1
push eax
push ecx
call dword [0x439568]
mov eax, dword [esp + 0x10]
push eax
call dword [0x43955c]
mov eax, dword [0x548158]
lea edx, [esp + 0x60c]
push 0x100
push edx
push 0x1d
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
test eax, eax
je 0x402587
mov edx, dword [esp + 0xc10]
mov eax, dword [0x4171c0]
push 0
lea ecx, [esp + 0x710]
push 0x100
push ecx
push 0
add edx, 0xd8
push 0
push edx
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyA]
test eax, eax
je 0x402587
lea ecx, [esp + 0x1e4]
lea edx, [esp + 0x70c]
push ecx
lea eax, [esp + 0x610]
push edx
lea ecx, [esp + 0x414]
push eax
push ecx
call fcn.0040cce6
add esp, 0x10
jmp 0x4025b2
lea edi, [esp + 0x1e4]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x40c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0xc10]
lea edi, [esp + 0x40c]
xor eax, eax
lea edx, [esp + 0x40c]
lea esi, [ecx + 0xd8]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [0x4171c0]
not ecx
push ecx
push edx
push 0xc
push esi
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiSetDeviceRegistryPropertyA]
mov ecx, dword [0x4171c0]
push 0xf003f
push 1
push 0
push 1
push esi
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov edi, eax
cmp edi, 0xffffffff
jne 0x402614
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xbfc
ret
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x1e4]
push edx
push eax
push 1
push 0
push 0x41709c
push edi
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [0x4171c0]
mov ecx, 0x4a
xor eax, eax
lea edi, [esp + 0x2e4]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x2e4]
mov dword [esp + 0x2e4], 0x128
push ecx
push esi
push edx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstallParamsA]
test eax, eax
je 0x402697
mov edi, dword [esp + 0x2e8]
mov ecx, dword [0x4171c0]
lea eax, [esp + 0x2e4]
or edi, 0x4000
push eax
push esi
push ecx
mov dword [esp + 0x2f4], edi
call dword [sym.imp.SETUPAPI.dll_SetupDiSetDeviceInstallParamsA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xbfc
ret