Function at 0x40cd62
Capabilities:
Create process on windows
Get common file path
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
push ebx
push esi
push edi
mov edi, dword [0x4339ac]
push dword [edi + 0x22f4]
add edi, 0xb0c
mov dword [ebp - 0x1c], edi
call fcn.0041d0e0
push dword [edi + 0x17f0]
mov dword [ebp - 0x14], eax
call fcn.0041d0e0
xor ebx, ebx
push ebx
push str.RegEdit_RegEdit
push ebx
push ebx
mov dword [ebp - 0x10], eax
call dword [sym.imp.USER32.dll_FindWindowExA]
cmp eax, ebx
je 0x40cdb8
push ebx
push ebx
push 0x10
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
lea eax, [ebp - 0x18]
push eax
push 0xf003f
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersionAppletsRegedit
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
jne 0x40d02d
cmp dword [ebp + 8], 1
jne 0x40cf97
cmp dword [ebp - 0x14], 5
mov byte [ebp - 0x238], bl
ja 0x40cf70
push str.SYSTEMCurrentControlSetControlClass
lea eax, [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp - 0x14]
imul eax, eax, 0x368
add eax, edi
mov dword [ebp - 0x24], eax
add eax, 0x49c
push eax
lea eax, [ebp - 0x134]
push eax
call esi
push 0x42cc9c
lea eax, [ebp - 0x134]
push eax
call esi
push ebx
lea eax, [ebp - 8]
push eax
push ebx
push 0xf003f
push ebx
push ebx
push ebx
lea eax, [ebp - 0x134]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x40cf70
lea eax, [ebp - 0x2c]
push eax
push ebx
push ebx
push ebx
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x33c]
push eax
mov dword [ebp - 0xc], ebx
push ebx
jmp 0x40cf02
inc dword [ebp - 0xc]
cmp edi, ebx
jne 0x40ceed
lea eax, [ebp - 0x20]
push eax
push 0xf003f
push ebx
lea eax, [ebp - 0x33c]
push eax
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40ceed
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp - 0x30]
push eax
push ebx
push str.DriverDesc
push dword [ebp - 0x20]
mov dword [ebp - 4], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40cee4
mov eax, dword [ebp - 0x24]
add eax, 0x388
push eax
lea eax, [ebp - 0x440]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
mov edi, eax
cmp edi, ebx
je 0x40cf20
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x2c]
push eax
push ebx
push ebx
push ebx
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x33c]
push eax
push dword [ebp - 0xc]
push dword [ebp - 8]
mov dword [ebp - 4], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
mov edi, eax
cmp edi, 0x103
jne 0x40ce7a
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp edi, ebx
jne 0x40cf6d
push str.HKEY_LOCAL_MACHINE_
lea eax, [ebp - 0x238]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x134]
push eax
lea eax, [ebp - 0x238]
push eax
call esi
push 0x4263c4
lea eax, [ebp - 0x238]
push eax
call esi
lea eax, [ebp - 0x33c]
push eax
lea eax, [ebp - 0x238]
push eax
call esi
mov edi, dword [ebp - 0x1c]
lea eax, [ebp - 0x238]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
lea eax, [ebp - 0x238]
push eax
push 1
push ebx
push str.LastKey
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
cmp dword [ebp + 8], 2
jne 0x40d024
mov eax, dword [ebp - 0x14]
cmp eax, ebx
mov byte [ebp - 0x134], bl
jl 0x40cffd
cmp dword [ebp - 0x10], ebx
jl 0x40cffd
imul eax, eax, 0x368
add edi, eax
mov eax, dword [edi + 0x6cc]
cmp eax, 1
jl 0x40cffd
cmp dword [ebp - 0x10], eax
jge 0x40cffd
push str.HKEY_LOCAL_MACHINESYSTEMCurrentControlSetEnum_
lea eax, [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp - 0x10]
mov ecx, dword [edi + 0x6c8]
imul eax, eax, 0x550
lea eax, [ecx + eax + 0xe8]
push eax
lea eax, [ebp - 0x134]
push eax
call esi
lea eax, [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
lea eax, [ebp - 0x134]
push eax
push 1
push ebx
push str.LastKey
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x104
lea eax, [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push str._regedit.exe
lea eax, [ebp - 0x134]
push eax
call esi
push 1
push ebx
push ebx
lea eax, [ebp - 0x134]
push eax
push str.open
push ebx
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
pop edi
pop esi
pop ebx
leave
ret 4