Function at 0x409390
Capabilities:
Resume thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c77f5
mov eax, dword fs:[0]
push eax
sub esp, 0x114
mov eax, dword [0x656770]
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
sub esp, 0x18
mov ecx, esp
push 0xb
mov dword [ecx + 0x14], 0xf
mov dword [ecx + 0x10], 0
push str._doMainLoop
mov byte [ecx], 0
call fcn.004066b0
lea ecx, [ebp - 0xc8]
call fcn.00401000
lea ecx, [eax + 0x18]
mov edx, str.Start_Main_Loop
mov dword [ebp - 4], 0
call fcn.00403a40
lea ecx, [ebp - 0xc8]
call fcn.00401130
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x110], 0
lea eax, [ebp - 0x104]
mov dword [ebp - 4], 1
push eax
mov dword [ebp - 0x114], 0
call fcn.00410e00
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x104]
cmp eax, dword [ebp - 0x100]
je 0x409465
lea eax, [ebp - 0x104]
push eax
lea ecx, [ebp - 0x118]
call fcn.00410e90
mov eax, dword [ebp - 0x104]
test eax, eax
je 0x409472
push eax
call fcn.00411632
add esp, 4
call fcn.00526749
mov esi, eax
mov dword [ebp - 0x104], 0
mov dword [ebp - 0x100], 0
mov dword [ebp - 0xfc], 0
push 0
push 0
push ecx
mov byte [ebp - 4], 3
mov ecx, esp
mov dword [ebp - 0x108], esp
push str._ProgramFiles__nxTS_nxTS.exe
call fcn.00405fe0
push ecx
mov byte [ebp - 4], 4
mov ecx, esp
mov dword [ebp - 0x11c], esp
push str.1_0_0_1
call fcn.00405fe0
push ecx
mov ecx, esp
push str.nxTS
mov byte [ebp - 4], 5
call fcn.00405fe0
lea ecx, [ebp - 0xf0]
mov byte [ebp - 4], 3
call fcn.00408090
push eax
lea ecx, [ebp - 0x104]
mov byte [ebp - 4], 6
call fcn.00409f90
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0xe8]
add edx, 0xfffffff0
or edi, 0xffffffff
lea ecx, [edx + 0xc]
mov eax, edi
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40951f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xec]
add edx, 0xfffffff0
mov ecx, edi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40953e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xf0]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], edi
dec edi
test edi, edi
jg 0x40955b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0
push 4
push 0
push 0
push 0x6330d0
call fcn.0041261f
mov ebx, eax
lea eax, [ebp - 0x104]
push eax
lea ecx, [ebp - 0xf0]
mov dword [ebp - 0x108], ebx
call fcn.00409eb0
lea eax, [ebp - 0xf0]
push eax
lea ecx, [ebx + 0x4c]
mov byte [ebp - 4], 7
call fcn.0040a090
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0xf0]
test ecx, ecx
je 0x4095c8
push dword [ebp - 0x108]
mov edx, dword [ebp - 0xec]
push ecx
call fcn.00404390
push dword [ebp - 0xf0]
call fcn.00411632
add esp, 0xc
push dword [ebx + 0x2c]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x64
push dword [0x666570]
call edi
test eax, eax
je 0x4097d1
call fcn.00526749
mov ecx, eax
sub ecx, esi
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 5
jle 0x4097b1
lea ecx, [ebp - 0x104]
call fcn.00408f50
test al, al
je 0x4097b1
mov eax, dword [ebp - 0x118]
mov dword [ebp - 0x114], eax
lea eax, [ebp - 0xec]
push eax
call fcn.00410e00
mov byte [ebp - 4], 0xc
mov eax, dword [ebp - 0xec]
cmp eax, dword [ebp - 0xe8]
jne 0x409657
mov byte [ebp - 4], 3
jmp 0x409673
lea eax, [ebp - 0xec]
push eax
lea ecx, [ebp - 0x118]
call fcn.00410e90
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0xec]
test eax, eax
je 0x40969e
push eax
call fcn.00411632
mov dword [ebp - 0xe4], 0
mov dword [ebp - 0xe8], 0
mov dword [ebp - 0xec], 0
add esp, 4
mov ebx, dword [ebp - 0x100]
mov eax, dword [ebp - 0x104]
sub ebx, eax
sar ebx, 4
mov dword [ebp - 0x10c], ebx
test ebx, ebx
je 0x4097aa
lea esi, [eax + 0xe]
lea edx, [ebp - 0x118]
lea ecx, [esi - 0xe]
call fcn.00408840
cmp al, 1
jne 0x4096da
mov byte [esi], 0
jmp 0x409794
cmp byte [esi], 0
jne 0x409794
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [esi - 0xe]
sub esp, 0x18
mov ecx, esp
push 0xb
mov dword [ecx + 0x14], 0xf
mov dword [ecx + 0x10], 0
push str._doMainLoop
mov dword [ebp - 0x11c], eax
mov byte [ecx], 0
call fcn.004066b0
lea ecx, [ebp - 0xc8]
call fcn.00401000
lea edi, [eax + 0x18]
mov edx, str.Target_Check_Fail_:
mov ecx, edi
mov byte [ebp - 4], 0xd
call fcn.00403a40
mov edx, ebx
mov ecx, edi
call fcn.00403a40
mov edx, 0x632e44
mov ecx, edi
call fcn.00403a40
mov edx, dword [ebp - 0x11c]
lea ecx, [ebp - 0xe0]
call fcn.0040b4e0
mov edx, eax
mov ecx, edi
mov byte [ebp - 4], 0xe
call fcn.00403d60
cmp dword [ebp - 0xcc], 0x10
jb 0x40977c
push dword [ebp - 0xe0]
call fcn.00411632
add esp, 4
lea ecx, [ebp - 0xc8]
mov byte [ebp - 4], 3
call fcn.00401130
mov ebx, dword [ebp - 0x10c]
mov byte [esi], 1
add esi, 0x10
dec ebx
mov dword [ebp - 0x10c], ebx
jne 0x4096c0
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call fcn.00526749
mov esi, eax
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x64
push dword [0x666570]
call edi
test eax, eax
jne 0x4095f1
mov ebx, dword [ebp - 0x108]
push 0xb
push str._doMainLoop
lea ecx, [ebp - 0xf8]
mov dword [ebp - 0xe4], 0xf
mov dword [ebp - 0xe8], 0
mov byte [ebp - 0xf8], 0
call fcn.004066b0
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], 0
mov byte [ebp - 0xc8], 0
sub esp, 8
lea ecx, [ebp - 0xb0]
mov byte [ebp - 4], 9
call fcn.004028c0
mov edx, 0x632cfc
lea ecx, [ebp - 0xb0]
mov byte [ebp - 4], 0xa
call fcn.00403a40
lea edx, [ebp - 0xf8]
lea ecx, [ebp - 0xb0]
call fcn.00403d60
mov edx, str.___:
lea ecx, [ebp - 0xb0]
call fcn.00403a40
cmp dword [ebp - 0xe4], 0x10
jb 0x409877
push dword [ebp - 0xf8]
call fcn.00411632
add esp, 4
mov dword [ebp - 0xe4], 0xf
mov dword [ebp - 0xe8], 0
mov byte [ebp - 0xf8], 0
mov edx, str.Service_Stop_Event_Received
lea ecx, [ebp - 0xb0]
mov byte [ebp - 4], 0xb
call fcn.00403a40
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0xb0]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xb0], vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov eax, dword [ebp - 0xb0]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x50]
mov dword [ebp + ecx - 0xb4], eax
lea ecx, [ebp - 0xac]
call fcn.00402990
mov eax, dword [ebp - 0xb0]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xb0], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov eax, dword [ebp - 0xb0]
mov ecx, dword [eax + 4]
lea eax, [ecx - 8]
mov dword [ebp + ecx - 0xb4], eax
lea eax, [ebp - 0x60]
push eax
mov dword [ebp - 0x60], vtable.std::ios_base.0
call fcn.00545841
add esp, 4
cmp dword [ebp - 0xb4], 0x10
jb 0x40992d
push dword [ebp - 0xc8]
call fcn.00411632
add esp, 4
push 0x666578
push dword [0x666574]
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], 0
mov byte [ebp - 0xc8], 0
mov dword [0x666578], 0x10
mov dword [0x66657c], 1
mov dword [0x666584], 0
mov dword [0x666588], 0
mov dword [0x666590], 0xbb8
mov dword [0x666580], 1
mov dword [0x66658c], 0
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
push dword [ebx + 0x48]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x3e8
push dword [ebx + 0x2c]
call edi
cmp eax, 0x102
jne 0x4099c4
push 0
push dword [ebx + 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [0x666570]
test eax, eax
je 0x4099de
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x666570], 0
push dword [ebp - 0x120]
mov esi, dword [ebp - 0x104]
mov edx, dword [ebp - 0x100]
push ecx
mov ecx, esi
call fcn.00404390
add esp, 8
test esi, esi
je 0x409a18
push dword [ebp - 0x120]
mov edx, esi
push ecx
mov ecx, esi
call fcn.00404390
push esi
call fcn.00411632
add esp, 0xc
mov eax, dword [ebp - 0x118]
test eax, eax
je 0x409a2b
push eax
call fcn.00411632
add esp, 4
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.005259c3
mov esp, ebp
pop ebp
ret