Function at 0x180021df0
Capabilities:
Reference http user-agent string
Resolve dns
Set socket configuration

Disassembly:
push rbp
push rbx
push rsi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x40a0]
mov eax, 0x41a0
call fcn.18003d470
sub rsp, rax
mov rax, qword [0x18005b0d0]
xor rax, rsp
mov qword [rbp + 0x4090], rax
xor eax, eax
mov r13, rcx
mov rbx, rdx
mov qword [rsp + 0x48], rdx
lea rcx, [rsp + 0x64]
mov r8d, 0x401c
xor edx, edx
lea r15d, [rax + 0x50]
mov dword [rsp + 0x40], eax
mov r12d, eax
mov esi, eax
mov dword [rsp + 0x60], eax
call sub.MSVCR100.dll_memset
xor eax, eax
lea r8d, [r15 - 0x4c]
mov qword [rbp + 0x3f80], rax
mov qword [rbp + 0x3f88], rax
mov eax, 2
lea rdx, str.http
mov rcx, rbx
mov dword [r13 + 0xc], 0xffffffff
mov word [rbp + 0x3f80], ax
call qword [sym.imp.MSVCR100.dll__strnicmp]
test eax, eax
je 0x180021e97
lea eax, [r15 - 0x4d]
jmp 0x1800223ba
cmp byte [rbx + 4], 0x73
mov qword [rsp + 0x41f0], rdi
jne 0x180021ec1
lea rcx, [r13 + 0x18]
mov dword [rsp + 0x40], 1
mov r15d, 0x1bb
cmp qword [rcx], rsi
jne 0x180021ec1
call fcn.180025410
lea rcx, [rbx + 4]
mov edx, 0x3a
call qword [sym.imp.MSVCR100.dll_strchr]
mov r14d, 3
mov rdi, rax
test rax, rax
je 0x1800223af
lea rdx, [0x18004813c]
mov r8d, r14d
mov rcx, rax
call qword [sym.imp.MSVCR100.dll_strncmp]
test eax, eax
jne 0x1800223af
add rdi, r14
lea edx, [rax + 0x2f]
mov rcx, rdi
call qword [sym.imp.MSVCR100.dll_strchr]
mov rdx, rdi
mov ecx, eax
mov qword [rsp + 0x50], rax
sub ecx, edi
movsxd rbx, ecx
lea rcx, [rbp + 0x3f90]
mov r8, rbx
call qword [sym.imp.MSVCR100.dll_strncpy]
lea edx, [r14 + 0x37]
lea rcx, [rbp + 0x3f90]
mov byte [rbp + rbx + 0x3f90], sil
call qword [sym.imp.MSVCR100.dll_strrchr]
test rax, rax
je 0x180021f59
lea rcx, [rax + 1]
mov byte [rax], sil
call qword [sym.imp.MSVCR100.dll_atoi]
mov r15d, eax
lea rcx, [rbp + 0x3f90]
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rbp + 0x3f84], eax
cmp eax, 0xffffffff
jne 0x180021f97
lea rcx, [rbp + 0x3f90]
call qword [sym.imp.WS2_32.dll_gethostbyname]
test rax, rax
je 0x180021fcc
mov rax, qword [rax + 0x18]
cmp qword [rax], rsi
je 0x180021fcc
mov rax, qword [rax]
mov ecx, dword [rax]
mov dword [rbp + 0x3f84], ecx
movzx ecx, r15w
call qword [sym.imp.ca_core.dll_Ordinal_9]
mov edi, 6
lea edx, [rdi - 5]
lea ecx, [rdi - 4]
mov r8d, edi
mov word [rbp + 0x3f82], ax
call qword [sym.imp.ca_core.dll_Ordinal_23]
mov dword [rsp + 0x60], eax
cmp eax, 0xffffffff
jne 0x180021fd6
mov eax, edi
jmp 0x1800223b2
mov eax, 6
jmp 0x1800223b2
mov rcx, qword [rsp + 0x48]
mov r8, qword [rsp + 0x50]
lea r9, str.Mozilla_5.0
mov qword [rsp + 0x30], rcx
mov eax, r8d
lea rdx, str.GET__s_HTTP_1.0_r_nUser_Agent:__s_r_nHost:__s_r_nReferer:__.s_r_n
sub eax, ecx
lea rcx, [rsp + 0x70]
inc eax
mov dword [rsp + 0x28], eax
lea rax, [rbp + 0x3f90]
mov qword [rsp + 0x20], rax
call qword [sym.imp.MSVCR100.dll_sprintf]
mov r8, qword [r13]
movsxd rbx, eax
cmp byte [r8], sil
je 0x180022035
lea rcx, [rsp + rbx + 0x70]
lea rdx, str.If_Modified_Since:__s_r_n
call qword [sym.imp.MSVCR100.dll_sprintf]
add ebx, eax
movsxd rcx, ebx
lea rdx, [0x180048d98]
lea rcx, [rsp + rcx + 0x70]
call qword [sym.imp.MSVCR100.dll_sprintf]
movsxd rcx, dword [rsp + 0x60]
lea rdx, [rbp + 0x3f80]
mov r8d, reloc.ca_core.dll_Ordinal_16
add ebx, eax
call qword [sym.imp.gifenc.dll_Ordinal_4]
test eax, eax
jns 0x18002206f
mov esi, edi
jmp 0x18002236e
cmp dword [rsp + 0x40], esi
je 0x1800220c3
mov rcx, qword [r13 + 0x18]
call qword [sym.imp.libssl_3.dll_SSL_new]
mov edx, dword [rsp + 0x60]
mov rcx, rax
mov qword [rbp + 0x3f78], rax
call qword [sym.imp.libssl_3.dll_SSL_set_fd]
mov rcx, qword [rbp + 0x3f78]
call qword [sym.imp.libssl_3.dll_SSL_connect]
test eax, eax
jns 0x1800220c3
lea r8, str.HTTP_get
lea rdx, str._s__TLS_Connect_failed
mov ecx, 1
call fcn.180022fd0
mov esi, edi
jmp 0x18002236e
mov rcx, qword [rbp + 0x3f78]
mov r8d, ebx
lea rdx, [rsp + 0x70]
test rcx, rcx
je 0x1800220df
call qword [sym.imp.libssl_3.dll_SSL_write]
jmp 0x1800220ed
movsxd rcx, dword [rsp + 0x60]
xor r9d, r9d
call qword [sym.imp.zlibwapi.dll_Ordinal_19]
movsxd rcx, dword [rsp + 0x60]
lea r9, [rsp + 0x40]
mov edx, 0xffff
mov r8d, 0x1006
mov dword [rsp + 0x40], 0x1388
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x180022139
mov r9d, 5
lea r8, str.HTTP_get
lea rdx, str._s__Setting_socket_timeout_to__ds_failed_
lea ecx, [r9 - 4]
call fcn.180022fd0
lea rcx, [rsp + 0x60]
mov dword [rsp + 0x64], esi
mov dword [rbp + 0x3f70], esi
call fcn.18002c580
cmp eax, 1
jge 0x180022159
mov esi, edi
jmp 0x18002236e
lea rdx, str.HTTP_1
lea rcx, [rsp + 0x70]
mov r8, rdi
call qword [sym.imp.MSVCR100.dll_strncmp]
test eax, eax
je 0x18002217a
mov esi, r14d
jmp 0x18002236e
lea rcx, [rsp + 0x70]
mov edx, 0x20
call qword [sym.imp.MSVCR100.dll_strchr]
lea rcx, [rax + 1]
call qword [sym.imp.MSVCR100.dll_atoi]
mov dword [r13 + 0xc], eax
cmp eax, reloc.mfc100.dll_Ordinal_300
jl 0x1800221da
cmp eax, 0x130
jne 0x1800221b0
mov esi, 1
jmp 0x18002236e
cmp eax, 0x194
jne 0x1800221be
mov esi, 2
jmp 0x1800221da
cmp eax, 0x1f4
jl 0x1800221cc
mov esi, 4
jmp 0x1800221da
mov esi, 5
cmp eax, 0x190
cmovge esi, r14d
movsxd r8, dword [rsp + 0x64]
lea rcx, [rsp + 0x70]
mov edx, 0xa
call qword [sym.imp.MSVCR100.dll_memchr]
test rax, rax
jne 0x1800221fc
mov esi, r14d
jmp 0x18002236e
mov edx, dword [rsp + 0x64]
lea rcx, [rax + 1]
lea rax, [rsp + 0x70]
sub eax, ecx
mov qword [rsp + 0x68], rcx
add edx, eax
mov dword [rsp + 0x64], edx
movsxd r8, edx
mov edx, Ordinal_16
call qword [sym.imp.MSVCR100.dll_memchr]
mov rbx, rax
test rax, rax
je 0x1800222f7
mov rcx, qword [rsp + 0x68]
cmp byte [rcx], 0xd
je 0x180022355
lea rdx, str.Content_Length:
mov r8d, reloc.ca_core.dll_Ordinal_16
call qword [sym.imp.MSVCR100.dll__strnicmp]
mov rcx, qword [rsp + 0x68]
test eax, eax
jne 0x180022269
add rcx, 0x10
call qword [sym.imp.MSVCR100.dll_atoi]
mov r12d, eax
jmp 0x1800222a0
lea rdx, str.Last_Modified:
mov r8d, Ordinal_16
call qword [sym.imp.MSVCR100.dll__strnicmp]
test eax, eax
jne 0x1800222a0
mov byte [rbx], al
mov rcx, qword [rsp + 0x68]
mov rdx, qword [r13]
add rcx, 0xf
nop
movzx eax, byte [rcx]
inc rdx
inc rcx
mov byte [rdx - 1], al
test al, al
jne 0x180022290
mov eax, dword [rsp + 0x68]
mov ecx, dword [rsp + 0x64]
add rbx, 2
sub eax, ebx
mov qword [rsp + 0x68], rbx
add ecx, eax
mov dword [rsp + 0x64], ecx
cmp ecx, 1
jge 0x1800222da
lea rcx, [rsp + 0x60]
call fcn.18002c580
cmp eax, 1
jl 0x180022152
mov rbx, qword [rsp + 0x68]
mov ecx, dword [rsp + 0x64]
movsxd r8, ecx
mov edx, Ordinal_16
mov rcx, rbx
call qword [sym.imp.MSVCR100.dll_memchr]
mov rbx, rax
test rax, rax
jne 0x180022230
mov ecx, dword [rsp + 0x64]
xor eax, eax
test r12d, r12d
setg al
movsxd rbx, eax
test rbx, rbx
je 0x180022310
test r12d, r12d
jle 0x18002236e
test ecx, ecx
jg 0x180022326
lea rcx, [rsp + 0x60]
call fcn.18002c580
test eax, eax
jle 0x180022368
mov ecx, dword [rsp + 0x64]
mov r9, qword [r13 + 0x10]
movsxd r8, ecx
mov rcx, qword [rsp + 0x68]
mov edx, 1
call fcn.1800223e0
mov r11d, dword [rsp + 0x64]
test rbx, rbx
je 0x180022349
sub r12d, r11d
add dword [r13 + 8], r11d
xor ecx, ecx
mov dword [rsp + 0x64], ecx
jmp 0x180022306
mov ecx, dword [rsp + 0x64]
add qword [rsp + 0x68], 2
sub ecx, 2
mov dword [rsp + 0x64], ecx
jmp 0x1800222fb
test r12d, r12d
cmovg esi, edi
mov rcx, qword [rbp + 0x3f78]
test rcx, rcx
je 0x180022398
call qword [sym.imp.libssl_3.dll_SSL_shutdown]
mov rcx, qword [rbp + 0x3f78]
call qword [sym.imp.libssl_3.dll_SSL_free]
mov qword [rbp + 0x3f78], 0
movsxd rax, dword [rsp + 0x60]
cmp eax, 0xffffffff
je 0x1800223ab
mov rcx, rax
call qword [sym.imp.gifenc.dll_Ordinal_3]
mov eax, esi
jmp 0x1800223b2
mov eax, r14d
mov rdi, qword [rsp + 0x41f0]
mov rcx, qword [rbp + 0x4090]
xor rcx, rsp
call fcn.18003c580
add rsp, 0x41a0
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbx
pop rbp
ret