Function at 0x40f9f0
Capabilities:
Create service
Persist via windows service
Print debug messages

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xe68
mov eax, dword [0x420008]
xor eax, esp
mov dword [esp + 0xe64], eax
cmp dword [ebp + 8], 1
push esi
mov esi, dword [ebp + 0xc]
push edi
jle 0x40fc3d
mov ecx, dword [esi + 4]
movzx eax, word [ecx]
cmp eax, 0x2d
je 0x40fa2d
cmp eax, 0x2f
jne 0x40fc3d
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
lea eax, [ecx + 2]
push eax
push str.install
call edi
add esp, 8
test eax, eax
jne 0x40fbd9
push 0x104
lea eax, [esp + 0x25c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x40fa8c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x41b8c8
call fcn.00404ad0
add esp, 8
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0xe64]
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret
push 3
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
test esi, esi
jne 0x40fac8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.00404ad0
add esp, 8
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0xe64]
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0x419854
push 0
push 0
lea eax, [esp + 0x26c]
push eax
push 1
push 2
push 0x10
push 4
push str.ASUS_GiftBox_Service
push 0x41b530
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edx, 1
mov edi, eax
call fcn.00410cd0
test edi, edi
jne 0x40fb17
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateService_failed_w_err_0x_08lx_n
jmp 0x40fba7
push 0x104
lea eax, [esp + 0x464]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x800
lea eax, [esp + 0x66c]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x50]
push 0x208
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x460]
push eax
push 0x41b530
lea eax, [esp + 0x58]
push str.New_NetFirewallRule__Displayname__s__Program__s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [esp + 0x66c]
lea edx, [esp + 0x54]
push eax
call fcn.00404b50
add esp, 8
test eax, eax
je 0x40fb9d
lea eax, [esp + 0x668]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0x41b530
push str._s_is_installed._n
call fcn.00404ad0
add esp, 8
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
test edi, edi
je 0x40fd03
push edi
call esi
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0xe64]
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.remove
call edi
add esp, 8
test eax, eax
jne 0x40fc09
call fcn.00410ad0
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0xe64]
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.debug
call edi
add esp, 8
test eax, eax
jne 0x40fd03
call fcn.0040fd20
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0xe64]
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret
push 0x38
lea eax, [esp + 0xc]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [esp + 0xc], 0x41b530
lea eax, [esp + 8]
mov dword [esp + 0x2c], 0
mov dword [0x420d20], eax
lea eax, [esp + 0x40]
mov dword [esp + 0x10], 0x10
push eax
mov dword [esp + 0x18], 2
mov dword [esp + 0x1c], 0xc4
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0xc], vtable.CGiftBoxService.0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0x41b530
mov dword [esp + 0x48], 0x410190
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x40fcfa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Service_failed_to_run_w_err_0x_08lx_n
call fcn.00404ad0
add esp, 8
lea ecx, [esp + 8]
call fcn.00405450
mov ecx, dword [esp + 0xe6c]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.004168de
mov esp, ebp
pop ebp
ret