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

Disassembly:
sub esp, 0xc4
mov eax, dword [0x501230]
xor eax, esp
mov dword [esp + 0xc0], eax
mov eax, dword [0x50684c]
xorps xmm0, xmm0
push ebx
mov ebx, dword [esp + 0xd0]
push ebp
mov ebp, dword [esp + 0xd0]
push esi
push edi
push 4
mov dword [esp + 0x20], ebp
mov dword [esp + 0x48], ebx
mov dword [eax], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
mov dword [esp + 0x28], 0
movlpd qword [esp + 0x54], xmm0
movlpd qword [esp + 0x84], xmm0
movlpd qword [esp + 0x7c], xmm0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
call fcn.00405450
mov dword [esp + 0x18], eax
lea eax, [esp + 0x3c]
mov dword [esp + 0x8c], eax
lea eax, [esp + 0x38]
mov dword [esp + 0x90], eax
lea eax, [esp + 0x34]
mov dword [esp + 0x94], eax
lea eax, [esp + 0x30]
mov dword [esp + 0x98], eax
lea eax, [esp + 0x2c]
mov dword [esp + 0x9c], eax
lea eax, [esp + 0x40]
mov dword [esp + 0xa0], eax
lea eax, [esp + 0x4c]
push ebx
mov dword [esp + 0xa8], eax
lea eax, [esp + 0x54]
push 0
mov dword [esp + 0xb0], eax
lea eax, [esp + 0x30]
push 0
push 0
mov dword [esp + 0xbc], eax
lea eax, [esp + 0x9c]
push 9
push eax
lea eax, [esp + 0xc8]
mov dword [esp + 0xc8], 0x4dd7bc
push eax
mov dword [esp + 0xd0], str.tsid
mov dword [esp + 0xd4], str.account_name
mov dword [esp + 0xd8], str.current_password
mov dword [esp + 0xdc], str.target_device_id
mov dword [esp + 0xe0], str.tubes_subnet
mov dword [esp + 0xe4], str.host
mov dword [esp + 0xe8], 0x4dd7ec
mov dword [esp + 0xec], str.prev_failed_conn_type
call fcn.00402440
add esp, 0x20
test eax, eax
je 0x40eec6
push 0x6f7
push str..._tech1utils_tubemain.c
push str.res__0
call fcn.00407dc0
add esp, 0xc
cmp dword [esp + 0x24], 0
je 0x40ef29
lea eax, [esp + 0x80]
mov dword [esp + 0x70], str.prev_failed_conn_start_time
mov dword [esp + 0x68], eax
lea eax, [esp + 0x78]
push ebx
push 2
mov dword [esp + 0x74], eax
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x7c]
mov dword [esp + 0x80], str.prev_failed_conn_duration
push eax
push 0
push 0
push 0
call fcn.00402440
add esp, 0x1c
test eax, eax
je 0x40ef29
push 0x6fd
push str..._tech1utils_tubemain.c
push str.res__0
call fcn.00407dc0
add esp, 0xc
push ebx
lea eax, [esp + 0x54]
mov dword [esp + 0x60], str.cc_mode
push 1
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
push eax
lea eax, [esp + 0x68]
push eax
push 0
push 0
push 0
call fcn.00402440
add esp, 0x1c
cmp dword [esp + 0x54], 0
ja 0x40f7a8
jb 0x40ef6c
cmp dword [esp + 0x50], 3
ja 0x40f7a8
cmp dword [esp + 0x38], 0
jne 0x40efea
cmp dword [esp + 0x34], 0
jne 0x40efea
cmp dword [esp + 0x2c], 0
je 0x40ef88
cmp dword [esp + 0x30], 0
jne 0x40efea
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40efaf
push str.Malformed_config:_sid_tsid_is_not_defined_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.sid_tsid_is_not_defined
call fcn.004129a0
lea eax, [esp + 0x90]
mov ebx, 1
push 9
push eax
call fcn.00402120
lea eax, [esp + 0x24]
push eax
call fcn.00402030
lea eax, [esp + 0x24]
push eax
call fcn.004205b0
add esp, 0x18
jmp 0x40f828
cmp dword [esp + 0x28], 0
jne 0x40f03b
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f018
push str.Malformed_config:_target_device_id_not_defined_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
mov eax, dword [0x50684c]
test eax, eax
je 0x40f7fd
mov eax, dword [eax + 0x1bc]
push ebp
push 9
call eax
push ebp
push str.target_device_id_not_defined
jmp 0x40f7ed
mov edx, dword [esp + 0x3c]
test edx, edx
je 0x40f0e9
mov ecx, edx
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40f050
sub ecx, esi
je 0x40f0e9
push edx
call fcn.00406760
mov ecx, eax
mov eax, dword [0x50684c]
push 0x2f
push ecx
mov dword [eax + 0x48], ecx
call sub.VCRUNTIME140.dll_strchr
mov esi, eax
add esp, 0xc
test esi, esi
je 0x40f0b7
cmp byte [esi + 1], 0
lea edi, [esi + 1]
je 0x40f0b7
mov eax, dword [0x50684c]
push 0x2f
push dword [eax + 0x48]
call sub.VCRUNTIME140.dll_strrchr
add esp, 8
cmp esi, eax
jne 0x40f0b7
push edi
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
mov ecx, dword [0x50684c]
add esp, 4
mov dword [ecx + 0x4c], eax
mov byte [esi], 0
jmp 0x40f0ef
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f0de
push str.Malformed_config:_incorrect_tubes_subnet_value_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.Malformed_connector_part._See_tubes_subnet
jmp 0x40efb5
mov ecx, dword [0x50684c]
push str.shutdown_timeout_sec
push ebx
mov dword [ecx + 0x50], 0xffffffff
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x40f161
cmp dword [eax], 3
jne 0x40f225
push eax
call sub.jansson.dll_json_integer_value
add esp, 4
mov esi, eax
test edx, edx
jg 0x40f159
jl 0x40f126
test esi, esi
jae 0x40f159
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f14e
push esi
push str.Malformed_config:_invalid_shutdown_timeout_sec_value__ld_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0x10
push ebp
push str.Malformed_config:_invalid_shutdown_timeout_sec_value
jmp 0x40efb5
mov eax, dword [0x50684c]
mov dword [eax + 0x50], esi
push str.trails_config
push ebx
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x40f5a6
push 0
push 0
push eax
call sub.jansson.dll_json_string_value
add esp, 4
push eax
call sub.jansson.dll_json_loads
mov ebx, eax
add esp, 0xc
mov dword [esp + 0x18], ebx
test ebx, ebx
je 0x40f55f
cmp dword [ebx], 0
jne 0x40f55f
push str.trails
push ebx
call sub.jansson.dll_json_object_get
mov edi, eax
add esp, 8
mov dword [esp + 0x20], edi
test edi, edi
je 0x40f4f9
cmp dword [edi], 1
jne 0x40f4f9
push edi
call sub.jansson.dll_json_array_size
add esp, 4
test eax, eax
je 0x40f4f9
push str.timeout
push ebx
call sub.jansson.dll_json_object_get
mov esi, eax
add esp, 8
test esi, esi
je 0x40f257
cmp dword [esi], 3
je 0x40f257
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f21a
push str.Malformed_config:_timeout_should_be_integer_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.Malformed_config:_timeout_should_be_integer
jmp 0x40f526
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f24c
push str.Malformed_config:_shutdown_timeout_sec_should_be_integer_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.Malformed_config:_shutdown_timeout_sec_should_be_integer
jmp 0x40efb5
call fcn.00420590
mov dword [esp + 0x10], eax
mov dword [eax], ebp
test esi, esi
je 0x40f273
push esi
call sub.jansson.dll_json_integer_value
add esp, 4
mov ecx, eax
jmp 0x40f278
mov ecx, 0x1e
mov eax, dword [esp + 0x10]
xor ebx, ebx
push edi
mov dword [esp + 0x44], ebx
mov dword [eax + 4], ecx
call sub.jansson.dll_json_array_size
add esp, 4
mov dword [esp + 0x64], eax
test eax, eax
je 0x40f5a2
nop word [eax + eax]
push ebx
push edi
call sub.jansson.dll_json_array_get
mov esi, eax
add esp, 8
test esi, esi
je 0x40f4c7
cmp dword [esi], 0
jne 0x40f4c7
push str.address
push esi
call sub.jansson.dll_json_object_get
push str.priority
push esi
mov ebx, eax
call sub.jansson.dll_json_object_get
push str.ports
push esi
mov edi, eax
call sub.jansson.dll_json_object_get
add esp, 0x18
mov ebp, eax
test ebx, ebx
je 0x40f495
cmp dword [ebx], 2
jne 0x40f495
test ebp, ebp
je 0x40f460
cmp dword [ebp], 0
jne 0x40f460
push ebp
call sub.jansson.dll_json_object_size
add esp, 4
test eax, eax
je 0x40f460
test edi, edi
je 0x40f328
cmp dword [edi], 3
jne 0x40f3f6
mov eax, dword [esp + 0x10]
push dword [eax + 8]
call fcn.004054c0
mov esi, eax
push ebx
mov dword [esp + 0x68], esi
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
add esp, 0xc
mov dword [esi], eax
test edi, edi
je 0x40f35a
push edi
call sub.jansson.dll_json_integer_value
add esp, 4
jmp 0x40f35c
mov al, 1
push 8
mov byte [esi + 8], al
call fcn.00405450
push ebp
mov dword [esi + 4], eax
call sub.jansson.dll_json_object_iter
push eax
call sub.jansson.dll_json_object_iter_key
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x40f3da
nop
push ebx
call sub.jansson.dll_json_object_key_to_iter
push eax
call sub.jansson.dll_json_object_iter_value
mov edi, eax
add esp, 8
test edi, edi
je 0x40f3da
cmp dword [edi], 3
jne 0x40f42b
push dword [esi + 4]
call fcn.004054c0
push edi
mov esi, eax
call sub.jansson.dll_json_integer_value
push ebx
mov word [esi], ax
call fcn.00406760
push ebx
mov dword [esi + 4], eax
call sub.jansson.dll_json_object_key_to_iter
push eax
push ebp
call sub.jansson.dll_json_object_iter_next
push eax
call sub.jansson.dll_json_object_iter_key
mov esi, dword [esp + 0x7c]
mov ebx, eax
add esp, 0x1c
test ebx, ebx
jne 0x40f380
mov ebx, dword [esp + 0x40]
inc ebx
mov dword [esp + 0x40], ebx
cmp ebx, dword [esp + 0x64]
jae 0x40f59e
mov edi, dword [esp + 0x20]
jmp 0x40f2a0
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f41d
push str.Malformed_config:_priority_should_be_integer_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push dword [esp + 0x1c]
push str.Malformed_config:_priority_should_be_integer
jmp 0x40f526
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f452
push str.Malformed_config:_port_should_be_integer_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push dword [esp + 0x1c]
push str.Malformed_config:_port_should_be_integer
jmp 0x40f526
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f487
push str.Malformed_config:_ports_should_be_nonempty_object_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push dword [esp + 0x1c]
push str.Malformed_config:_ports_should_be_nonempty_object
jmp 0x40f526
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f4bc
push str.Malformed_config:_address_should_be_string_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push dword [esp + 0x1c]
push str.Malformed_config:_address_should_be_string
jmp 0x40f526
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f4ee
push str.Malformed_config:_trails_should_be_array_of_objects_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push dword [esp + 0x1c]
push str.Malformed_config:_trails_should_be_array_of_objects
jmp 0x40f526
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f520
push str.Malformed_config:_trails_should_be_nonempty_array_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.Malformed_config:_trails_should_be_nonempty_array
call fcn.004129a0
lea eax, [esp + 0x90]
mov ebx, 1
push 9
push eax
call fcn.00402120
lea eax, [esp + 0x24]
push eax
call fcn.00402030
lea eax, [esp + 0x24]
push eax
call fcn.004205b0
mov ecx, dword [esp + 0x30]
add esp, 0x18
jmp 0x40f781
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f586
push str.Malformed_config:_trails_config_is_not_valid_JSON_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push ebp
push str.Malformed_config:_trails_config_is_not_valid_JSON
call fcn.004129a0
add esp, 8
mov ebx, 1
jmp 0x40f74f
mov ebp, dword [esp + 0x1c]
mov ebx, dword [esp + 0x44]
push str.connection_descriptions
push ebx
call sub.jansson.dll_json_object_get
mov edi, eax
add esp, 8
test edi, edi
je 0x40f6a0
cmp dword [edi], 1
jne 0x40f660
push edi
xor esi, esi
call sub.jansson.dll_json_array_size
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40f6c1
nop dword [eax]
push esi
push edi
call sub.jansson.dll_json_array_get
add esp, 8
test eax, eax
je 0x40f620
cmp dword [eax], 2
jne 0x40f620
push eax
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
push 1
push eax
push dword [esp + 0x24]
call fcn.00405640
inc esi
add esp, 0x14
cmp esi, ebx
jb 0x40f5e0
jmp 0x40f6c1
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f647
push str.Malformed_config:_connection_descriptions_should_be_array_of_string_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push 0
push str.Malformed_config:_connection_descriptions_should_be_array_of_string
call fcn.004129a0
add esp, 8
mov ebx, 1
jmp 0x40f74f
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f687
push str.Malformed_config:_connection_descriptions_should_be_array_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push 0
push str.Malformed_config:_connection_descriptions_should_be_array
call fcn.004129a0
add esp, 8
mov ebx, 1
jmp 0x40f74f
push 0x4dbc50
call fcn.00406760
mov dword [esp + 0x24], eax
lea eax, [esp + 0x24]
push 1
push eax
push dword [esp + 0x20]
call fcn.00405640
add esp, 0x10
xor eax, eax
cmp dword [esp + 0x10], eax
setne al
lea eax, [eax*2 + 1]
push eax
push ebp
call fcn.004115f0
mov esi, eax
add esp, 8
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40f6f4
push eax
push dword [0x506870]
call fcn.00420240
add esp, 8
mov eax, dword [esp + 0x48]
mov ecx, dword [0x50684c]
test eax, eax
jne 0x40f708
mov eax, dword [ecx + 0x180]
push esi
push dword [esp + 0x7c]
push dword [esp + 0x88]
push dword [esp + 0x30]
push dword [esp + 0x60]
push dword [esp + 0x28]
push dword [ecx + 0x190]
push dword [esp + 0x68]
push dword [esp + 0x48]
push dword [esp + 0x50]
push dword [esp + 0x58]
push dword [esp + 0x60]
push dword [esp + 0x68]
push eax
push dword [ecx + 0x17c]
call fcn.0040e6e0
add esp, 0x3c
xor ebx, ebx
lea eax, [esp + 0x88]
push 9
push eax
call fcn.00402120
lea eax, [esp + 0x1c]
push eax
call fcn.00402030
lea eax, [esp + 0x1c]
push eax
call fcn.004205b0
mov ecx, dword [esp + 0x28]
add esp, 0x10
test ecx, ecx
je 0x40f828
cmp dword [ecx + 4], 0xffffffff
je 0x40f828
mov eax, dword [ecx + 4]
add eax, 0xffffffff
mov dword [ecx + 4], eax
jne 0x40f828
push ecx
call sub.jansson.dll_json_delete
add esp, 4
jmp 0x40f828
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x40f7d3
push dword [esp + 0x50]
push str.Malformed_config:_bad_cc_mode__d_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0x10
mov eax, dword [0x50684c]
test eax, eax
je 0x40f7fd
mov eax, dword [eax + 0x1bc]
push ebp
push 9
call eax
push ebp
push str.bad_cc_mode
mov eax, dword [0x50684c]
mov eax, dword [eax + 0x1b0]
call eax
add esp, 0x10
lea eax, [esp + 0x88]
mov ebx, 1
push 9
push eax
call fcn.00402120
lea eax, [esp + 0x1c]
push eax
call fcn.00402030
lea eax, [esp + 0x1c]
push eax
call fcn.004205b0
add esp, 0x10
mov ecx, dword [esp + 0xd0]
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004c75e8
add esp, 0xc4
ret