Function at 0x509140
Capabilities:
Accept command line arguments
Delete file
Get common file path

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x51baab
push eax
mov dword fs:[0], esp
sub esp, 0x838
mov eax, dword [esp + 0x848]
lea ecx, [esp + 0x220]
push ebx
push ebp
push esi
push edi
push 0x104
xor ebp, ebp
push ecx
push ebp
mov dword [0x5267c4], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.0050c763
lea edx, [esp + 0x234]
push edx
call fcn.0050bfd9
push 0x5c
push eax
mov dword [0x52680c], eax
call fcn.0050c082
add esp, 0x10
mov word [eax + 2], bp
call fcn.00508250
test al, al
jne 0x509564
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.WTSQuerySessionInformationW
push str.wtsapi32.dll
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call ebx
push str.WTSGetActiveConsoleSessionId
push str.kernel32.dll
mov esi, eax
call edi
push eax
call ebx
cmp esi, ebp
mov edi, eax
je 0x509235
lea eax, [esp + 0x24]
lea ecx, [esp + 0x18]
push eax
push ecx
push 4
push 0xffffffffffffffff
push ebp
call esi
test eax, eax
je 0x509235
mov edx, dword [esp + 0x18]
cmp dword [edx], ebp
je 0x509235
cmp edi, ebp
je 0x509235
call edi
mov ecx, dword [esp + 0x18]
cmp dword [ecx], eax
je 0x509235
push 0x10
push 0x520cac
push str.RootkitRevealer_must_be_run_from_the_console.
push ebp
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, 1
jmp 0x5095f6
lea edx, [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov esi, eax
mov eax, dword [esp + 0x10]
push esi
push eax
push ebp
call fcn.005083f0
add esp, 0xc
test al, al
jne 0x509266
mov eax, 1
jmp 0x5095f6
mov ebx, dword [sym.imp.KERNEL32.dll_CreateEventW]
push str.GlobalRKEvent
push ebp
push ebp
push ebp
call ebx
mov edi, eax
cmp edi, ebp
jne 0x509288
push str.RKEvent
push ebp
push ebp
push ebp
call ebx
mov edi, eax
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x230]
push edx
mov dword [esi + ecx*4], 0x521a3c
mov ecx, dword [esp + 0x14]
inc ecx
mov dword [esp + 0x14], ecx
call fcn.0050bfd9
mov ecx, dword [esp + 0x14]
push 0x5c
mov dword [esi + ecx*4], eax
mov edx, dword [esp + 0x18]
mov eax, dword [esi + edx*4]
push eax
call fcn.0050c082
mov word [eax + 2], bp
mov eax, dword [esp + 0x1c]
add esp, 0xc
inc eax
mov dword [esp + 0x10], eax
lea eax, [esp + 0x438]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea ecx, [esp + 0x438]
push str..exe
lea edx, [esp + 0x18]
push ecx
push edx
call fcn.00502990
add esp, 0xc
mov eax, dword [esp + 0x14]
mov dword [esp + 0x850], ebp
cmp eax, ebp
je 0x50930f
mov eax, dword [eax]
jmp 0x509311
xor eax, eax
push eax
lea eax, [esp + 0x234]
push eax
call fcn.004fe9b0
add esp, 8
test al, al
jne 0x50936e
push str.Error_copying_image_to_random_service_image_file
push ebp
call fcn.00503ec0
mov eax, dword [esp + 0x1c]
add esp, 8
cmp eax, ebp
mov dword [esp + 0x850], 0xffffffff
je 0x509364
mov esi, eax
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x509364
cmp esi, ebp
je 0x509364
push 1
mov ecx, esi
call fcn.004f98e0
mov eax, 1
jmp 0x5095f6
mov eax, dword [esp + 0x14]
cmp eax, ebp
je 0x50937a
mov eax, dword [eax]
jmp 0x50937c
xor eax, eax
push eax
call fcn.00509000
mov eax, dword [esp + 0x18]
add esp, 4
cmp eax, ebp
je 0x509391
mov eax, dword [eax]
jmp 0x509393
xor eax, eax
push 0x5c
push eax
call fcn.0050c082
add eax, 2
lea ecx, [esp + 0x30]
push eax
push ecx
call fcn.0050b20b
lea edx, [esp + 0x38]
push 0x2e
push edx
call fcn.0050b565
mov word [eax], bp
mov eax, dword [esp + 0x2c]
add esp, 0x18
cmp eax, ebp
je 0x5093c7
mov eax, dword [eax]
jmp 0x5093c9
xor eax, eax
mov ecx, dword [esp + 0x10]
push esi
lea edx, [esp + 0x2c]
push ecx
push edx
push eax
call fcn.00501fe0
add esp, 0x10
test al, al
jne 0x509444
push str.Unable_to_install_MalwareScan_____service
push ebp
call fcn.00503ec0
mov esi, dword [esp + 0x1c]
add esp, 8
cmp esi, ebp
mov dword [esp + 0x850], 0xffffffff
je 0x50943a
lea eax, [esi + 8]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x50943a
cmp esi, ebp
je 0x50943a
mov eax, dword [esi]
cmp eax, ebp
je 0x509421
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x509431
push eax
call fcn.0050b1c8
add esp, 4
push esi
call fcn.0050b1c8
add esp, 4
mov eax, 1
jmp 0x5095f6
push str.GlobalRKHelpEvent
push ebp
push ebp
push ebp
call ebx
cmp eax, ebp
jne 0x50945c
push str.RKHelpEvent
push ebp
push ebp
push ebp
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push 0xffffffffffffffff
lea ecx, [esp + 0x20]
push ebp
push ecx
push 2
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], eax
call esi
cmp eax, ebp
je 0x5094d4
mov edi, dword [sym.imp.USER32.dll_MessageBoxW]
mov edx, dword [0x52680c]
push 0x520cac
push edx
lea eax, [esp + 0x648]
push str._s_s.chm
push eax
call fcn.0050adff
add esp, 0x10
lea ecx, [esp + 0x640]
push ebp
push ebp
push ecx
push ebp
call fcn.0050acf0
test eax, eax
jne 0x5094c4
push 0x10
push 0x520cac
push str.Unable_to_open_help_file
push ebp
call edi
push 0xffffffffffffffff
lea edx, [esp + 0x20]
push ebp
push edx
push 2
call esi
cmp eax, ebp
jne 0x509480
lea eax, [esp + 0x28]
push eax
call fcn.00501f20
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 4
mov eax, dword [esp + 0x14]
cmp eax, ebp
je 0x5094f9
mov eax, dword [eax]
jmp 0x5094fb
xor eax, eax
push eax
call esi
test eax, eax
jne 0x509508
push 0x64
call edi
jmp 0x5094ed
mov esi, dword [esp + 0x14]
mov dword [esp + 0x850], 0xffffffff
cmp esi, ebp
je 0x5095f4
lea ecx, [esi + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x5095f4
cmp esi, ebp
je 0x5095f4
mov eax, dword [esi]
cmp eax, ebp
je 0x509546
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x509556
push eax
call fcn.0050b1c8
add esp, 4
push esi
call fcn.0050b1c8
add esp, 4
jmp 0x5095f4
mov al, byte [0x52681c]
test al, 1
jne 0x509594
or al, 1
lea edx, [esp + 0x28]
mov byte [0x52681c], al
mov dword [0x529580], edx
mov dword [0x529584], 0x508ef0
mov dword [0x529588], ebp
mov dword [0x52958c], ebp
call fcn.004fe8b0
lea eax, [esp + 0x230]
push 0x5c
push eax
call fcn.0050c082
add eax, 2
lea ecx, [esp + 0x30]
push eax
push ecx
call fcn.0050b20b
lea edx, [esp + 0x38]
push 0x2e
push edx
call fcn.0050b565
add esp, 0x18
mov word [eax], bp
lea eax, [esp + 0x28]
push 0x529580
mov dword [0x529580], eax
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x5095f4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error:_d_n
call fcn.0050ceb2
add esp, 8
xor eax, eax
mov ecx, dword [esp + 0x848]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x844
ret 0x10