Function at 0x417290
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Terminate process

Disassembly:
push 0xffffffffffffffff
push 0x4297db
mov eax, dword fs:[0]
push eax
sub esp, 0x120
mov eax, dword [0x4382c4]
xor eax, esp
mov dword [esp + 0x11c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4382c4]
xor eax, esp
push eax
lea eax, [esp + 0x134]
mov dword fs:[0], eax
mov eax, dword [esp + 0x144]
xor ebp, ebp
xor edi, edi
mov ebx, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], ebp
mov dword [esp + 0x1c], edi
push str.GlobalNemservie
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, ebp
jne 0x417306
cmp eax, 5
jne 0x4173a2
cmp edi, 0x1e
jge 0x417315
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x417392
mov dword [esp + 0x24], vtable.CFindKillProcess.0
push ebp
push 2
mov dword [esp + 0x144], ebp
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
cmp eax, 0xffffffff
je 0x417383
push ebp
mov esi, eax
mov edi, str.NemService.exe
call fcn.00403eb0
cmp eax, ebp
je 0x417383
push eax
push ebp
push 0x100001
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
cmp esi, ebp
je 0x417364
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Nemservice_meet_error__kill_it.
push 2
mov ecx, 0x43b48c
call fcn.0040a450
add esp, 8
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x13c], 0xffffffff
add edi, 1
cmp edi, 0x1f
mov dword [esp + 0x1c], edi
jl 0x4172e4
push str.GlobalSVN_COMM_PORT_OK
push ebp
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebx + 0x21c], eax
call fcn.00415710
test eax, eax
mov ecx, 0x43b48c
jne 0x4173d8
push str.Fail_to_start_nemservice.
push 3
call fcn.0040a450
add esp, 8
jmp 0x417629
push str.The_nemservice_process_has_been_started.
push ebp
call fcn.0040a450
mov ecx, dword [ebx + 0x21c]
add esp, 8
push 0x7530
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x417433
push str.Wait_for_nemservice_setting_up_communicate_socket_timeout.
push 3
mov ecx, 0x43b48c
call fcn.0040a450
mov eax, dword [ebx + 0x21c]
add esp, 8
cmp eax, ebp
je 0x417629
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0x21c], ebp
jmp 0x417629
mov eax, dword [ebx + 0x21c]
cmp eax, ebp
je 0x41744a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0x21c], ebp
push str.Start_to_get_comm_port
push ebp
mov ecx, 0x43b48c
call fcn.0040a450
add esp, 8
lea edx, [esp + 0x20]
push edx
mov esi, ebx
call fcn.00417ea0
mov ebx, dword [esp + 0x20]
mov edi, eax
movzx esi, bx
push edi
push esi
push str.Get_comm_port_:_d___nRet___d
push ebp
mov ecx, 0x43b48c
call fcn.0040a450
add esp, 0x10
cmp edi, 0xffffffff
je 0x417613
cmp bx, bp
je 0x417613
call fcn.00417f10
test eax, eax
jne 0x417613
push str.Prepare_to_start_CNEM_Service_
push 1
mov ecx, 0x43b48c
mov dword [0x43a8f4], 1
call fcn.0040a450
push 0x424
call fcn.0041ce0b
mov ebx, eax
add esp, 0xc
cmp ebx, ebp
je 0x417629
push 0x424
push ebp
push ebx
call fcn.00420f50
add esp, 0xc
push 0x103
lea eax, [esp + 0x2d]
push 0
mov word [ebx + 2], 0x424
mov word [ebx], 4
push eax
lea ebp, [ebx + 8]
mov byte [esp + 0x34], 0
call fcn.00420f50
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 0x48]
add esp, 0xc
push edx
call dword [sym.imp.WS2_32.dll_htonl]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
lea eax, [esp + 0x2c]
push 0x20
push eax
call fcn.0041aff9
mov eax, dword [esp + 0x24]
mov ecx, 0x20
lea esi, [esp + 0x34]
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
lea esi, [eax + 0x4c]
lea edi, [ebp + 0x80]
mov ecx, 0x20
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [eax + 0x44]
mov dword [ebp + 0x160], ecx
mov edx, dword [eax + 0x3c]
mov dword [ebp + 0x170], edx
mov eax, dword [eax + 0x38]
mov dword [ebp + 0x168], eax
add esp, 0xc
xor eax, eax
mov word [ebp + 0x174], ax
mov ecx, 1
mov dword [ebp + 0x16c], ecx
mov word [ebx + 0x416], ax
mov word [ebx + 0x414], ax
mov dword [ebx + 0x410], eax
mov eax, 0x43b0a0
mov dword [ebx + 0x40c], ecx
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4175a5
sub eax, edx
je 0x4175ea
lea eax, [ebx + 0x18c]
mov ecx, 0x10
mov esi, 0x43b0a0
mov edi, eax
rep movsd dword es:[edi], dword [esi]
lea edi, [eax + 0x100]
mov ecx, 8
mov esi, 0x43b1a0
rep movsd dword es:[edi], dword [esi]
lea edi, [eax + 0x200]
mov ecx, 8
mov esi, 0x43b2a0
rep movsd dword es:[edi], dword [esi]
push 0x424
push ebx
call fcn.00418b90
test eax, eax
jge 0x41760f
push str.Fail_to_send_start_msg.
push 3
mov ecx, 0x43b48c
call fcn.0040a450
add esp, 8
jmp 0x417629
xor eax, eax
jmp 0x41762c
push esi
push edi
push str.Connect_to_nemservice_fail__d__d.
push 3
mov ecx, 0x43b48c
call fcn.0040a450
add esp, 0x10
or eax, 0xffffffff
mov ecx, dword [esp + 0x134]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x11c]
xor ecx, esp
call fcn.0041aec3
add esp, 0x12c
ret 4