Function at 0x140006290
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Create directory
Terminate process

Disassembly:
push rbx
push rsi
push rdi
push r13
sub rsp, 0x88
mov rax, qword [0x140012008]
xor rax, rsp
mov qword [rsp + 0x60], rax
xor r13d, r13d
lea r9, str.help
lea r8, str.hfvVwtaU:xXnzl:p
mov qword [rsp + 0x20], r13
mov rdi, rdx
mov ebx, ecx
call qword [sym.imp.getopt.dll_getopt_long_a]
cmp eax, 0xffffffff
je 0x140006400
lea rsi, [0x140000000]
nop dword [rax]
add eax, 0xffffffab
cmp eax, 0x25
ja case.0x140006300.96
cdqe
movzx eax, byte [rsi + rax + 0x6ae8]
mov ecx, dword [rsi + rax*4 + 0x6ab8]
add rcx, rsi
jmp rcx
inc dword [0x140012860]
jmp case.0x140006300.85
mov dword [0x140012864], 0xff
jmp case.0x140006300.85
mov dword [0x140012858], 1
jmp case.0x140006300.85
mov dword [0x140012868], 1
jmp case.0x140006300.85
mov dword [0x140012820], 1
jmp case.0x140006300.85
mov dword [0x14001286c], 1
jmp case.0x140006300.85
mov dword [0x14001285c], 1
jmp case.0x140006300.85
mov rax, qword [sym.imp.getopt.dll_optarg_a]
mov rcx, qword [rax]
cmp byte [rcx], r13b
je 0x140006463
cmp dword [0x140012824], r13d
jne 0x140006449
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, qword [sym.imp.getopt.dll_optarg_a]
lea rdx, [0x14000d7b0]
mov r8, rax
mov rcx, qword [rcx]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_freopen]
test rax, rax
jne 0x1400063cf
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
lea rdx, str.ERROR:_fdreopen:__s
xor ecx, ecx
mov r8, rax
call fcn.140005ad0
jmp case.0x140006300.85
mov dword [0x140012824], 1
lea r9, str.help
mov qword [rsp + 0x20], r13
lea r8, str.hfvVwtaU:xXnzl:p
mov rdx, rdi
mov ecx, ebx
call qword [sym.imp.getopt.dll_getopt_long_a]
cmp eax, 0xffffffff
jne 0x1400062e0
mov eax, dword [0x140012860]
add eax, 3
mov qword [rsp + 0x80], r12
mov dword [0x140012860], eax
mov dword [reloc.WS2_32.dll_bind], eax
mov qword [rsp + 0x70], r15
je 0x1400064cd
lea rdx, str.enabling_libimobiledevice_logging
mov ecx, 3
cmp eax, 1
jne 0x1400064bd
call fcn.140005ad0
mov ecx, 1
jmp 0x1400064c7
lea rdx, str.ERROR:___logfile_cannot_be_used_multiple_times
xor ecx, ecx
call fcn.140005ad0
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
lea rdx, str.ERROR:___logfile_requires_a_non_empty_filename
xor ecx, ecx
call fcn.140005ad0
call fcn.140006170
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
call fcn.140006170
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
lea rdx, str.usbmuxd_1.1.1
lea rcx, [0x14000d748]
call fcn.140005bd0
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
call fcn.140006170
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
call fcn.140005ad0
mov ecx, 2
call qword [sym.imp.imobiledevice.dll_idevice_set_debug_level]
cmp dword [0x140012858], r13d
je 0x1400064e1
mov ecx, 2
call qword [sym.imp.imobiledevice.dll_idevice_set_socket_type]
lea r8, str.1.1.1
mov ecx, 3
lea rdx, str.usbmuxd_v_s_starting_up
call fcn.140005ad0
lea r8, str.usbmuxd
mov dword [0x1400128e8], r13d
mov edx, 1
mov dword [0x1400128ec], r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
mov r12, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x140006553
lea rdx, str.Another_instance_is_already_running._Exiting.
mov ecx, 1
call fcn.140005ad0
mov rcx, r12
mov r15d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
neg r15d
jmp 0x140006a8d
lea rdx, str.Creating_socket
mov ecx, 4
call fcn.140005ad0
call fcn.140005c30
mov rdi, rax
mov r15d, eax
test eax, eax
js 0x140006a6e
call fcn.140003450
xorps xmm0, xmm0
lea rdx, [rsp + 0x30]
mov rcx, rax
mov rbx, rax
movups xmmword [rsp + 0x30], xmm0
movups xmmword [rsp + 0x40], xmm0
movups xmmword [rsp + 0x50], xmm0
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat64i32]
test eax, eax
jns 0x140006612
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__mkdir]
test eax, eax
jns 0x1400065e9
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
lea rdx, str.Failed_to_create_required_directory__s:__s
mov r8, rbx
mov r9, rax
xor ecx, ecx
call fcn.140005ad0
mov rcx, r12
mov r15d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
neg r15d
jmp 0x140006a8d
lea rdx, [rsp + 0x30]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat64i32]
test eax, eax
jns 0x140006612
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
lea rdx, str.stat___failed_after_creating_directory__s:__s
jmp 0x1400065c5
lea rdx, str.client_init
mov ecx, 5
call fcn.140005ad0
mov ecx, 0x40
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
xorps xmm0, xmm0
mov qword [0x140012830], rax
xor edx, edx
lea rcx, [0x140012908]
movups xmmword [rax], xmm0
movups xmmword [rax + 0x10], xmm0
movups xmmword [rax + 0x20], xmm0
movups xmmword [rax + 0x30], xmm0
mov dword [0x140012838], 8
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_init]
lea rdx, str.device_init
mov ecx, 5
call fcn.140005ad0
mov ecx, 0x40
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
xorps xmm0, xmm0
mov qword [0x140012848], rax
xor edx, edx
lea rcx, [0x1400128f0]
movups xmmword [rax], xmm0
movups xmmword [rax + 0x10], xmm0
movups xmmword [rax + 0x20], xmm0
movups xmmword [rax + 0x30], xmm0
mov dword [0x140012850], 8
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_init]
lea rdx, str.Initializing_USB
mov dword [0x1400128f8], 1
mov ecx, 4
call fcn.140005ad0
mov eax, dword [0x140012864]
mov dword [0x140012828], eax
call fcn.140008e00
mov r15d, eax
test eax, eax
js 0x140006a6e
lea rax, [0x14000d8c9]
mov qword [rsp + 0xc0], rbp
cmp r15d, 1
lea r9, [0x14000d8cc]
mov r8d, r15d
lea rdx, str._d_device_s_detected
cmove r9, rax
mov ecx, 4
call fcn.140005ad0
lea rdx, str.Initialization_complete
mov ecx, 3
call fcn.140005ad0
cmp dword [0x14001286c], r13d
je 0x140006763
lea rdx, str.Automatic_device_discovery_on_hotplug_disabled.
mov ecx, 3
call fcn.140005ad0
xor r8d, r8d
lea rdx, str.usb_polling_enable:__d
lea ecx, [r8 + 5]
call fcn.140005ad0
mov dword [0x140012878], r13d
mov dword [reloc.WS2_32.dll_accept], r13d
cmp dword [0x14001285c], r13d
je 0x14000677d
lea rdx, str.Enabled_exit_on_SIGUSR1_if_no_devices_are_attached._Start_a_new_instance_with____exit__to_trigger.
mov ecx, 3
call fcn.140005ad0
mov ecx, edi
call fcn.140005e60
mov r15d, eax
test eax, eax
jns 0x140006799
lea rdx, str.main_loop_failed
xor ecx, ecx
call fcn.140005ad0
lea rdx, str.usbmuxd_shutting_down
mov qword [rsp + 0x78], r14
mov ecx, 3
call fcn.140005ad0
lea rdx, str.device_kill_connections
mov ecx, 5
call fcn.140005ad0
mov ecx, dword [0x140012850]
mov ebp, r13d
test ecx, ecx
jle 0x14000681f
mov r14, r13
mov rax, qword [0x140012848]
mov rsi, qword [r14 + rax]
test rsi, rsi
je 0x140006815
cmp dword [rsi + 0xc], r13d
je 0x140006815
mov edi, r13d
cmp dword [rsi + 0x20], r13d
jle 0x140006815
mov rbx, r13
mov rax, qword [rsi + 0x18]
mov rcx, qword [rbx + rax]
test rcx, rcx
je 0x140006804
call fcn.140004040
inc edi
add rbx, 8
cmp edi, dword [rsi + 0x20]
jl 0x1400067f2
mov ecx, dword [0x140012850]
inc ebp
add r14, 8
cmp ebp, ecx
jl 0x1400067d0
call fcn.140008b40
lea rdx, str.usb_shutdown
mov ecx, 5
call fcn.140005ad0
mov edx, dword [0x14001287c]
xor ecx, ecx
call qword [sym.imp.libusb_1.0.dll_libusb_hotplug_deregister_callback]
mov ecx, dword [0x140012888]
mov esi, r13d
test ecx, ecx
jle 0x140006890
mov rdi, r13
nop dword [rax]
nop word [rax + rax]
mov rax, qword [0x140012880]
mov rbx, qword [rdi + rax]
test rbx, rbx
je 0x140006886
mov rcx, rbx
call fcn.1400056b0
mov rcx, rbx
call fcn.140007600
mov ecx, dword [0x140012888]
inc esi
add rdi, 8
cmp esi, ecx
jl 0x140006860
mov rcx, qword [0x140012880]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor ecx, ecx
mov qword [0x140012880], r13
mov dword [0x140012888], r13d
call qword [sym.imp.libusb_1.0.dll_libusb_exit]
lea rdx, str.device_shutdown
mov ecx, 5
call fcn.140005ad0
lea rcx, [0x1400128f0]
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_lock]
mov eax, dword [0x140012850]
mov ebp, r13d
test eax, eax
jle 0x1400069a5
mov r14, r13
nop word [rax + rax]
mov rbx, qword [0x140012848]
mov rbx, qword [r14 + rbx]
test rbx, rbx
je 0x140006997
mov esi, r13d
cmp dword [rbx + 0x20], r13d
jle 0x14000692d
mov rdi, r13
mov rax, qword [rbx + 0x18]
mov rcx, qword [rdi + rax]
test rcx, rcx
je 0x140006922
call fcn.140004040
inc esi
add rdi, 8
cmp esi, dword [rbx + 0x20]
jl 0x140006910
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x18], r13
mov ecx, r13d
mov dword [rbx + 0x20], r13d
mov rax, r13
mov edx, dword [0x140012850]
test edx, edx
jle 0x140006969
mov r8, qword [0x140012848]
cmp qword [r8 + rax*8], rbx
je 0x140006a81
inc ecx
inc rax
cmp ecx, edx
jl 0x140006956
mov dword [rsp + 0x20], edx
lea r9, [0x140012848]
lea rdx, str.collection_remove:_element__p_not_present_in_collection__p__cap__d_
mov r8, rbx
mov ecx, 1
call fcn.140005ad0
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [0x140012850]
inc ebp
add r14, 8
cmp ebp, eax
jl 0x1400068f0
lea rcx, [0x1400128f0]
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_unlock]
lea rcx, [0x1400128f0]
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_destroy]
mov rcx, qword [0x140012848]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea rdx, str.client_shutdown
mov qword [0x140012848], r13
mov ecx, 5
mov dword [0x140012850], r13d
call fcn.140005ad0
mov edx, dword [0x140012838]
mov edi, r13d
mov r14, qword [rsp + 0x78]
mov rbp, qword [rsp + 0xc0]
test edx, edx
jle 0x140006a35
mov rbx, r13
nop dword [rax + rax]
mov rax, qword [0x140012830]
mov rcx, qword [rbx + rax]
test rcx, rcx
je 0x140006a2b
call fcn.1400013f0
mov edx, dword [0x140012838]
inc edi
add rbx, 8
cmp edi, edx
jl 0x140006a10
lea rcx, [0x140012908]
call qword [sym.imp.pthreadVC3.dll_pthread_mutex_destroy]
mov rcx, qword [0x140012830]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea rdx, str.Shutdown_complete
mov qword [0x140012830], r13
mov ecx, 3
mov dword [0x140012838], r13d
call fcn.140005ad0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test r15d, r15d
jns 0x140006a8a
neg r15d
jmp 0x140006a8d
mov qword [r8 + rax*8], r13
jmp 0x140006988
mov r15d, r13d
mov r12, qword [rsp + 0x80]
mov eax, r15d
mov r15, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.140009690
add rsp, 0x88
pop r13
pop rdi
pop rsi
pop rbx
ret