Function at 0x404660
Capabilities:
Get file size
Persist via run registry key
Query or enumerate registry key
Query or enumerate registry value
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x564
mov eax, dword [str._q_]
push ebx
xor eax, ebp
push esi
mov esi, ecx
mov dword [esp + 0x568], eax
mov eax, dword [esi + 0x1c]
push edi
xor edi, edi
xor ebx, ebx
cmp eax, edi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], 1
mov dword [esp + 0xc], 0x104
mov dword [esp + 0x1c], edi
jne 0x4046ba
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x560]
xor ecx, ebp
call fcn.0040f175
mov esp, ebp
pop ebp
ret
mov ecx, esi
call fcn.00404210
mov dword [esi + 0x58], eax
mov eax, dword [esi + 0x1c]
push eax
push str.SOFTWAREKaseyaAgent
lea ecx, [esp + 0x48]
push str._s_s
push ecx
mov dword [esp + 0x20], edi
call fcn.0040f6f9
lea edx, [esp + 0x50]
push edx
call fcn.00410113
add esp, 0x14
lea ecx, [esp + 0x10]
push ecx
push 0x20019
push edi
push eax
push 0x80000002
mov dword [esi + 0x48], eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4048af
lea edx, [esp + 0xc]
push edx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x14c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push edi
push str.Title
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40476d
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x404744
cmp eax, 2
jne 0x40476d
cmp dword [esp + 0xc], edi
jbe 0x40476d
mov eax, dword [esi + 0x44]
cmp eax, edi
je 0x40475a
push eax
call fcn.0040f5cf
add esp, 4
lea eax, [esp + 0x148]
push eax
call fcn.00410113
add esp, 4
mov dword [esi + 0x44], eax
lea ecx, [esp + 0xc]
push ecx
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x44]
push edx
lea eax, [esp + 0x1c]
push eax
push edi
push str.Path
mov ebx, 0x104
push ecx
mov dword [esp + 0x2c], 1
mov dword [esp + 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4047d6
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x4047b0
cmp eax, 2
jne 0x4047d6
cmp dword [esp + 0xc], edi
jbe 0x4047d6
mov eax, dword [esi + 0x24]
cmp eax, edi
je 0x4047c6
push eax
call fcn.0040f5cf
add esp, 4
lea edx, [esp + 0x40]
push edx
call fcn.00410113
add esp, 4
mov dword [esi + 0x24], eax
lea eax, [esp + 0xc]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x254]
push ecx
lea edx, [esp + 0x1c]
push edx
push edi
push str.Provider
push eax
mov dword [esp + 0x2c], 1
mov dword [esp + 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x404840
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x404817
cmp eax, 2
jne 0x404840
cmp dword [esp + 0xc], edi
jbe 0x404840
mov eax, dword [esi + 0x20]
cmp eax, edi
je 0x40482d
push eax
call fcn.0040f5cf
add esp, 4
lea ecx, [esp + 0x250]
push ecx
call fcn.00410113
add esp, 4
mov dword [esi + 0x20], eax
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [esi + 4], edi
jne 0x404857
mov dword [esi + 0x40], 1
cmp dword [esi + 0x40], edi
mov ebx, 1
mov dword [esp + 0x24], ebx
je 0x4048ac
cmp dword [esi + 8], edi
je 0x4048ac
lea eax, [esp + 0x18]
push eax
mov ecx, esi
mov dword [esi + 8], edi
mov dword [esp + 0x1c], edi
call fcn.00404550
test eax, eax
je 0x4048af
mov ecx, dword [esi + 0x24]
mov edi, dword [esp + 0x18]
push ecx
push edi
call fcn.004106a2
add esp, 8
test eax, eax
jne 0x40489f
mov eax, ebx
mov dword [esi + 8], eax
mov dword [esp + 0x1c], eax
push edi
call fcn.0040f5cf
add esp, 4
xor edi, edi
jmp 0x4048af
mov dword [esi + 8], edi
cmp dword [esi + 8], edi
je 0x4049b2
cmp dword [esp + 0x1c], edi
jne 0x4049b2
cmp dword [esi + 0x40], edi
mov dword [esi + 8], edi
jne 0x4049b2
cmp dword [esi + 4], edi
jne 0x4049b2
cmp dword [esi + 0x54], edi
mov eax, str.SoftwareMicrosoftWindowsCurrentVersionRunServices
jne 0x4048e6
mov eax, str.SYSTEMCurrentControlSetServicesKaseyaAgent
lea edx, [esp + 0x10]
push edx
push 0x20019
push edi
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4049b2
mov eax, dword [esi + 0x54]
mov ebx, 1
cmp eax, edi
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], 0x104
mov eax, str.KaseyaAgent
jne 0x404927
mov eax, str.ImagePath
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x44]
push edx
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push ecx
push edi
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40499b
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x404954
cmp eax, 2
jne 0x40499b
cmp dword [esp + 0xc], edi
jbe 0x40499b
lea eax, [esp + 0x40]
push 0x5c
push eax
call fcn.0040f216
add esp, 8
cmp eax, edi
je 0x40499b
mov byte [eax], 0
mov eax, dword [esi + 0x24]
cmp eax, edi
je 0x404980
push eax
call fcn.0040f5cf
add esp, 4
cmp byte [esp + 0x40], 0x22
lea eax, [esp + 0x41]
je 0x40498f
lea eax, [esp + 0x40]
push eax
call fcn.00410113
add esp, 4
mov dword [esi + 0x24], eax
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esi + 8], ebx
mov dword [esi + 0x40], ebx
mov dword [esp + 0x24], ebx
jmp 0x4049bc
cmp ebx, edi
jl 0x404d98
xor edi, edi
cmp dword [esi + 0x40], edi
jne 0x404c62
mov eax, dword [esi + 4]
test eax, eax
jne 0x404c74
mov eax, dword [esi + 0x44]
mov dword [esp + 0x1c], 0
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4049e0
push str.KaseyaAgent
sub eax, edx
push str.SystemCurrentControlSetServices
lea edx, [esp + 0x48]
push str._s_s
push edx
mov ebx, eax
call fcn.0040f6f9
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
add esp, 0x10
lea eax, [esp + 0x10]
push eax
push 0x20019
push 0
lea ecx, [esp + 0x4c]
push ecx
push 0x80000002
call edi
test eax, eax
jne 0x404a85
lea edx, [esp + 0xc]
push edx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x35c]
push eax
lea ecx, [esp + 0x28]
push ecx
push 0
push str.DisplayName
push edx
mov dword [esp + 0x38], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x404a7a
mov eax, dword [esi + 0x44]
push ebx
push eax
lea eax, [esp + 0x360]
push eax
call fcn.0040f460
add esp, 0xc
test eax, eax
jne 0x404a7a
mov dword [esp + 0x1c], 1
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea edx, [esp + 0x10]
push edx
push 0x20019
push 0
push str.SOFTWAREKaseyaAgent
push 0x80000002
call edi
test eax, eax
jne 0x404c25
push eax
push eax
mov dword [esp + 0x20], eax
lea eax, [esp + 0x44]
push eax
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x48]
push edx
mov edx, dword [esp + 0x24]
push 0
lea eax, [esp + 0x48]
push eax
lea ecx, [esp + 0x34]
push ecx
push 0
push 0
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x404c1a
xor edi, edi
test eax, eax
mov dword [esp + 0x20], edi
jbe 0x404c1a
mov edx, dword [esp + 0x10]
push 0
push 0
push 0
push 0
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x474]
push ecx
push edi
push edx
mov dword [esp + 0x2c], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x404c09
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x28]
push eax
push 0x20019
push 0
lea ecx, [esp + 0x46c]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x404c09
lea eax, [esp + 0xc]
push eax
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0x14c]
push ecx
lea edx, [esp + 0x1c]
push edx
push 0
push str.Title
mov edi, 1
push eax
mov dword [esp + 0x2c], edi
mov dword [esp + 0x24], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x404bfa
cmp dword [esp + 0x14], edi
jne 0x404bfa
mov eax, dword [esp + 0xc]
test eax, eax
jbe 0x404bfa
mov eax, dword [esi + 0x44]
push ebx
push eax
lea ecx, [esp + 0x150]
push ecx
call fcn.0040f460
add esp, 0xc
test eax, eax
jne 0x404bfa
mov cl, byte [esp + ebx + 0x148]
lea eax, [esp + ebx + 0x148]
xor edi, edi
test cl, cl
jne 0x404bc4
mov edi, 1
jmp 0x404bf0
push 0x23
push eax
call fcn.0040ffe6
add esp, 8
test eax, eax
je 0x404bf0
lea edx, [esp + 0x2c]
push edx
inc eax
push 0x41bbbc
push eax
call fcn.00410195
add esp, 0xc
cmp eax, 1
jne 0x404bf0
mov edi, dword [esp + 0x2c]
cmp edi, dword [esp + 0x1c]
jle 0x404bfa
mov dword [esp + 0x1c], edi
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
inc edi
cmp edi, eax
mov dword [esp + 0x20], edi
jb 0x404af1
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x1c]
inc eax
cmp eax, 1
jle 0x404c62
mov edx, dword [esi + 0x44]
push eax
push edx
lea eax, [esp + 0x150]
push str._s__d
push eax
call fcn.0040f6f9
mov ecx, dword [esi + 0x44]
push ecx
call fcn.0040f5cf
lea edx, [esp + 0x15c]
push edx
call fcn.00410113
add esp, 0x18
mov dword [esi + 0x44], eax
mov eax, dword [esi + 4]
test eax, eax
jne 0x404c74
mov eax, dword [esi + 0x40]
test eax, eax
je 0x404d98
mov eax, dword [esi + 0x24]
test eax, eax
je 0x404d98
push eax
lea eax, [esp + 0x44]
push str._sKaseyaD.ini
push eax
call fcn.0040f6f9
add esp, 0xc
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea ecx, [esp + 0x58]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
je 0x404d98
push 0
mov edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
lea eax, [edi + 1]
push eax
call fcn.0040f6e7
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x404d77
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x34]
push ecx
push edi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404d6c
push str.Agent_Temp_Dir
push ebx
mov byte [ebx + edi], 0
call fcn.00410061
mov edx, eax
add esp, 8
test edx, edx
je 0x404d6c
mov al, byte [edx + 0xe]
add edx, 0xe
test al, al
je 0x404d30
lea esp, [esp]
cmp al, 0x20
je 0x404d28
cmp al, 9
jne 0x404d30
mov al, byte [edx + 1]
inc edx
test al, al
jne 0x404d20
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
xor ecx, ecx
nop
mov al, byte [edx]
cmp al, 0xd
je 0x404d5c
cmp al, 0xa
je 0x404d5c
test al, al
je 0x404d5c
inc edx
mov byte [esp + ecx + 0x40], al
inc ecx
cmp ecx, 0x103
jl 0x404d40
lea eax, [esp + 0x40]
push eax
call fcn.00410113
add esp, 4
mov dword [esi + 0x50], eax
push ebx
call fcn.0040f5cf
add esp, 4
jmp 0x404d8d
push str.Out_of_memory_
push esi
call fcn.00404120
add esp, 8
mov dword [esp + 0x24], 0xffffffff
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x56c]
mov eax, dword [esp + 0x24]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f175
mov esp, ebp
pop ebp
ret