Function at 0x474610
Capabilities:
Create tcp socket
Create udp socket
Initialize winsock library
Resolve dns

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
movzx eax, word [0x5060e8]
cmp eax, 0xffff
je 0x4746f6
test eax, eax
jne 0x4746a7
push 0x5060e8
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x474695
movzx eax, word [0x5060e8]
cmp eax, 0x202
jne 0x474695
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
je 0x474695
mov esi, eax
movups xmm0, xmmword [0x4f7ac0]
movups xmmword [esp + 0xc], xmm0
lea eax, [esp + 4]
lea ecx, [esp + 0xc]
push 0
push 0
push eax
push 4
push 0x505ca8
push 0x10
push ecx
push 0xc8000006
push esi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x4746a0
mov word [0x5060e8], 0xffff
jmp 0x4746f6
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [esp + 0x50]
xorps xmm0, xmm0
movups xmmword [esi], xmm0
mov dword [esi + 0x14], 0
mov dword [esi + 0x10], 0
movups xmmword [esp + 0x1c], xmm0
movups xmmword [esp + 0x2c], xmm0
mov dword [esp + 0x20], 2
mov dword [esp + 0x24], 1
lea eax, [esp + 4]
lea ecx, [esp + 0x1c]
push eax
push ecx
push 0x4f7a80
push dword [esp + 0x60]
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x474702
xor ebx, ebx
mov eax, ebx
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax + 8]
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi], eax
cmp eax, 0xffffffff
je 0x474751
movups xmm0, xmmword [0x4f7a84]
movups xmmword [esp + 0xc], xmm0
lea ecx, [esp + 0xc]
push 0x10
push ecx
push eax
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x47475d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
sub esp, 8
mov dword [esp + 4], eax
call dbg.printf
add esp, 8
jmp 0x4746f6
push dword [esp + 4]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x4746f6
mov edi, dword [esp + 0x58]
push 0x40
call sym._malloc
add esp, 4
mov esi, eax
mov dword [eax], 0x20544547
mov byte [eax + 4], 0
mov ebx, 4
mov ebp, 0x40
test edi, edi
je 0x474817
mov dword [esp], esi
push edi
call sym._strlen
add esp, 4
test eax, eax
je 0x4747ed
mov esi, eax
cmp eax, 0x3b
jbe 0x4747f6
mov ebx, edi
lea eax, [esi + 5]
mov ecx, 0x40
nop word [eax + eax]
mov ebp, ecx
add ecx, ecx
cmp eax, ebp
ja 0x4747b0
push ebp
push dword [esp + 4]
call sym._realloc
add esp, 8
mov edi, eax
add eax, 4
push esi
push ebx
push eax
call sym._memcpy
add esp, 0xc
mov ebx, esi
add ebx, 4
mov byte [edi + esi + 4], 0
mov esi, edi
test ebp, ebp
jne 0x474817
mov al, 1
mov edi, dword [esp + 0x54]
jmp 0x47482c
mov edi, dword [esp + 0x54]
mov esi, dword [esp]
jmp 0x47481b
mov ecx, edi
mov edi, dword [esp]
mov eax, edi
add eax, 4
push esi
push ecx
push eax
call sym._memcpy
add esp, 0xc
mov ebx, esi
add ebx, 4
mov byte [edi + esi + 4], 0
mov esi, edi
mov edi, dword [esp + 0x54]
mov eax, ebx
not eax
add eax, ebp
cmp eax, 0xf
ja 0x47486d
xor eax, eax
test ebp, ebp
jne 0x474831
mov ebp, 0x20
lea ecx, [ebx + 0x11]
mov edx, ebp
nop word cs:[eax + eax]
mov ebp, edx
add edx, edx
cmp ecx, ebp
ja 0x474840
test al, al
je 0x474871
push ebp
call sym._malloc
add esp, 4
test ebx, ebx
je 0x47487d
lea ecx, [ebx + 1]
push ecx
push esi
push eax
mov esi, eax
call sym._memcpy
mov eax, esi
add esp, 0xc
jmp 0x474882
mov eax, esi
jmp 0x474882
push ebp
push esi
call sym._realloc
add esp, 8
jmp 0x474882
mov byte [eax], 0
xor ebx, ebx
movups xmm0, xmmword [str._HTTP_1.1_nHost:]
movups xmmword [eax + ebx], xmm0
lea esi, [ebx + 0x10]
mov byte [eax + ebx + 0x10], 0
test edi, edi
je 0x47492b
mov dword [esp], eax
push edi
call sym._strlen
add esp, 4
test eax, eax
je 0x4748ff
test ebp, ebp
mov dword [esp + 8], eax
je 0x4748c0
mov ecx, ebp
sub ecx, ebx
add ecx, 0xffffffef
cmp ecx, eax
jae 0x474904
cmp ebp, 2
mov edx, 0x20
cmovae edx, ebp
lea ecx, [ebx + eax]
add ecx, 0x11
add ebx, 0x11
nop word cs:[eax + eax]
mov edi, edx
add edx, edx
cmp ecx, edi
ja 0x4748e0
test ebp, ebp
mov eax, dword [esp]
je 0x47498f
push edi
push eax
call sym._realloc
add esp, 8
jmp 0x474909
mov eax, dword [esp]
jmp 0x47492b
mov eax, dword [esp]
mov edi, ebp
mov ebp, eax
lea eax, [esi + ebp]
mov ebx, dword [esp + 8]
push ebx
push dword [esp + 0x58]
push eax
call sym._memcpy
add esp, 0xc
add esi, ebx
mov byte [ebp + esi], 0
mov eax, ebp
mov ebp, edi
mov ecx, dword [esp + 0x5c]
test ebp, ebp
je 0x47493e
mov edx, esi
not edx
add edx, ebp
cmp edx, 1
ja 0x474968
mov ebx, ecx
cmp ebp, 2
mov edx, 0x20
cmovae edx, ebp
lea ecx, [esi + 3]
nop
mov edi, edx
add edx, edx
cmp ecx, edi
ja 0x474950
test ebp, ebp
je 0x47496c
push edi
push eax
call sym._realloc
add esp, 8
jmp 0x4749b8
mov edi, ebp
jmp 0x4749ba
mov ebp, eax
push edi
call sym._malloc
add esp, 4
test esi, esi
je 0x4749b5
lea ecx, [esi + 1]
push ecx
push ebp
push eax
mov ebp, eax
call sym._memcpy
mov eax, ebp
add esp, 0xc
jmp 0x4749b8
push edi
call sym._malloc
add esp, 4
mov ebp, eax
test esi, esi
je 0x474b5d
push ebx
push dword [esp + 4]
push ebp
call sym._memcpy
add esp, 0xc
jmp 0x47490b
mov byte [eax], 0
mov ecx, ebx
mov word [eax + esi], 0xa0d
lea ebx, [esi + 2]
mov byte [eax + esi + 2], 0
test ecx, ecx
je 0x474a5b
mov dword [esp], eax
push ecx
call sym._strlen
add esp, 4
test eax, eax
je 0x474a2f
test edi, edi
mov dword [esp + 8], eax
je 0x4749f3
mov ecx, edi
sub ecx, esi
add ecx, 0xfffffffd
cmp ecx, eax
jae 0x474a34
cmp edi, 2
mov edx, 0x20
cmovae edx, edi
lea ecx, [esi + eax]
add ecx, 3
add esi, 3
nop word [eax + eax]
mov ebp, edx
add edx, edx
cmp ecx, ebp
ja 0x474a10
test edi, edi
mov eax, dword [esp]
je 0x474b33
push ebp
push eax
call sym._realloc
add esp, 8
jmp 0x474a39
mov eax, dword [esp]
jmp 0x474a5b
mov eax, dword [esp]
mov ebp, edi
mov edi, eax
mov ecx, dword [esp + 0x5c]
lea eax, [edi + ebx]
mov esi, dword [esp + 8]
push esi
push ecx
push eax
call sym._memcpy
add esp, 0xc
add ebx, esi
mov byte [edi + ebx], 0
mov eax, edi
mov edi, ebp
test edi, edi
je 0x474a6f
mov ecx, ebx
not ecx
add ecx, edi
mov ebp, 1
cmp ecx, 1
ja 0x474a96
cmp edi, 2
mov edx, 0x20
cmovae edx, edi
lea ecx, [ebx + 3]
nop dword [eax]
mov ebp, edx
add edx, edx
cmp ecx, ebp
ja 0x474a80
test edi, edi
je 0x474b07
push ebp
push eax
call sym._realloc
add esp, 8
mov esi, eax
mov edi, dword [esp + 0x50]
mov word [esi + ebx], 0xa0d
mov byte [esi + ebx + 2], 0
add ebx, 2
mov eax, dword [esp + 4]
lea ecx, [edi + 4]
push ecx
push 0
push ebx
push esi
push dword [eax + 0x10]
push dword [eax + 0x18]
push dword [edi]
call dword [0x505ca8]
mov edi, eax
push dword [esp + 4]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov bl, 1
test edi, edi
jne 0x474af1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x3e5
je 0x474af1
mov eax, dword [esp + 0x50]
push dword [eax]
call dword [sym.imp.WS2_32.dll_closesocket]
xor ebx, ebx
test ebp, ebp
je 0x4746f8
push esi
call sym._free
add esp, 4
jmp 0x4746f8
mov dword [esp], eax
push ebp
call sym._malloc
add esp, 4
mov esi, eax
test ebx, ebx
mov edi, dword [esp + 0x50]
je 0x474b55
lea eax, [ebx + 1]
push eax
push dword [esp + 4]
push esi
call sym._memcpy
add esp, 0xc
jmp 0x474a9c
push ebp
call sym._malloc
add esp, 4
mov edi, eax
test ebx, ebx
je 0x474b66
push esi
push dword [esp + 4]
push edi
call sym._memcpy
add esp, 0xc
jmp 0x474a3b
mov byte [esi], 0
jmp 0x474a9c
mov byte [ebp], 0
jmp 0x47490b
mov byte [edi], 0
jmp 0x474a3b