Function at 0x405c50
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 0x405fbb
mov esi, dword [esp + 0x450]
cmp esi, ebp
je 0x405fbb
push edi
push ebx
mov dword [esi], ebp
call fcn.0040c292
mov edi, eax
add esp, 4
test edi, edi
jne 0x405ca4
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 0x405e80
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 0x405e6e
test eax, eax
mov dword [esp + 0x24], esi
jbe 0x405e6e
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 0x405e5d
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 0x405e5d
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 0x417760
push ecx
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405e4e
cmp dword [esp + 0x20], 1
jne 0x405e4e
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x405e4e
push 0x104
lea edx, [esp + 0x248]
push edx
lea eax, [esp + 0x148]
push str.Server_Name
push eax
call fcn.004025e0
add esp, 0x10
test eax, eax
jle 0x405e4e
mov ecx, dword [esp + 0x450]
push ecx
lea edx, [esp + 0x248]
push edx
call fcn.0040c70e
add esp, 8
test eax, eax
jne 0x405e4e
lea eax, [esp + 0x3c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405df8
sub eax, edx
mov esi, eax
lea eax, [esi + ebp + 2]
cmp eax, ebx
jle 0x405e29
lea ebx, [ebx + esi + 2]
push ebx
push edi
call fcn.0040cccf
add esp, 8
test eax, eax
je 0x405e29
mov edi, eax
mov dword [esp + 0x18], 0xfffffff3
jmp 0x405e4e
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x405e4e
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 0x405e40
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 0x405d13
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 0x405f8a
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 0x417760
push eax
mov dword [esp + 0x28], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x405f7f
cmp dword [esp + 0x20], 1
jne 0x405f7f
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x405f7f
push 0x104
lea ecx, [esp + 0x248]
push ecx
lea edx, [esp + 0x148]
push str.Server_Name
push edx
call fcn.004025e0
add esp, 0x10
test eax, eax
jle 0x405f7f
mov eax, dword [esp + 0x450]
push eax
lea ecx, [esp + 0x248]
push ecx
call fcn.0040c70e
add esp, 8
test eax, eax
jne 0x405f7f
lea edx, [ebp + 8]
cmp edx, ebx
jle 0x405f55
add ebx, 8
push ebx
push edi
call fcn.0040cccf
add esp, 8
test eax, eax
je 0x405f55
mov edi, eax
mov dword [esp + 0x18], 0xfffffff3
jmp 0x405f7f
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x405f7f
mov ecx, dword [str.Legacy]
lea eax, [edi + ebp]
mov dword [eax], ecx
mov dx, word [0x4177d8]
mov word [eax + 4], dx
mov cl, byte [0x4177da]
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 0x405fa3
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.0040bef2
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