Function at 0x40bd80
Capabilities:
Delete registry value
Get common file path

Disassembly:
sub esp, 0x31c
mov eax, dword [str._q_]
xor eax, esp
push ebp
mov dword [esp + 0x31c], eax
push 0x104
lea eax, [esp + 0x21c]
push eax
mov ebp, ecx
mov byte [esp + 0x220], 0
call fcn.0040a440
mov al, byte [esp + 0x218]
test al, al
lea eax, [esp + 0x218]
jne 0x40bdc8
mov eax, str.Unknown
mov ecx, dword [ebp]
push eax
push str.Agent_owns_drivers:__s
push ecx
call fcn.00404120
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
add esp, 0xc
test ecx, ecx
je 0x40c055
mov eax, dword [eax + 0x1c]
push eax
lea edx, [esp + 0x21c]
push edx
call fcn.0040f315
add esp, 8
test eax, eax
jne 0x40c055
mov eax, dword [ebp]
push str.Removing_drivers...
push eax
call fcn.00404120
add esp, 8
lea ecx, [esp + 4]
push ecx
push 0x20006
push 0
push str.SOFTWAREKaseyaAgent
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40be5c
mov edx, dword [esp + 4]
push str.DriverControl
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
test eax, eax
je 0x40be4f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40be62
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp]
mov eax, dword [ecx + 0x54]
test eax, eax
je 0x40beac
push 0x104
lea edx, [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push str.KaseyaD.VXD
lea eax, [esp + 0x14]
push eax
mov ecx, ebp
call fcn.0040b210
mov ecx, ebp
call fcn.0040bb80
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x318]
xor ecx, esp
call fcn.0040f175
add esp, 0x31c
ret
push edi
call fcn.0040d120
test eax, eax
je 0x40bfeb
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
mov dword [esp + 0xc], eax
je 0x40c054
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push esi
push str.Wow64DisableWow64FsRedirection
push eax
call edi
mov ecx, dword [esp + 0x10]
push str.Wow64RevertWow64FsRedirection
push ecx
mov esi, eax
call edi
test esi, esi
mov dword [esp + 0x14], eax
je 0x40bfdd
test eax, eax
je 0x40bfdd
lea edx, [esp + 0xc]
push edx
mov dword [esp + 0x10], 0
call esi
test eax, eax
je 0x40bfce
push 0x104
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea edi, [esp + 0x18]
dec edi
mov edi, edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40bf30
mov ecx, dword [str.System32]
mov edx, dword [0x41cba4]
mov ax, word [0x41cba8]
mov dword [edi], ecx
mov dword [edi + 4], edx
mov word [edi + 8], ax
xor eax, eax
jmp 0x40bf60
mov cl, byte [esp + eax + 0x18]
mov byte [esp + eax + 0x11c], cl
inc eax
test cl, cl
jne 0x40bf60
lea edi, [esp + 0x11c]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40bf78
mov ecx, dword [str.drivers]
mov edx, dword [0x41cb8c]
mov al, byte [0x41cb90]
mov dword [edi], ecx
push str.KAPFA.sys
lea ecx, [esp + 0x120]
mov dword [edi + 4], edx
push ecx
mov ecx, ebp
mov byte [edi + 8], al
call fcn.0040b210
mov ecx, ebp
call fcn.0040bb80
lea edx, [esp + 0xc]
push edx
call dword [esp + 0x18]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop esi
jmp 0x40c054
mov ecx, dword [ebp]
push str.Failed_to_disable_folder_redirection.
push 0
call fcn.004041b0
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop esi
jmp 0x40c054
push 0x104
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
xor eax, eax
lea ecx, [ecx]
mov cl, byte [esp + eax + 0x14]
mov byte [esp + eax + 0x118], cl
inc eax
test cl, cl
jne 0x40c000
lea edi, [esp + 0x118]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40c018
mov edx, dword [str.drivers]
mov eax, dword [0x41cb8c]
mov cl, byte [0x41cb90]
mov dword [edi], edx
mov dword [edi + 4], eax
push str.KAPFA.sys
lea edx, [esp + 0x11c]
mov byte [edi + 8], cl
push edx
mov ecx, ebp
call fcn.0040b210
mov ecx, ebp
call fcn.0040bb80
pop edi
mov ecx, dword [esp + 0x31c]
pop ebp
xor ecx, esp
xor eax, eax
call fcn.0040f175
add esp, 0x31c
ret