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

Disassembly:
sub esp, 0x43c
mov eax, dword [esp + 0x440]
push ebx
push ebp
xor ebp, ebp
cmp eax, ebp
push esi
mov ebx, 0x400
mov dword [esp + 0x14], ebp
je 0x405fcb
mov esi, dword [esp + 0x450]
cmp esi, ebp
je 0x405fcb
push edi
push ebx
mov dword [esi], ebp
call fcn.0040c2e2
mov edi, eax
add esp, 4
test edi, edi
jne 0x405cb4
pop edi
pop esi
pop ebp
mov eax, 0xfffffff3
pop ebx
add esp, 0x43c
ret
lea eax, [esp + 0x14]
push eax
push 0x20019
push 0
push str.SOFTWAREKaseyaAgent
push 0x80000002
mov byte [edi], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405e90
xor esi, esi
push esi
push esi
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x44]
push edx
lea eax, [esp + 0x3c]
push eax
mov eax, dword [esp + 0x28]
push esi
lea ecx, [esp + 0x48]
push ecx
lea edx, [esp + 0x38]
push edx
push esi
push esi
push esi
push eax
mov dword [esp + 0x4c], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
mov eax, dword [esp + 0x1c]
cmp eax, esi
jbe 0x405e7e
test eax, eax
mov dword [esp + 0x24], esi
jbe 0x405e7e
mov eax, dword [esp + 0x14]
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x50]
push edx
push esi
push eax
mov dword [esp + 0x30], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x405e6d
lea ecx, [esp + 0x28]
push ecx
push 0x20019
push eax
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x48]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405e6d
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x144]
push edx
lea eax, [esp + 0x28]
push eax
push 0
push 0x4177a8
push ecx
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405e5e
cmp dword [esp + 0x20], 1
jne 0x405e5e
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x405e5e
push 0x104
lea edx, [esp + 0x248]
push edx
lea eax, [esp + 0x148]
push str.Server_Name
push eax
call fcn.004025f0
add esp, 0x10
test eax, eax
jle 0x405e5e
mov ecx, dword [esp + 0x450]
push ecx
lea edx, [esp + 0x248]
push edx
call fcn.0040c75e
add esp, 8
test eax, eax
jne 0x405e5e
lea eax, [esp + 0x3c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405e08
sub eax, edx
mov esi, eax
lea eax, [esi + ebp + 2]
cmp eax, ebx
jle 0x405e39
lea ebx, [ebx + esi + 2]
push ebx
push edi
call fcn.0040cca3
add esp, 8
test eax, eax
je 0x405e39
mov edi, eax
mov dword [esp + 0x18], 0xfffffff3
jmp 0x405e5e
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x405e5e
lea eax, [esp + 0x3c]
mov edx, eax
mov ecx, edi
sub ecx, edx
lea edx, [ecx + ebp]
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x405e50
lea ebp, [esi + ebp + 1]
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
inc esi
cmp esi, eax
mov dword [esp + 0x24], esi
jb 0x405d23
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x454]
lea edx, [esp + 0x14]
push edx
push 0x20019
push 0
push str.SystemCurrentControlSetServicesVxDKaseya
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405f9a
lea eax, [esp + 0x10]
push eax
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x144]
push ecx
lea edx, [esp + 0x28]
push edx
push 0
push 0x4177a8
push eax
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405f8f
cmp dword [esp + 0x20], 1
jne 0x405f8f
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x405f8f
push 0x104
lea ecx, [esp + 0x248]
push ecx
lea edx, [esp + 0x148]
push str.Server_Name
push edx
call fcn.004025f0
add esp, 0x10
test eax, eax
jle 0x405f8f
mov eax, dword [esp + 0x450]
push eax
lea ecx, [esp + 0x248]
push ecx
call fcn.0040c75e
add esp, 8
test eax, eax
jne 0x405f8f
lea edx, [ebp + 8]
cmp edx, ebx
jle 0x405f65
add ebx, 8
push ebx
push edi
call fcn.0040cca3
add esp, 8
test eax, eax
je 0x405f65
mov edi, eax
mov dword [esp + 0x18], 0xfffffff3
jmp 0x405f8f
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x405f8f
mov ecx, dword [str.Legacy]
lea eax, [edi + ebp]
mov dword [eax], ecx
mov dx, word [0x417820]
mov word [eax + 4], dx
mov cl, byte [0x417822]
mov byte [eax + 6], cl
add ebp, 7
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebp, ebp
jle 0x405fb3
mov eax, dword [esp + 0x18]
mov byte [edi + ebp], 0
mov dword [esi], edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x43c
ret
push edi
call fcn.0040bf42
mov eax, dword [esp + 0x1c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x43c
ret
pop esi
pop ebp
mov eax, 0xfffffff7
pop ebx
add esp, 0x43c
ret