Function at 0x4a9720
Capabilities:
Create service
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6cc3fb
mov eax, dword fs:[0]
push eax
sub esp, 0x234
mov eax, dword [0x80236c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x234], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x240], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x238], eax
xor eax, eax
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov dword [ebp - 4], eax
lea eax, [ebp - 0x218]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4a97c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.004a3e90
add esp, 8
jmp 0x4a9917
push 1
push 0x725300
lea ecx, [ebp - 0x230]
call fcn.0049d7d0
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4a97e4
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x230]
call fcn.004a9ae0
push 1
push 0x725300
lea ecx, [ebp - 0x230]
call fcn.004a9ae0
push 3
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x4a9843
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.004a3e90
add esp, 8
jmp 0x4a9917
push dword [ebp - 0x238]
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
push dword [ebp - 0x23c]
cmovae eax, dword [ebp - 0x230]
push dword [ebp - 0x240]
push 0
push 0
push eax
push 1
push dword [ebp - 0x234]
push 0x10
push 0xf01ff
push esi
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x4a98c4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateService_failed_w_err_0x_08lx_n
call fcn.004a3e90
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AGMSerice_Service_Install_Failed_...08lx
push esi
push 4
push str.AGCDirectoryWatcher
push dword [0x8084b0]
call fcn.004c1270
add esp, 0x18
jmp 0x4a9905
lea eax, [ebp - 0x234]
mov dword [ebp - 0x234], 0x7271a8
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
push ebx
push str._s_is_installed._n
call fcn.004a3e90
push str.AGMSerice_Service_Installed_...
push 0
push 4
push str.AGCDirectoryWatcher
push dword [0x8084b0]
call fcn.004c1270
add esp, 0x1c
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test esi, esi
je 0x4a9917
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x21c]
cmp edx, 8
jb 0x4a9953
mov ecx, dword [ebp - 0x230]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4a9949
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4a996f
push edx
push ecx
call fcn.00669b1d
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00669adc
mov esp, ebp
pop ebp
ret
call fcn.006892c4
int3