Function at 0x4042ec
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1bc
mov eax, dword [0x40b004]
xor eax, esp
mov dword [esp + 0x1b8], eax
push ebx
mov ebx, ecx
push esi
mov esi, dword [ebp + 0xc]
push edi
cmp byte [ebx], 4
mov edi, edx
mov dword [esp + 0x10], esi
jne 0x4045fe
mov ecx, esi
call fcn.004038e0
test eax, eax
je 0x4045fe
movzx eax, byte [esi + 0x18]
add esi, 0x18
push eax
push str.sdwan_openAck_pktType__u
call fcn.00402ef0
sub edi, esi
add esp, 8
add edi, dword [ebp + 8]
test edi, edi
jle 0x4043f0
movzx eax, byte [esi]
movzx edx, byte [esi + 1]
add eax, 0xfffffffd
cmp eax, 6
ja case.0x4042e5.7
jmp dword [eax*4 + 0x40461c]
cmp edx, 4
jne 0x4045dc
movzx ecx, byte [esi + 2]
movzx eax, byte [esi + 3]
shl cx, 8
or cx, ax
mov word [ebx + 0x24], cx
jmp 0x4043e4
cmp edx, 6
jne 0x4045dc
movzx ecx, byte [esi + 5]
movzx eax, byte [esi + 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 3]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 2]
shl ecx, 8
or ecx, eax
mov dword [ebx + 4], ecx
jmp 0x4043e4
cmp edx, 6
jne 0x4045dc
movzx ecx, byte [esi + 5]
movzx eax, byte [esi + 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 3]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 2]
shl ecx, 8
or ecx, eax
mov dword [ebx + 0x10], ecx
jmp 0x4043e4
cmp edx, 0xa
jne 0x4045dc
movzx ecx, byte [esi + 5]
movzx eax, byte [esi + 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 3]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 2]
shl ecx, 8
or ecx, eax
mov dword [ebx + 0x14], ecx
movzx ecx, byte [esi + 9]
movzx eax, byte [esi + 8]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 7]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 6]
shl ecx, 8
or ecx, eax
mov dword [ebx + 0x18], ecx
jmp 0x4043e4
cmp edx, 3
jne 0x4045dc
mov al, byte [esi + 2]
mov byte [ebx + 2], al
jmp 0x4043e4
cmp edx, 3
jne 0x4045dc
mov al, byte [esi + 2]
mov byte [ebx + 3], al
jmp 0x4043e4
cmp edx, 2
jb 0x4045dc
sub edi, edx
add esi, edx
test edi, edi
jg 0x4042d2
mov ecx, dword [esp + 0x10]
mov esi, dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov byte [ebx], 5
push 0
mov ax, word [ecx + 2]
mov word [ebx + 0x20], ax
mov eax, dword [ecx + 4]
mov dword [ebx + 0x1c], eax
call esi
add esp, 4
mov dword [ebx + 0x3c], eax
push 0
call esi
inc dword [ebx + 0xe8]
add esp, 4
mov dword [ebx + 0x38], eax
movzx eax, word [ebx + 0x20]
push eax
push str.sdwan_DATA_ESTABLISHED_session__u
call fcn.00402ef0
mov eax, dword [ebx + 0x10]
add esp, 8
mov esi, dword [sym.imp.WS2_32.dll_inet_ntop]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x120]
push 0x10
push eax
lea eax, [esp + 0x18]
push eax
push 2
call esi
mov ecx, dword [ebx + 4]
mov edi, eax
push 0x10
lea eax, [esp + 0x134]
mov dword [esp + 0x18], ecx
push eax
lea eax, [esp + 0x1c]
push eax
push 2
call esi
cmp byte [ebx + 2], 0
mov edx, 0x59
mov ecx, 0x4e
cmovne ecx, edx
push ecx
movzx ecx, word [ebx + 0x24]
push ecx
push edi
push eax
push str.using_ip__s_gateway__s_mtu__u_encrypt__c
call fcn.00402ef0
add esp, 0x14
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.IPHLPAPI.DLL_InitializeUnicastIpAddressEntry]
lea eax, [esp + 0x38]
push eax
push dword [0x50b910]
call dword [0x50b6a0]
lea eax, [esp + 0x68]
push eax
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.IPHLPAPI.DLL_ConvertInterfaceLuidToGuid]
mov eax, 2
mov byte [esp + 0x54], 0x18
mov word [esp + 0x18], ax
mov eax, dword [ebx + 4]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.IPHLPAPI.DLL_CreateUnicastIpAddressEntry]
movzx eax, word [ebx + 0x24]
movzx edx, word [ebx + 0x26]
mov ecx, eax
movzx esi, word [ebx + 0x22]
cmp dx, ax
mov edi, edx
lea eax, [esp + 0x78]
cmovae edi, ecx
push eax
call dword [sym.imp.IPHLPAPI.DLL_InitializeIpInterfaceEntry]
mov eax, 2
mov dword [esp + 0x88], esi
mov word [esp + 0x78], ax
lea eax, [esp + 0x78]
push eax
call dword [sym.imp.IPHLPAPI.DLL_GetIpInterfaceEntry]
test eax, eax
jne 0x404544
mov dword [esp + 0x108], eax
lea eax, [esp + 0x78]
push eax
mov dword [esp + 0x114], edi
call dword [sym.imp.IPHLPAPI.DLL_SetIpInterfaceEntry]
test eax, eax
je 0x404552
push eax
push str.MTU_Set_Failed__d
call fcn.00402ef0
add esp, 8
mov edx, dword [ebx + 8]
mov ecx, dword [ebx + 0x128]
push 1
push 0
push dword [ebx + 0x124]
push 0x20
call fcn.00402f60
mov ecx, dword [ebx + 0x14]
movzx eax, cl
push eax
mov eax, ecx
shr eax, 8
movzx eax, al
push eax
mov eax, ecx
shr ecx, 0x18
shr eax, 0x10
movzx eax, al
push eax
push ecx
push str.netsh_interface_ip_set_dns_SD_WAN_static__d._d._d._d_primary
lea eax, [esp + 0x164]
push 0x80
push eax
call fcn.00401710
add esp, 0x2c
lea eax, [esp + 0x140]
push 0x4083f0
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__popen]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__pclose]
add esp, 0xc
mov ecx, ebx
call fcn.004034a0
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1b8]
xor ecx, esp
call fcn.00406188
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.00403680
inc dword [ebx + 0x110]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1b8]
xor ecx, esp
call fcn.00406188
mov esp, ebp
pop ebp
ret
inc dword [ebx + 0x10c]
mov ecx, dword [esp + 0x1c4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00406188
mov esp, ebp
pop ebp
ret