Function at 0x4696c0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4badfb
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x50dc94]
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 edi, ecx
mov eax, dword [0x50f810]
test al, 2
je 0x46971e
push 0x3c9
push str._d_called.
push str.__debug
push 0x3c9
push 0
push 0
call fcn.00421090
mov eax, dword [0x50f810]
add esp, 0x18
xor ecx, ecx
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], cx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], cx
mov dword [ebp - 0x2a4], 1
test al, 2
je 0x46976f
push 0x4deaf8
push 0x4cc2e4
push str.__debug
push 0x3cf
push ecx
push ecx
call fcn.00421090
add esp, 0x18
push 0x4dc6e8
push 0
push 0x1f0001
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
mov esi, eax
mov dword [ebp - 0x2ac], esi
test esi, esi
je 0x469796
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test byte [0x50f810], 2
mov byte [ebp - 4], 2
je 0x4697c3
push 0x4deaf8
push 0x4cc2e4
push str.__debug
push 0x3d1
push 0
push 0
call fcn.00421090
add esp, 0x18
push str.softwareFortinetFortiClientFA_VPN
push reloc.SHELL32.dll_SHChangeNotifyRegister
call fcn.004a7eca
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x469962
lea eax, [ebp - 0x29c]
mov dword [ebp - 0x29c], 0
push eax
push str.autoconnect_only_when_offnet
push ebx
call fcn.004a7ed6
add esp, 0xc
test al, al
je 0x469815
cmp dword [ebp - 0x29c], 0
mov dword [0x540c20], 1
jne 0x46981f
mov dword [0x540c20], 0
lea eax, [ebp - 0x29c]
push eax
push str.on_os_start_connect_has_priority
push ebx
call fcn.004a7ed6
add esp, 0xc
test al, al
je 0x46984b
cmp dword [ebp - 0x29c], 0
mov dword [ebp - 0x2a4], 0
je 0x469855
mov dword [ebp - 0x2a4], 1
push 0
lea eax, [ebp - 0x2a0]
mov dword [ebp - 0x2a0], 0
push eax
push str.on_logon_connect
push ebx
call fcn.004a7edc
add esp, 0x10
test al, al
je 0x4698d9
mov edx, dword [ebp - 0x2a0]
test edx, edx
je 0x4698d9
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x2a8], eax
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x469890
sub ecx, dword [ebp - 0x2a8]
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.00410410
cmp dword [ebp - 0x18], 0
je 0x4698ca
lea eax, [ebp - 0x28]
mov ecx, edi
push eax
call fcn.00479a60
test eax, eax
jne 0x4698ca
lea ecx, [ebp - 0x28]
call fcn.00410380
push dword [ebp - 0x2a0]
call dword [0x4c5958]
add esp, 4
push 0
lea eax, [ebp - 0x2a0]
push eax
push str.on_os_start_connect
push ebx
call fcn.004a7edc
add esp, 0x10
test al, al
je 0x469959
mov edx, dword [ebp - 0x2a0]
test edx, edx
je 0x469959
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x2a8], eax
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x469910
sub ecx, dword [ebp - 0x2a8]
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x40]
call fcn.00410410
cmp dword [ebp - 0x30], 0
je 0x46994a
lea eax, [ebp - 0x40]
mov ecx, edi
push eax
call fcn.00479a60
test eax, eax
jne 0x46994a
lea ecx, [ebp - 0x40]
call fcn.00410380
push dword [ebp - 0x2a0]
call dword [0x4c5958]
add esp, 4
push ebx
call fcn.004a7ed0
add esp, 4
mov eax, dword [0x540c0c]
test eax, eax
je 0x4699d3
test byte [0x50f810], 2
je 0x469995
push eax
push 0x3f9
push str._d_g_bIsManagedByEMS_d
push str.__debug
push 0x3f9
push 0
push 0
call fcn.00421090
add esp, 0x1c
cmp dword [ebp - 0x18], 0
je 0x4699dd
push str.softwareFortinetFortiClientFA_VPN
push SHChangeNotifyRegister
call fcn.004a7eca
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4699d3
cmp dword [ebp - 0x14], 8
lea ecx, [ebp - 0x28]
cmovae ecx, dword [ebp - 0x28]
push ecx
push str.on_logon_connect
push ebx
call fcn.004a80c4
push ebx
call fcn.004a7ed0
add esp, 0x10
cmp dword [ebp - 0x18], 0
jne 0x469b9b
push 0
push 0
lea eax, [ebp - 0x29c]
mov dword [ebp - 0x29c], 0
push eax
push str.on_logon_connect
push str.softwareFortinetFortiClientFA_VPN
call fcn.004a7f66
add esp, 0x14
test al, al
je 0x469b9b
mov eax, dword [ebp - 0x29c]
test eax, eax
je 0x469b9b
test byte [0x50f810], 1
je 0x469a4f
push eax
push str.on_logon_connect
push 0x409
push str._d__ws_ws
push str.___info
push 0x409
push 0
push 0
call fcn.00421090
mov eax, dword [ebp - 0x29c]
add esp, 0x20
push eax
lea ecx, [ebp - 0x70]
call fcn.004106c0
push dword [ebp - 0x29c]
mov byte [ebp - 4], 3
call dword [0x4c5958]
add esp, 4
cmp dword [ebp - 0x60], 0
je 0x469b5b
lea eax, [ebp - 0x70]
mov ecx, edi
push eax
call fcn.00479a60
test eax, eax
je 0x469af5
lea eax, [ebp - 0x70]
push eax
call fcn.0047d850
add esp, 4
test eax, eax
je 0x469ab7
lea eax, [ebp - 0x70]
push eax
call fcn.00479be0
add esp, 4
test eax, eax
je 0x469ab7
lea eax, [ebp - 0x70]
push eax
lea ecx, [ebp - 0x28]
call fcn.00462850
mov ecx, 1
jmp 0x469ab9
xor ecx, ecx
test byte [0x50f810], 2
je 0x469b5b
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push ecx
push 0x414
push str._d_bHasPerUserAutoConnectConfigured_d__on_logon_start_up_tunnel_s
push str.__debug
push 0x414
push 0
push 0
call fcn.00421090
add esp, 0x20
jmp 0x469b5b
test byte [0x50f810], 4
je 0x469b2a
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
cmovae eax, dword [ebp - 0x70]
push eax
push 0x418
push str._d_Tunnel__ws_doesnt_exist._Clear_it_in_HKCU.
push str.warning
push 0x418
push 0
push 0
call fcn.00421090
add esp, 0x1c
push str.softwareFortinetFortiClientFA_VPN
push SHChangeNotifyRegister
call fcn.004a7eca
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x469b5b
push 0x4cc9ec
push str.on_logon_connect
push ebx
call fcn.004a80c4
push ebx
call fcn.004a7ed0
add esp, 0x10
mov edx, dword [ebp - 0x5c]
mov byte [ebp - 4], 2
cmp edx, 8
jb 0x469b9b
mov ecx, dword [ebp - 0x70]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x469b91
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x469b91
call dword [0x4c59b0]
push edx
push ecx
call fcn.004aebf7
add esp, 8
test byte [0x50f810], 2
je 0x469be2
push dword [ebp - 0x2a4]
cmp dword [ebp - 0x2c], 8
lea ecx, [ebp - 0x40]
lea eax, [ebp - 0x28]
cmovae ecx, dword [ebp - 0x40]
cmp dword [ebp - 0x14], 8
push ecx
cmovae eax, dword [ebp - 0x28]
push eax
push 0x424
push str._d_on_logon_start_up_tunnel_ws__on_os_start_up_tunnel_ws__bon_os_startup_tunnel_has_priority_d
push str.__debug
push 0x424
push 0
push 0
call fcn.00421090
add esp, 0x24
mov eax, dword [edi + 0x614]
test eax, eax
je 0x469c1b
test byte [0x50f810], 2
je 0x469c1b
push dword [eax + 0x1f008]
push 0x426
push str._d_m_pInfo__m_bPerMachineTunnelConnectedByMachine_d
push str.__debug
push 0x426
push 0
push 0
call fcn.00421090
add esp, 0x1c
mov ecx, edi
call fcn.00479ea0
xor eax, eax
mov dword [ebp - 0x29c], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov byte [ebp - 4], 4
cmp dword [edi + 0x614], eax
je 0x469efa
push 0xffffffffffffffff
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [edi + 0x614]
add edx, 0x2c
mov ecx, edx
lea ebx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x469c70
sub ecx, ebx
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x58]
call fcn.00410410
mov eax, dword [edi + 0x614]
xor ebx, ebx
mov ecx, dword [eax + 0x28]
test ecx, ecx
mov dword [ebp - 0x2a8], ecx
mov ecx, dword [eax + 0x18]
sete bl
cmp ecx, 2
je 0x469cac
cmp ecx, 3
jne 0x469cdd
test byte [0x50f810], 2
mov eax, dword [eax + 0x1f008]
mov dword [ebp - 0x29c], eax
je 0x469cdd
push eax
push str.on_os_start_connect_running_d
push str.__debug
push 0x435
push 0
push 0
call fcn.00421090
add esp, 0x18
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [ebp - 0x29c], 0
je 0x469efa
cmp dword [ebp - 0x2a4], 0
jne 0x469efa
cmp dword [ebp - 0x18], 0
je 0x469efa
mov ecx, ebx
mov dword [edi + 0x5d8], ebx
xor ecx, 1
mov dword [edi + 0x5dc], ecx
mov eax, dword [0x50f810]
test al, 2
je 0x469d6d
push ebx
push ecx
push str.m_bIPSECConnected_d__m_bSSLVPNConnected_d
push str.__debug
push 0x43e
push 0
push 0
call fcn.00421090
mov eax, dword [0x50f810]
add esp, 0x1c
test al, 2
je 0x469d6d
push str.on_os_start_connect_running1__bon_os_startup_tunnel_has_priority0
push str.__debug
push 0x43f
push 0
push 0
call fcn.00421090
mov eax, dword [0x50f810]
add esp, 0x14
test al, 4
je 0x469d91
push str.on_logon_start_up_tunnel_has_priority_over_on_os_start_up_tunnel__stopping_current_tunnel
push str.warning
push 0x440
push 0
push 0
call fcn.00421090
mov eax, dword [0x50f810]
add esp, 0x14
cmp dword [ebp - 0x2a8], 0
jne 0x469dfb
test al, 2
je 0x469dc5
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
cmovae eax, dword [ebp - 0x58]
push eax
push str.ON_LOGON_CONNECT_HAS_PRIORITY___disconnect_sslvpn_tunnel_ws
push str.__debug
push 0x442
push 0
push 0
call fcn.00421090
add esp, 0x18
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
push 1
cmovae eax, dword [ebp - 0x58]
mov ecx, edi
push eax
call fcn.00479530
test byte [0x50f810], 2
je 0x469e8a
push str.ON_LOGON_CONNECT_HAS_PRIORITY___disconnected_sslvpn_tunnel
push str.__debug
push 0x444
jmp 0x469e7e
test al, 2
je 0x469e1a
push str.ON_LOGON_CONNECT_HAS_PRIORITY___disconnect_IPsec_tunnel
push str.__debug
push 0x447
push 0
push 0
call fcn.00421090
add esp, 0x14
call fcn.004a81c0
test eax, eax
je 0x469e66
push 3
call fcn.004a820e
add esp, 4
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 3
call fcn.004a820e
push 3
call fcn.004a8022
add esp, 8
test eax, eax
je 0x469e66
nop word [eax + eax]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push 3
call fcn.004a8022
add esp, 4
test eax, eax
jne 0x469e50
test byte [0x50f810], 2
je 0x469e8a
push str.ON_LOGON_CONNECT_HAS_PRIORITY___disconnected_IPsec_tunnel
push str.__debug
push 0x450
push 0
push 0
call fcn.00421090
add esp, 0x14
cmp dword [edi + 0x614], 0
je 0x469ee6
push 0xffffffffffffffff
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [edi + 0x614]
mov dword [eax + 0x1f01c], 0
mov eax, dword [edi + 0x614]
mov dword [eax + 0x18], 0
mov eax, dword [edi + 0x614]
mov dword [eax], 0
mov eax, dword [edi + 0x614]
mov dword [eax + 0x1f008], 0
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push str.0EAC67E7_01D4_4889_808D_D5D4CC0DE2A8
call fcn.00471e00
add esp, 4
mov ecx, edi
call fcn.00473c90
push 0x228
lea eax, [ebp - 0x298]
push 0
push eax
call fcn.004b493e
lea eax, [ebp - 0x298]
push eax
call fcn.0042d450
add esp, 0x10
call fcn.004a81c0
test eax, eax
jne 0x46a185
cmp dword [ebp - 0x98], 2
je 0x46a185
cmp dword [ebp - 0x30], eax
je 0x469fa9
cmp dword [ebp - 0x18], eax
je 0x46a07a
cmp dword [ebp - 0x2a4], eax
je 0x469f78
test byte [0x50f810], 1
je 0x469f73
push 0x46c
push str._d_on_os_start_up_tunnel_has_priority
push str.___info
push 0x46c
push eax
push eax
call fcn.00421090
add esp, 0x18
lea ecx, [ebp - 0x28]
jmp 0x469fa4
test byte [0x50f810], 1
je 0x469fa1
push 0x470
push str._d_on_logon_start_up_tunnel_has_priority
push str.___info
push 0x470
push 0
push 0
call fcn.00421090
add esp, 0x18
lea ecx, [ebp - 0x40]
call fcn.00410380
cmp dword [ebp - 0x18], 0
je 0x46a07a
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
mov ecx, 0x540c6c
cmovae eax, dword [ebp - 0x28]
push eax
call dword [0x4c5f7c]
push dword [0x540c6c]
call fcn.00466f30
mov byte [0x540c28], al
movzx eax, al
push eax
push dword [0x540c6c]
push 0x477
push str.CFortiTrayDlg::LoadVPNSettings
push str._ws__d_g_szAutoConnectTunnel_s_g_bAutoConnectTunnelIsCloudVPN_d
call fcn.0047c780
add esp, 0x18
push 0xffffffffffffffff
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [edi + 0x614]
test eax, eax
je 0x46a179
cmp dword [eax + 4], 0
jne 0x46a179
test byte [0x50f810], 1
je 0x46a04e
push dword [eax + 0x28]
push str.vpn_type:__d
push str.___info
push 0x47c
push 0
push 0
call fcn.00421090
mov eax, dword [edi + 0x614]
add esp, 0x18
mov dword [eax + 0x1f008], 0
mov eax, dword [edi + 0x614]
mov dword [eax + 0x1f004], 0
mov eax, dword [edi + 0x614]
mov dword [eax + 0x24], 2
jmp 0x46a179
cmp dword [ebp - 0x30], 0
mov ecx, 0x540c6c
je 0x46a13b
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
cmovae eax, dword [ebp - 0x40]
push eax
call dword [0x4c5f7c]
push dword [0x540c6c]
call fcn.00466f30
mov byte [0x540c28], al
movzx eax, al
push eax
push dword [0x540c6c]
push 0x487
push str.CFortiTrayDlg::LoadVPNSettings
push str._ws__d_g_szAutoConnectTunnel_s_g_bAutoConnectTunnelIsCloudVPN_d
call fcn.0047c780
add esp, 0x18
push 0xffffffffffffffff
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [edi + 0x614]
test eax, eax
je 0x46a179
cmp dword [eax + 4], 0
jne 0x46a179
test byte [0x50f810], 1
je 0x46a11f
push dword [eax + 0x28]
push str.vpn_type:__d
push str.___info
push 0x48e
push 0
push 0
call fcn.00421090
mov eax, dword [edi + 0x614]
add esp, 0x18
mov dword [eax + 0x1f008], 1
mov eax, dword [edi + 0x614]
mov dword [eax + 0x1f004], 1
jmp 0x46a179
call dword [0x4c5f64]
push 0xffffffffffffffff
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [edi + 0x614]
test eax, eax
je 0x46a179
cmp dword [eax + 4], 0
jne 0x46a179
mov dword [eax + 0x1f008], 0
mov eax, dword [edi + 0x614]
mov dword [eax + 0x1f004], 0
push dword [edi + 0x604]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [ebp - 0x44]
cmp edx, 8
jb 0x46a1c1
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46a1b7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x46a1b7
call dword [0x4c59b0]
push edx
push ecx
call fcn.004aebf7
add esp, 8
xor eax, eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
test esi, esi
je 0x46a1e7
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x46a223
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46a219
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x46a219
call dword [0x4c59b0]
push edx
push ecx
call fcn.004aebf7
add esp, 8
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x46a273
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46a269
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x46a269
call dword [0x4c59b0]
push edx
push ecx
call fcn.004aebf7
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.004ae9c0
mov esp, ebp
pop ebp
ret