Function at 0x40c7c0
Capabilities:
Create service
Modify service

Disassembly:
sub esp, 0x128
push ebx
lea ebx, [esp + 0xc]
mov dword [esp + 8], 3
call fcn.0040c560
test eax, eax
jge 0x40c7e7
or eax, 0xffffffff
pop ebx
add esp, 0x128
ret
mov eax, dword [esp + 0x130]
push esi
push eax
push 0x425738
call dword [sym.imp.python32.dll_Py_BuildValue]
mov esi, eax
add esp, 8
test esi, esi
jne 0x40c818
push 0x42573c
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop esi
pop ebx
add esp, 0x128
ret
mov ecx, dword [esp + 0x18]
push ebp
push edi
mov edi, dword [sym.imp.python32.dll_PyUnicodeUCS2_Format]
push esi
push ecx
call edi
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x40c847
push 0x425760
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
mov edx, dword [esp + 0x24]
push esi
push edx
call edi
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x40c86e
push str.cannot_create_display_name
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
mov eax, dword [sym.imp.MSVCR90.dll___argv]
mov ecx, dword [eax]
mov eax, dword [ecx]
mov edi, dword [sym.imp.python32.dll_PyUnicodeUCS2_FromFormat]
push eax
push 0x425798
call edi
mov esi, eax
add esp, 8
test esi, esi
jne 0x40c8a4
push str.cannot_create_command
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
mov eax, dword [esp + 0x140]
test eax, eax
je 0x40c918
push 0x105
push eax
lea edx, [esp + 0x38]
push edx
call dword [sym.imp.MSVCR90.dll__fullpath]
add esp, 0xc
test eax, eax
jne 0x40c8e4
push str.cannot_calculate_absolute_path_of_config_file_name
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call dword [sym.imp.cx_Logging.pyd_LogWin32Error]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
lea eax, [esp + 0x30]
push eax
push str.___s_
call edi
add esp, 8
test eax, eax
jne 0x40c90d
push str.cannot_create_command_args
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
push eax
push esi
call dword [sym.imp.python32.dll_PyUnicodeUCS2_Concat]
add esp, 8
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
test edi, edi
jne 0x40c94a
push 0x425830
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call dword [sym.imp.cx_Logging.pyd_LogWin32Error]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
cmp dword [esp + 0x2c], 0
mov eax, 2
jne 0x40c95a
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0xc]
mov edx, dword [ebx + 0xc]
push 0
push 0
push 0
push 0
push 0
push ecx
push 1
push eax
mov eax, dword [ebp + 0xc]
push 0x10
push 0xf01ff
push edx
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x40c9a4
push str.cannot_create_service
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call dword [sym.imp.cx_Logging.pyd_LogWin32Error]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40c9e2
mov ecx, dword [eax + 0xc]
lea edx, [esp + 0x10]
push edx
push 1
push esi
mov dword [esp + 0x1c], ecx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x40c9e2
push str.cannot_set_service_description
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call dword [sym.imp.cx_Logging.pyd_LogWin32Error]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
mov eax, dword [esp + 0x18]
push 0
push eax
call dword [sym.imp.python32.dll_PyObject_CallFunction]
add esp, 8
test eax, eax
jne 0x40ca18
push 0x425884
call dword [sym.imp.cx_Logging.pyd_LogPythonException]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x128
ret
add dword [eax], 0xffffffff
jne 0x40ca29
mov ecx, dword [eax + 4]
mov edx, dword [ecx + 0x18]
push eax
call edx
add esp, 4
pop edi
pop ebp
pop esi
xor eax, eax
pop ebx
add esp, 0x128
ret