Function at 0x404d90
Capabilities:
Read file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x988]
sub esp, 0x988
push 0xffffffffffffffff
push 0x4ccce6
mov eax, dword fs:[0]
push eax
sub esp, 0x14
mov eax, dword [0x501230]
xor eax, ebp
mov dword [ebp + 0x984], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x994]
call fcn.0040c250
call fcn.00429f00
call fcn.00407ef0
push 0
push 0x3e8
push edx
push eax
call fcn.004c7640
push eax
call dword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
add esp, 4
call fcn.004129d0
mov dword [0x506400], eax
call fcn.00405dd0
test eax, eax
je 0x404e3e
push 0
push 0x4db844
call fcn.004073a0
add esp, 8
test eax, eax
je 0x404ed0
push str.portable_init_failed_n
push 0
push 0x4db844
call fcn.00407400
add esp, 0xc
mov eax, 1
jmp 0x4053bd
mov esi, dword [ebp + 0x990]
push edi
push esi
call fcn.004044a0
add esp, 8
test eax, eax
jne 0x405200
push eax
push 0x20
lea eax, [ebp + 0x944]
push eax
lea eax, [ebp + 0x964]
push 0x20
push eax
call fcn.00402b20
add esp, 0x14
test eax, eax
je 0x404ea2
lea eax, [ebp + 0x964]
push eax
call fcn.00406760
mov ecx, dword [0x506400]
mov dword [ecx + 0x20], eax
lea eax, [ebp + 0x944]
push eax
call fcn.00406760
mov ecx, dword [0x506400]
add esp, 8
mov dword [ecx + 0x1c], eax
push dword [0x506400]
push edi
push esi
call fcn.00404110
add esp, 0xc
cmp eax, 1
jne 0x404eda
push str.Command_line_arguments_parsing_failed_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
add esp, 8
mov eax, 1
jmp 0x4053bd
mov eax, dword [0x506400]
mov edx, dword [eax + 0x10]
test edx, edx
je 0x4050de
mov ecx, edx
mov dword [ebp + 0x12c], 0
mov dword [ebp + 0x13c], 0
mov dword [ebp + 0x140], 0xf
mov byte [ebp + 0x12c], 0
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404f14
sub ecx, esi
push ecx
push edx
lea ecx, [ebp + 0x12c]
call fcn.00404760
mov ebx, dword [ebp + 0x140]
lea eax, [ebp + 0x12c]
mov edi, dword [ebp + 0x12c]
cmp ebx, 0x10
mov dword [ebp - 4], 0
cmovae eax, edi
cmp dword [ebp + 0x13c], 1
jne 0x404f92
movzx eax, byte [eax]
cmp al, 0x21
jne 0x404f5d
xor eax, eax
jmp 0x404f62
sbb eax, eax
or eax, 1
test eax, eax
jne 0x404f92
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
push 0x8000
push eax
call esi
push 0x8000
push 1
call esi
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__dup]
add esp, 0x14
mov dword [0x501040], eax
jmp 0x405050
push 0x4db9a0
lea eax, [ebp + 0x12c]
push eax
lea eax, [ebp + 0x114]
push eax
call fcn.004036d0
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
push ecx
push eax
call fcn.0045f570
add esp, 0x14
mov byte [ebp - 4], 0
lea ecx, [ebp + 0x114]
mov bl, al
call fcn.00403c80
test bl, bl
jne 0x405151
push 0x4db9a4
lea eax, [ebp + 0x12c]
push eax
lea eax, [ebp + 0xfc]
push eax
call fcn.004036d0
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 2
push ecx
push eax
call fcn.0045f570
add esp, 0x14
mov byte [ebp - 4], 0
lea ecx, [ebp + 0xfc]
mov bl, al
call fcn.00403c80
test bl, bl
jne 0x405151
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__open_osfhandle]
push 0
push dword [ebp - 0x18]
call esi
push 0
push dword [ebp - 0x1c]
mov dword [0x501040], eax
call esi
mov esi, eax
push 0
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__dup2]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__close]
mov ebx, dword [ebp + 0x140]
add esp, 0x1c
mov edi, dword [ebp + 0x12c]
push 0
lea eax, [ebp - 0x20]
push eax
push 0
push 0x40
push 1
push 0x4db9a8
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__sopen_dispatch]
mov esi, dword [ebp - 0x20]
or ecx, 0xffffffff
test eax, eax
push 1
cmovne esi, ecx
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__dup2]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__close]
add esp, 0x24
mov dword [ebp - 4], 0xffffffff
cmp ebx, 0x10
jb 0x4050be
lea ecx, [ebx + 1]
mov eax, edi
cmp ecx, 0x1000
jb 0x4050b4
mov edi, dword [edi - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4050b4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edi
call fcn.004c7626
add esp, 8
mov eax, dword [0x506400]
mov dword [ebp + 0x13c], 0
mov dword [ebp + 0x140], 0xf
mov byte [ebp + 0x12c], 0
mov ecx, dword [eax + 0x34]
test ecx, ecx
je 0x405207
cmp dword [0x501040], 0xffffffff
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
je 0x4051eb
sub ecx, 1
jne 0x4051eb
push dword [eax + 0x17c]
push dword [eax + 0x188]
lea eax, [ebp + 0x144]
push str._s_tube:_s__null_
push 0x400
push eax
call fcn.004066e0
lea eax, [ebp + 0x144]
push eax
call sym.tube_vc142.exe_api_upnp_discovery_rootdesc_url
add esp, 0x18
test eax, eax
je 0x40519b
push eax
lea eax, [ebp + 0x544]
push 0x4da8b4
push eax
call fcn.00402f80
add esp, 0xc
jmp 0x4051af
mov edx, dword [ebp + 0x140]
cmp edx, 0x10
jb 0x404ed0
mov ecx, dword [ebp + 0x12c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x405187
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x405187
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004c7626
add esp, 8
mov eax, 1
jmp 0x4053bd
lea eax, [ebp + 0x544]
push str.no_IGD_found
push eax
call fcn.00402f80
add esp, 8
mov dword [ebp - 0x14], eax
test eax, eax
jle 0x4051eb
push 1
lea eax, [ebp - 0xe]
mov byte [ebp - 0xe], 5
push eax
push dword [0x501040]
call esi
push 4
lea eax, [ebp - 0x14]
push eax
push dword [0x501040]
call esi
push dword [ebp - 0x14]
lea eax, [ebp + 0x544]
push eax
push dword [0x501040]
call esi
add esp, 0x24
push 1
lea eax, [ebp - 0xd]
mov byte [ebp - 0xd], 4
push eax
push dword [0x501040]
call esi
add esp, 0xc
xor eax, eax
jmp 0x4053bd
mov eax, dword [eax + 0x18]
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
test eax, eax
je 0x40526e
push 0x4da97c
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x405254
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call fcn.004067e0
add esp, 4
push eax
push str.Failed_to_open_config_file___s_n
push 2
call edi
add esp, 4
push eax
call fcn.004020f0
add esp, 0xc
jmp 0x4052dd
lea eax, [ebp]
push eax
push 0
push ebx
call sub.jansson.dll_json_loadf
push ebx
mov esi, eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x10
jmp 0x4052d9
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__read]
lea eax, [ebp - 0x14]
push 4
push eax
push 0
call esi
add esp, 0xc
cmp eax, 4
jne 0x4053e0
push dword [ebp - 0x14]
call fcn.00407e00
push dword [ebp - 0x14]
mov ebx, eax
push ebx
push 0
call esi
mov ecx, dword [ebp - 0x14]
add esp, 0x10
cmp eax, ecx
jne 0x4053f4
push ebx
push ecx
push str.Got_config_from_pipe:_n_.s_n
push 2
call edi
add esp, 4
push eax
call fcn.004020f0
lea eax, [ebp]
push eax
push 0
push dword [ebp - 0x14]
push ebx
call sub.jansson.dll_json_loadb
push ebx
mov esi, eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0x24
test esi, esi
jne 0x405300
lea eax, [ebp + 0x5c]
push eax
push str.Unable_to_load_config:__s_n
push 2
call edi
add esp, 4
push eax
call fcn.004020f0
add esp, 0xc
mov eax, 1
jmp 0x4053bd
push dword [0x506400]
push esi
call fcn.00412340
add esp, 8
cmp eax, 1
je 0x404ed0
mov eax, dword [0x506400]
push dword [eax + 0xc]
push dword [eax + 8]
push dword [eax + 4]
call fcn.004029b0
push dword [0x506400]
call fcn.00412be0
add esp, 0x10
call fcn.00413020
mov edi, eax
test edi, edi
jne 0x405357
push esi
call fcn.00411c50
add esp, 4
mov ecx, 1
test eax, eax
cmovne edi, ecx
cmp dword [esi + 4], 0xffffffff
je 0x405371
mov eax, dword [esi + 4]
add eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x405371
push esi
call sub.jansson.dll_json_delete
add esp, 4
test edi, edi
jne 0x40537c
call fcn.00412d30
mov edi, eax
call fcn.00412e70
push 0x506400
call fcn.00412ae0
add esp, 4
call fcn.00401500
call fcn.00402950
mov eax, dword [0x501040]
cmp eax, 0xffffffff
je 0x4053b6
push 1
lea ecx, [ebp - 0xd]
mov byte [ebp - 0xd], 4
push ecx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
add esp, 0xc
xor eax, eax
test edi, edi
setne al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x984]
xor ecx, ebp
call fcn.004c75e8
lea esp, [ebp + 0x988]
pop ebp
ret
push 0x103
push str..._tech1utils_tube_standalone.c
push str.bytes__sizeof_size_
call fcn.00462910
push 0x107
push str..._tech1utils_tube_standalone.c
push str.bytes___ssize_t_size
call fcn.00462910
int3