Function at 0x40bf20
Capabilities:
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x664
mov eax, dword [0x42f060]
xor eax, ebp
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x664], ecx
mov dword [ebp - 4], 0
lea eax, [ebp - 4]
push eax
push 0
push 0
push 2
mov ecx, dword [ebp + 8]
push ecx
call sub.WINSPOOL.DRV_GetPrinterW
mov edx, dword [ebp - 4]
push edx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x650], eax
mov eax, dword [ebp - 0x650]
mov dword [ebp - 8], eax
mov ecx, dword [ebp + 0xc]
movzx edx, word [ecx + 0x44]
mov eax, dword [ebp + 0xc]
movzx ecx, word [eax + 0x46]
add edx, ecx
push edx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x654], eax
mov edx, dword [ebp - 0x654]
mov dword [ebp - 0xc], edx
lea eax, [ebp - 4]
push eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 8]
push edx
push 2
mov eax, dword [ebp + 8]
push eax
call sub.WINSPOOL.DRV_GetPrinterW
test eax, eax
je 0x40c238
push 0xa
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0xc]
push edx
push 0
mov eax, dword [ebp + 8]
push eax
push 0
call sub.WINSPOOL.DRV_DocumentPropertiesW
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
mov dword [ecx + 0x1c], edx
push 0
mov eax, dword [ebp - 8]
push eax
push 2
mov ecx, dword [ebp + 8]
push ecx
call sub.WINSPOOL.DRV_SetPrinterW
test eax, eax
je 0x40bff9
push str.SetDevModeW___success_n
call fcn.00413880
add esp, 4
jmp 0x40c00d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetPrinterW___error__d_n
call fcn.00413880
add esp, 8
push 4
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x658], eax
mov edx, dword [ebp - 0x658]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
mov dword [eax], ecx
push 0
mov edx, dword [ebp - 0x10]
push edx
push 8
mov eax, dword [ebp + 8]
push eax
call sub.WINSPOOL.DRV_SetPrinterW
test eax, eax
je 0x40c052
push str.SetDevModeW___Set_Global___success_n
call fcn.00413880
add esp, 4
jmp 0x40c066
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetPrinterW___Set_Global___error__d_n
call fcn.00413880
add esp, 8
mov ecx, dword [ebp - 0x664]
add ecx, 0x226
push ecx
push str.SYSTEMCurrentControlSetControlPrintPrinters
push 0x428d14
lea edx, [ebp - 0x418]
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
mov eax, dword [ebp - 0x664]
add eax, 0x226
push eax
push str.PrintersDevModePerUser
push 0x80000001
mov ecx, dword [ebp - 0x664]
call fcn.0040c720
xor ecx, ecx
je 0x40c236
mov dword [ebp - 0x41c], 0
mov edx, dword [ebp - 0x664]
movzx eax, byte [edx + 0x219]
test eax, eax
je 0x40c148
mov ecx, dword [ebp - 0x664]
add ecx, 0x226
push ecx
lea edx, [ebp - 0x628]
push edx
call fcn.00415af0
add esp, 8
push 0x5c
lea eax, [ebp - 0x628]
push eax
call fcn.004017a0
add esp, 8
mov dword [ebp - 0x62c], eax
cmp dword [ebp - 0x62c], 0
je 0x40c118
xor ecx, ecx
mov edx, dword [ebp - 0x62c]
mov word [edx], cx
lea eax, [ebp - 0x628]
push eax
push str.OpenSCManager_on_Remote_Host_____s__n
call fcn.004139d0
add esp, 8
push 0xf003f
push 0
lea ecx, [ebp - 0x628]
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x41c], eax
jmp 0x40c15d
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x41c], eax
cmp dword [ebp - 0x41c], 0
je 0x40c236
push str.Got_the_SCManager_handle_n
call fcn.00413880
add esp, 4
push 0x30
push str.Spooler
mov edx, dword [ebp - 0x41c]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x630], eax
cmp dword [ebp - 0x630], 0
je 0x40c215
push str.Got_the_Print_Spooler_handle_n
call fcn.00413880
add esp, 4
push 0x1c
push 0
lea eax, [ebp - 0x64c]
push eax
call fcn.00416110
add esp, 0xc
lea ecx, [ebp - 0x64c]
push ecx
push 1
mov edx, dword [ebp - 0x630]
push edx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x40c1f2
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
mov eax, dword [ebp - 0x630]
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
jmp 0x40c206
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Fail_on_ControlService____ld_n
call fcn.00413880
add esp, 8
mov ecx, dword [ebp - 0x630]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40c229
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Fail_to_get_the_spooler_handle____ld_n
call fcn.00413880
add esp, 8
mov edx, dword [ebp - 0x41c]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40c24c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetPrinterW___error__d_n
call fcn.00413880
add esp, 8
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x65c], eax
mov ecx, dword [ebp - 0x65c]
push ecx
call fcn.00415ab7
add esp, 4
mov edx, dword [ebp - 8]
mov dword [ebp - 0x660], edx
mov eax, dword [ebp - 0x660]
push eax
call fcn.00415ab7
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00415aa8
mov esp, ebp
pop ebp
ret 8