Function at 0x40b3a0
Capabilities:
Create service
Delete file
Delete service
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24c
mov eax, dword [0x413284]
xor eax, ebp
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x224], 0
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0xffffffff
xor eax, eax
mov word [ebp - 0x220], ax
push 0x208
push 0
lea ecx, [ebp - 0x21e]
push ecx
call fcn.00401c50
add esp, 0xc
mov dword [ebp - 0x22c], 0
push 0x104
lea edx, [ebp - 0x220]
push edx
call fcn.0040b1b0
add esp, 8
mov dword [ebp - 0x22c], eax
cmp dword [ebp - 0x22c], 0
jne 0x40b441
push str.____ERROR:_Unable_to_extract_driver..._n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 8
jmp 0x40b5b4
push 2
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x224], eax
cmp dword [ebp - 0x224], 0
jne 0x40b483
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____ERROR_OpenSCManager_failed___u_n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 0xc
jmp 0x40b5b4
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x220]
push eax
push 0
push 3
push 1
push 0xf01ff
push str.ManTech_MemDd_Device_Driver
push 0x411580
mov ecx, dword [ebp - 0x224]
push ecx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40b4e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____ERROR:_CreateService_failed___u__n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 0xc
jmp 0x40b5b4
push 0
push 0
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40b51f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____ERROR:_StartService_failed___u__n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 0xc
jmp 0x40b5b4
push 0
push 0
push 3
push 0
push 1
push 0x10000000
push str..memdd
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x40b563
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____ERROR:_Failed_to_open_drivers_device_handle___u_n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 0xc
jmp 0x40b5b4
push 0
lea eax, [ebp - 0x230]
push eax
push 4
mov ecx, dword [ebp + 8]
push ecx
push 0
push 0
push 0x81246004
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40b5aa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____ERROR:_DeviceIoControl_failed__could_not_get_PhysicalMemory_section_handle___d_n
call fcn.0040120b
add eax, 0x40
push eax
call fcn.0040148e
add esp, 0xc
jmp 0x40b5b4
mov dword [ebp - 0x228], 1
cmp dword [ebp - 4], 0xffffffff
je 0x40b5c4
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 8], 0
je 0x40b621
lea ecx, [ebp - 0x24c]
push ecx
push 1
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40b5f5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____WARNING:_Failed_to_stop_driver__ControlService___u_n
call fcn.00401b8b
add esp, 8
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x40b617
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____WARNING:_DeleteService_failed___u_n
call fcn.00401b8b
add esp, 8
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x224], 0
je 0x40b637
mov edx, dword [ebp - 0x224]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
movzx eax, word [ebp - 0x220]
test eax, eax
je 0x40b677
cmp dword [ebp - 0x22c], 2
jge 0x40b677
lea ecx, [ebp - 0x220]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40b677
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x220]
push edx
push str.____WARNING:_DeleteFile_failed_for__S__u_n
call fcn.00401b8b
add esp, 0xc
mov eax, dword [ebp - 0x228]
mov ecx, dword [ebp - 0xc]
xor ecx, ebp
call fcn.004010b1
mov esp, ebp
pop ebp
ret