Function at 0x416774
Capabilities:
Modify service
Query service configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff54
push ebx
push esi
push edi
mov dword [ebp - 0x74], eax
mov eax, 0x5a6558
call fcn.0057c5c8
xor edx, edx
mov dword [ebp - 0x78], edx
xor ecx, ecx
mov dword [ebp - 0x7c], ecx
mov byte [ebp - 0x81], 1
mov word [ebp - 0x60], 8
push 0xf003f
push 0
push 0
call sub.advapi32.dll_OpenSCManagerA
mov dword [ebp - 0x78], eax
push 0xf01ff
push 0x5a5826
push dword [ebp - 0x78]
call sub.advapi32.dll_OpenServiceA
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
jne 0x416830
call sub.kernel32.dll_GetLastError
mov dword [ebp - 0x80], eax
cmp dword [ebp - 0x80], 0x424
jne 0x4167ed
mov byte [ebp - 0x81], 0
jmp 0x416a14
push 0x10
mov ecx, 0x5a5867
mov edx, 0x5a5835
mov eax, dword [sym.imp.vcl60.bpl__Forms_Application]
mov eax, dword [eax]
call fcn.0058f760
xor eax, eax
push eax
xor edx, edx
mov dword [ebp - 0x54], edx
lea ecx, [ebp - 0x70]
push ecx
call sub.CC3260MT.DLL___Return_unwind
pop ecx
pop eax
jmp 0x416cf6
xor edx, edx
mov dword [ebp - 0x8c], edx
mov word [ebp - 0x60], 8
push 0x1000
push 0x40
call sub.kernel32.dll_LocalAlloc
mov dword [ebp - 0x8c], eax
lea ecx, [ebp - 0x88]
push ecx
push 0x1000
push dword [ebp - 0x8c]
push dword [ebp - 0x7c]
call sub.advapi32.dll_QueryServiceConfigA
mov word [ebp - 0x60], 0x20
mov eax, dword [ebp - 0x8c]
mov edx, dword [eax + 0xc]
lea eax, [ebp - 0xc]
call fcn.0058f82c
inc dword [ebp - 0x54]
mov word [ebp - 0x60], 0x14
mov word [ebp - 0x60], 0x2c
lea eax, [ebp - 0x14]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
mov ecx, dword [sym.imp.vcl60.bpl__Forms_Application]
mov eax, dword [ecx]
call sub.vcl60.bpl__Forms_TApplication_GetExeName_qqrv
lea edx, [ebp - 0x14]
push dword [edx]
lea eax, [ebp - 0x18]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
pop eax
call sub.rtl60.bpl__Sysutils_ExtractFilePath_qqrx17System_AnsiString
lea edx, [ebp - 0x18]
push edx
lea eax, [ebp - 0x10]
call fcn.004025f4
push eax
inc dword [ebp - 0x54]
mov edx, 0x5a586c
lea eax, [ebp - 0x1c]
call fcn.0058f82c
inc dword [ebp - 0x54]
lea edx, [ebp - 0x1c]
pop ecx
pop eax
call fcn.0058fb5c
dec dword [ebp - 0x54]
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x18]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.0058fb04
mov word [ebp - 0x60], 0x14
mov word [ebp - 0x60], 0x38
lea eax, [ebp - 0x20]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
mov eax, dword [ebp - 0xc]
call sub.rtl60.bpl__Sysutils_ExtractFilePath_qqrx17System_AnsiString
lea edx, [ebp - 0x20]
push edx
lea eax, [ebp - 0x24]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
pop eax
call fcn.0058fe88
lea edx, [ebp - 0x24]
push edx
lea eax, [ebp - 0x28]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
lea eax, [ebp - 0x10]
call fcn.0058fe88
lea edx, [ebp - 0x28]
pop eax
call fcn.0058fe64
test eax, eax
setle dl
and edx, 1
push edx
dec dword [ebp - 0x54]
lea eax, [ebp - 0x28]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x20]
mov edx, 2
call fcn.0058fb04
pop ecx
test cl, cl
jne 0x4169ee
mov al, 1
push eax
dec dword [ebp - 0x54]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.0058fb04
pop eax
push eax
xor edx, edx
mov dword [ebp - 0x54], edx
lea ecx, [ebp - 0x70]
push ecx
call sub.CC3260MT.DLL___Return_unwind
pop ecx
pop eax
jmp 0x416cf6
dec dword [ebp - 0x54]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.0058fb04
mov word [ebp - 0x60], 8
mov word [ebp - 0x60], 0
cmp dword [ebp - 0x7c], 0
je 0x416a28
push dword [ebp - 0x7c]
call sub.advapi32.dll_CloseServiceHandle
cmp dword [ebp - 0x78], 0
je 0x416a36
push dword [ebp - 0x78]
call sub.advapi32.dll_CloseServiceHandle
cmp word [ebp - 0x5e], 0
je 0x416a3e
ret
mov word [ebp - 0x60], 0x50
lea eax, [ebp - 0x2c]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
mov ecx, dword [sym.imp.vcl60.bpl__Forms_Application]
mov eax, dword [ecx]
call sub.vcl60.bpl__Forms_TApplication_GetExeName_qqrv
lea edx, [ebp - 0x2c]
push dword [edx]
lea eax, [ebp - 0x30]
call fcn.004025f4
mov edx, eax
inc dword [ebp - 0x54]
pop eax
call sub.rtl60.bpl__Sysutils_ExtractFilePath_qqrx17System_AnsiString
lea edx, [ebp - 0x30]
push edx
lea eax, [ebp - 4]
call fcn.004025f4
push eax
inc dword [ebp - 0x54]
mov edx, 0x5a5877
lea eax, [ebp - 0x34]
call fcn.0058f82c
inc dword [ebp - 0x54]
lea edx, [ebp - 0x34]
pop ecx
pop eax
call fcn.0058fb5c
dec dword [ebp - 0x54]
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x30]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x2c]
mov edx, 2
call fcn.0058fb04
mov word [ebp - 0x60], 0x44
mov word [ebp - 0x60], 0x5c
lea eax, [ebp - 8]
call fcn.004025f4
inc dword [ebp - 0x54]
mov word [ebp - 0x60], 0x44
mov eax, dword [ebp - 4]
call sub.rtl60.bpl__Sysutils_SetCurrentDir_qqrx17System_AnsiString
cmp byte [ebp - 0x81], 0
je 0x416b92
mov word [ebp - 0x60], 0x68
lea eax, [ebp - 0x38]
call fcn.004025f4
mov ecx, eax
inc dword [ebp - 0x54]
lea edx, [ebp - 4]
mov eax, 0x5a5881
call fcn.0059021c
lea edx, [ebp - 0x38]
push edx
lea eax, [ebp - 0x40]
call fcn.004025f4
push eax
inc dword [ebp - 0x54]
mov edx, 0x5a5883
lea eax, [ebp - 0x3c]
call fcn.0058f82c
inc dword [ebp - 0x54]
lea edx, [ebp - 0x3c]
pop ecx
pop eax
call fcn.0058fb5c
lea edx, [ebp - 0x40]
lea eax, [ebp - 8]
call fcn.0058fb34
dec dword [ebp - 0x54]
lea eax, [ebp - 0x40]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x3c]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x38]
mov edx, 2
call fcn.0058fb04
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x74]
call fcn.00416654
mov word [ebp - 0x60], 0x74
lea eax, [ebp - 0x44]
call fcn.004025f4
mov ecx, eax
inc dword [ebp - 0x54]
lea edx, [ebp - 4]
mov eax, 0x5a589b
call fcn.0059021c
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x4c]
call fcn.004025f4
push eax
inc dword [ebp - 0x54]
mov edx, 0x5a589d
lea eax, [ebp - 0x48]
call fcn.0058f82c
inc dword [ebp - 0x54]
lea edx, [ebp - 0x48]
pop ecx
pop eax
call fcn.0058fb5c
lea edx, [ebp - 0x4c]
lea eax, [ebp - 8]
call fcn.0058fb34
dec dword [ebp - 0x54]
lea eax, [ebp - 0x4c]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x48]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.0058fb04
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x74]
call fcn.00416654
mov word [ebp - 0x60], pe_nt_image_headers32
push 0xf003f
push 0
push 0
call sub.advapi32.dll_OpenSCManagerA
mov dword [ebp - 0x78], eax
push 0xf01ff
push 0x5a58b3
push dword [ebp - 0x78]
call sub.advapi32.dll_OpenServiceA
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
je 0x416c93
mov ecx, dword [sym.SDERPServer.exe__ServerMainForm]
mov eax, dword [ecx]
mov eax, dword [eax + 0x3d4]
mov edx, dword [eax]
call dword [edx + 0xc4]
test al, al
je 0x416c8a
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push 2
push 0xffffffffffffffff
push dword [ebp - 0x7c]
call sub.advapi32.dll_ChangeServiceConfigA
mov byte [ebp - 0x8d], 1
jmp 0x416c9a
mov byte [ebp - 0x8d], 0
mov word [ebp - 0x60], 0x44
cmp dword [ebp - 0x7c], 0
je 0x416cae
push dword [ebp - 0x7c]
call sub.advapi32.dll_CloseServiceHandle
cmp dword [ebp - 0x78], 0
je 0x416cbc
push dword [ebp - 0x78]
call sub.advapi32.dll_CloseServiceHandle
cmp word [ebp - 0x5e], 0
je 0x416cc4
ret
mov al, byte [ebp - 0x8d]
push eax
dec dword [ebp - 0x54]
lea eax, [ebp - 8]
mov edx, 2
call fcn.0058fb04
dec dword [ebp - 0x54]
lea eax, [ebp - 4]
mov edx, 2
call fcn.0058fb04
pop eax
mov edx, dword [ebp - 0x70]
mov dword fs:[0], edx
mov edi, dword [ebp - 0xb8]
mov esi, dword [ebp - 0xb4]
mov ebx, dword [ebp - 0xb0]
mov esp, ebp
pop ebp
ret