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

Disassembly:
sub esp, 0x468
mov eax, dword [0x501230]
xor eax, esp
mov dword [esp + 0x464], eax
push ebx
mov ebx, dword [esp + 0x470]
push esi
mov esi, dword [esp + 0x478]
test ebx, ebx
je 0x4128f2
cmp dword [ebx], 0
jne 0x4128f2
push ebp
lea eax, [esi + 0xc]
mov dword [esp + 0x20], str.log_file
mov dword [esp + 0x10], eax
lea eax, [esi + 0x180]
push ebx
mov dword [esp + 0x18], eax
lea eax, [esi + 0x17c]
push 0
mov dword [esp + 0x20], eax
lea eax, [esp + 0x14]
push 0
push 0
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x20]
push 4
push eax
lea eax, [esp + 0x38]
mov dword [esp + 0x3c], 0x4daea8
push eax
mov dword [esp + 0x44], str.whoami
mov dword [esp + 0x48], str.encryption
call fcn.00402440
push str.interface
push ebx
call sub.jansson.dll_json_object_get
mov ebp, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0x24
test eax, eax
je 0x41243f
cmp dword [eax], 2
jne 0x41243f
push eax
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
push eax
mov dword [esi + 0x24], eax
lea eax, [esp + 0x5c]
push 0x20
push eax
lea eax, [esp + 0x44]
push 0x20
push eax
call fcn.00402b20
add esp, 0x1c
test eax, eax
je 0x41243f
push dword [esi + 0x20]
call ebp
lea eax, [esp + 0x34]
push eax
call fcn.00406760
push dword [esi + 0x1c]
mov dword [esi + 0x20], eax
call ebp
lea eax, [esp + 0x5c]
push eax
call fcn.00406760
add esp, 0x10
mov dword [esi + 0x1c], eax
push edi
push str.device_id
push ebx
call sub.jansson.dll_json_object_get
mov edi, eax
add esp, 8
test edi, edi
je 0x412470
cmp dword [edi], 2
jne 0x412470
push dword [esi + 0x20]
call ebp
push edi
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
add esp, 0xc
mov dword [esi + 0x20], eax
push dword [esi + 0x190]
call ebp
push str.cc_flags
push ebx
mov dword [esi + 0x190], 0
call sub.jansson.dll_json_object_get
add esp, 0xc
test eax, eax
je 0x4124a8
push 0x620
push eax
call sub.jansson.dll_json_dumps
add esp, 8
mov dword [esi + 0x190], eax
push str.uupi
push ebx
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x41257d
cmp dword [eax], 2
jne 0x412535
push eax
call sub.jansson.dll_json_string_value
push eax
lea eax, [esi + 0x194]
push eax
call fcn.004c98c0
add esp, 0xc
test eax, eax
jne 0x41258c
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x412508
push str.Malformed_config:_bad_uupi_value_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push 0
push str.invalid_uupi_value
call fcn.004129a0
add esp, 8
mov eax, 1
pop edi
pop ebp
pop esi
pop ebx
mov ecx, dword [esp + 0x464]
xor ecx, esp
call fcn.004c75e8
add esp, 0x468
ret
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x41255c
push str.Malformed_config:_uupi_should_be_string_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
mov eax, dword [0x50684c]
test eax, eax
je 0x412517
mov eax, dword [eax + 0x1bc]
push 0
push 9
call eax
push 0
push str.bad_uupi_type
jmp 0x4126de
lea eax, [esi + 0x194]
push eax
call fcn.004c9ba0
add esp, 4
mov eax, dword [esp + 0x10]
mov dword [esi + 0x3c], 3
test eax, eax
jne 0x4125a4
mov dword [esi + 0x3c], 2
jmp 0x4125e4
mov ebp, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
xor edi, edi
mov eax, 3
cmp eax, 3
jne 0x4125da
push edi
call fcn.004ca810
push eax
push dword [esp + 0x18]
call ebp
add esp, 0xc
test eax, eax
jne 0x4125d1
mov dword [esi + 0x3c], edi
mov eax, edi
jmp 0x4125d4
mov eax, dword [esi + 0x3c]
inc edi
cmp edi, 3
jl 0x4125b1
mov eax, dword [esp + 0x10]
mov ebp, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push eax
call ebp
add esp, 4
cmp dword [esi + 0x3c], 3
jne 0x41263c
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x412617
push str.Malformed_config:_invalid_encryption_value_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
mov eax, dword [0x50684c]
test eax, eax
je 0x412517
mov eax, dword [eax + 0x1bc]
push 0
push 9
call eax
push 0
push str.invalid_encryption_value
jmp 0x4126de
cmp dword [esi + 0x180], 0
jne 0x41268e
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x41266c
push str.Malformed_config:_cloud_address__cc__is_not_defined_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
mov eax, dword [0x50684c]
test eax, eax
je 0x412517
mov eax, dword [eax + 0x1bc]
push 0
push 9
call eax
push 0
push str.Cloud_address_is_not_defined
jmp 0x4126de
cmp dword [esi + 0x17c], 0
jne 0x4126f3
push 0
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x4126be
push str.Malformed_config:_whoami_is_not_defined_n
push 0
push str.MAIN
call fcn.00407400
add esp, 0xc
mov eax, dword [0x50684c]
test eax, eax
je 0x412517
mov eax, dword [eax + 0x1bc]
push 0
push 9
call eax
push 0
push str.Whoami_is_not_defined
mov eax, dword [0x50684c]
mov eax, dword [eax + 0x1b0]
call eax
add esp, 0x10
jmp 0x412517
push str.dump_file
push ebx
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x412719
cmp dword [eax], 2
jne 0x412719
push eax
call sub.jansson.dll_json_string_value
push eax
call fcn.00401510
add esp, 8
push str.verbosity
push ebx
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x412740
cmp dword [eax], 3
jne 0x4127b6
push eax
call sub.jansson.dll_json_integer_value
add esp, 4
mov dword [esi + 4], eax
push str.facility
push ebx
call sub.jansson.dll_json_object_get
mov edi, eax
add esp, 8
test edi, edi
je 0x412770
cmp dword [edi], 2
jne 0x412770
push dword [esi + 8]
call ebp
push edi
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
add esp, 0xc
mov dword [esi + 8], eax
push str.upnp_discovery_enabled
push ebx
xor edi, edi
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x412794
cmp dword [eax], 3
jne 0x4127e9
push eax
call sub.jansson.dll_json_integer_value
add esp, 4
mov edi, eax
push str.upnp_prefix
push ebx
call sub.jansson.dll_json_object_get
add esp, 8
test eax, eax
je 0x41281c
cmp dword [eax], 2
jne 0x41281c
push eax
call sub.jansson.dll_json_string_value
add esp, 4
jmp 0x412821
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x4127dd
push str.Malformed_config:_verbosity_should_be_integer_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push 0
push str.Malformed_config:_verbosity_should_be_integer
jmp 0x41250f
push 1
push str.MAIN
call fcn.004073a0
add esp, 8
test eax, eax
je 0x412810
push str.Malformed_config:_upnp_discovery_enabled_should_be_integer_n
push 1
push str.MAIN
call fcn.00407400
add esp, 0xc
push 0
push str.Malformed_config:_upnp_discovery_enabled_should_be_integer
jmp 0x41250f
mov eax, 0x4dbc50
push dword [esi + 0x20]
push dword [esi + 0x17c]
push eax
push str._s_tube:_s__s
lea eax, [esp + 0x84]
push 0x400
push eax
call fcn.004066e0
push str.upnp_gate
push ebx
call sub.jansson.dll_json_object_get
add esp, 0x20
test eax, eax
je 0x412864
cmp dword [eax], 2
jne 0x412864
push eax
call sub.jansson.dll_json_string_value
add esp, 4
jmp 0x412869
mov eax, 0x4dbc50
push eax
lea eax, [esp + 0x78]
push eax
push edi
call fcn.00414b70
push str.experimental_features
push ebx
call sub.jansson.dll_json_object_get
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x4128eb
cmp dword [ebx], 1
jne 0x4128eb
push ebx
xor edi, edi
call sub.jansson.dll_json_array_size
add esp, 4
test eax, eax
je 0x4128eb
nop dword [eax]
push edi
push ebx
call sub.jansson.dll_json_array_get
add esp, 8
test eax, eax
je 0x4128dd
cmp dword [eax], 2
jne 0x4128dd
push eax
call sub.jansson.dll_json_string_value
push eax
call fcn.00406760
mov ebp, eax
push ebp
push dword [esi + 0x1dc]
call fcn.00408d50
add esp, 0x10
test eax, eax
je 0x4128dd
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
push ebx
inc edi
call sub.jansson.dll_json_array_size
add esp, 4
cmp edi, eax
jb 0x4128a0
xor eax, eax
jmp 0x41251c
push str.Malformed_config_file__root_is_not_an_object_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.004020f0
mov ecx, dword [esp + 0x474]
add esp, 8
mov eax, 1
pop esi
pop ebx
xor ecx, esp
call fcn.004c75e8
add esp, 0x468
ret