Function at 0x508a50
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket
Reference http user-agent string
Resolve dns
Resolve function by parsing pe exports
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push 0xffffffffffffffff
push 0x5738e3
mov eax, dword fs:[0]
push eax
mov eax, 0x1328
call fcn.0053fde0
mov eax, dword [0x5bda40]
xor eax, esp
mov dword [esp + 0x1320], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5bda40]
xor eax, esp
push eax
lea eax, [esp + 0x133c]
mov dword fs:[0], eax
mov eax, dword [esp + 0x134c]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1350]
xor ebx, ebx
push eax
lea ecx, [esp + 0x2a0]
mov dword [esp + 0x1348], ebx
call fcn.004020a0
mov byte [esp + 0x1344], 1
nop
mov edi, dword [esp + 0x14]
lea ecx, [esp + 0x29c]
push ecx
lea ebp, [edi + 0x14]
mov ecx, ebp
mov dword [esp + 0x20], ebx
mov dword [edi + 0x7c], 0xffffffff
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
call fcn.00403050
lea edx, [esp + 0x1354]
lea esi, [edi + 0x30]
push edx
mov ecx, esi
call fcn.00403050
mov ecx, esi
call fcn.00402120
test al, al
je 0x508b8e
push ebx
push 0x5a3c48
mov ecx, ebp
call fcn.00410e00
mov esi, eax
cmp esi, 0xffffffff
je 0x508b8e
lea ebx, [esi + 1]
mov eax, ebp
lea ecx, [esp + 0x1e4]
call fcn.00503d00
mov ecx, edi
push eax
add ecx, 0x30
mov byte [esp + 0x1348], 2
call fcn.00403050
mov bl, 1
lea ecx, [esp + 0x1e4]
mov byte [esp + 0x1344], bl
call fcn.004020e0
mov eax, esi
mov edi, ebp
lea ecx, [esp + 0x1e4]
call fcn.00503c90
push eax
mov ecx, ebp
mov byte [esp + 0x1348], 3
call fcn.00403050
lea ecx, [esp + 0x1e4]
mov byte [esp + 0x1344], bl
call fcn.004020e0
mov edi, dword [esp + 0x14]
mov eax, dword [edi + 0xc]
push 0
push eax
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
jne 0x508baf
mov edi, dword [esp + 0x14]
mov dword [esp + 0x1c], 1
jmp 0x509689
lea ecx, [esp + 0x1ac]
call fcn.00402070
lea ecx, [esp + 0x1c8]
call fcn.00402070
lea ecx, [esp + 0x200]
call fcn.00402070
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x3c]
push edx
lea ebx, [esp + 0x208]
lea edi, [esp + 0x1d0]
lea esi, [esp + 0x1b4]
mov ecx, ebp
mov byte [esp + 0x134c], 6
call fcn.00508950
cmp byte [0x5ca583], 0
mov dword [esp + 0x2c8], 0xffffffff
jne 0x508c25
call fcn.0050d280
test al, al
je 0x508c25
mov byte [0x5ca583], 1
mov edi, dword [esp + 0x14]
mov byte [esp + 0x1344], 7
mov eax, dword [edi + 0xc]
mov esi, dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
push 0
push eax
call esi
test eax, eax
jne 0x508c7c
lea ecx, [esp + 0x200]
mov dword [esp + 0x1c], 1
call fcn.004020e0
lea ecx, [esp + 0x1c8]
call fcn.004020e0
lea ecx, [esp + 0x1ac]
mov byte [esp + 0x1344], 1
call fcn.004020e0
jmp 0x509689
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov ebx, eax
mov dword [esp + 0x34], ebx
cmp ebx, 0xffffffff
jne 0x508cd6
call sub.WS2_32.dll_WSAGetLastError
push eax
push str._connectAndSendData_:_socket_error__d.__r_n
call fcn.0053c054
add esp, 8
lea ecx, [esp + 0x200]
call fcn.004020e0
lea ecx, [esp + 0x1c8]
call fcn.004020e0
lea ecx, [esp + 0x1ac]
mov byte [esp + 0x1344], 1
call fcn.004020e0
jmp 0x509666
mov ecx, dword [edi + 0xc]
push 0
push ecx
call esi
test eax, eax
jne 0x508cec
mov dword [esp + 0x1c], 1
jmp 0x508ca5
mov ecx, ebp
lea esi, [esp + 0x264]
call fcn.00503950
lea ecx, [esp + 0x1ac]
lea esi, [esp + 0x238]
mov byte [esp + 0x1344], 8
call fcn.00503950
lea ecx, [edi + 0x30]
lea esi, [esp + 0x21c]
mov byte [esp + 0x1344], 9
call fcn.00503950
lea ecx, [esp + 0x238]
call fcn.00402050
push eax
call sub.WS2_32.dll_gethostbyname
mov esi, eax
test esi, esi
jne 0x508d80
call sub.WS2_32.dll_WSAGetLastError
push eax
push str._gethostbyname_:_socket_error__d.__r_n
call fcn.0053c054
add esp, 8
lea ecx, [esp + 0x21c]
call fcn.00402030
lea ecx, [esp + 0x238]
call fcn.00402030
lea ecx, [esp + 0x264]
call fcn.00402030
jmp 0x508ca5
mov edx, dword [edi + 0xc]
xor ebp, ebp
push ebp
push edx
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
jne 0x508d9b
mov dword [esp + 0x1c], 1
jmp 0x508d57
mov eax, 2
mov word [esp + 0x254], ax
mov ecx, dword [esi + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov esi, dword [esp + 0x38]
mov dword [esp + 0x258], eax
xor eax, eax
push esi
mov dword [esp + 0x260], eax
mov dword [esp + 0x264], eax
call sub.WS2_32.dll_htons
push 0x10
lea ecx, [esp + 0x258]
push ecx
push ebx
mov word [esp + 0x262], ax
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x508e16
call sub.WS2_32.dll_WSAGetLastError
movzx edx, si
push eax
push edx
lea ecx, [esp + 0x240]
call fcn.00402050
push eax
push str._connectAndSendData_:_connect__s:_d_error__d.__r_n
call fcn.0053c054
add esp, 0x10
jmp 0x508d57
mov eax, dword [edi + 0xc]
mov esi, dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
push ebp
push eax
call esi
test eax, eax
jne 0x508e34
mov dword [esp + 0x1c], 1
jmp 0x508d57
lea ecx, [esp + 0x190]
call fcn.00410380
lea ecx, [esp + 0x21c]
mov byte [esp + 0x1344], 0xb
call fcn.00402120
lea ecx, [esp + 0x190]
test al, al
je 0x508e66
push str.GET
jmp 0x508e6b
push 0x5a3cdc
call fcn.004481f0
lea ecx, [esp + 0x264]
push ecx
lea ecx, [esp + 0x194]
call fcn.004481d0
push str._HTTP_1.1_r_n
lea ecx, [esp + 0x194]
call fcn.004481f0
push str.Host:
lea ecx, [esp + 0x194]
call fcn.004481f0
lea edx, [esp + 0x238]
push edx
lea ecx, [esp + 0x194]
call fcn.004481d0
push 0x5a3cf8
lea ecx, [esp + 0x194]
call fcn.004481f0
push str.Accept:___r_n
lea ecx, [esp + 0x194]
call fcn.004481f0
push str.User_Agent:_Mozilla_5.0__Windows_NT_5.1__AppleWebKit_537.31__KHTML__like_Gecko__Chrome_26.0.1410.64_Safari_537.31_r_n
lea ecx, [esp + 0x194]
call fcn.004481f0
push str.Connection:_Keep_Alive_r_n
lea ecx, [esp + 0x194]
call fcn.004481f0
push 0x5a3da0
lea ecx, [esp + 0x194]
call fcn.004481f0
lea ecx, [esp + 0x21c]
call fcn.00402120
test al, al
jne 0x508f55
lea ecx, [esp + 0x21c]
call fcn.0042bf40
push eax
lea eax, [esp + 0x2d0]
push str.Content_Length:__d_r_n
push eax
call fcn.0053b335
add esp, 0xc
lea ecx, [esp + 0x2cc]
push ecx
lea ecx, [esp + 0x194]
call fcn.004481f0
push 0x5a3cf8
lea ecx, [esp + 0x194]
call fcn.004481f0
lea edx, [esp + 0x21c]
push edx
lea ecx, [esp + 0x194]
call fcn.004481d0
push ebp
lea ecx, [esp + 0x194]
call fcn.0042bf40
push eax
lea ecx, [esp + 0x198]
call fcn.00402050
push eax
push ebx
call sub.WS2_32.dll_send
cmp eax, 0xffffffff
jne 0x508fc4
call sub.WS2_32.dll_WSAGetLastError
push eax
push str._connectAndSendData_:_send_error__d.__r_n
call fcn.0053c054
add esp, 8
lea ecx, [esp + 0x190]
call fcn.00402030
jmp 0x508d57
mov eax, dword [edi + 0xc]
push ebp
push eax
call esi
test eax, eax
jne 0x508fe8
lea ecx, [esp + 0x190]
mov dword [esp + 0x1c], 1
call fcn.00402030
jmp 0x508d57
lea ecx, [esp + 0x280]
call fcn.00410380
lea ecx, [edi + 0x64]
mov byte [esp + 0x1344], 0xc
call fcn.00448e70
lea ecx, [edi + 0x54]
call fcn.00448e70
push 0xfff
lea ecx, [esp + 0x339]
push ebp
push ecx
mov byte [esp + 0x340], 0
call fcn.0053f680
add esp, 0xc
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x24], ebp
lea ebx, [ebx]
mov ebx, dword [esp + 0x34]
lea edx, [esp + 0x44]
push edx
push 0
push 0
lea eax, [esp + 0x78]
push eax
lea eax, [ebx + 1]
mov edi, 1
push eax
mov dword [esp + 0x58], 0xa
mov dword [esp + 0x5c], 0x3e8
mov dword [esp + 0x84], ebx
mov dword [esp + 0x80], edi
call sub.WS2_32.dll_select
test eax, eax
jle 0x5095fa
mov ebp, dword [esp + 0x14]
mov ecx, dword [ebp + 0xc]
mov esi, dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
push 0
push ecx
call esi
test eax, eax
je 0x509716
lea edx, [esp + 0x6c]
push edx
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5095fa
mov eax, dword [ebp + 0xc]
push 0
push eax
call esi
test eax, eax
je 0x509716
push 0x1000
lea ecx, [esp + 0x338]
push 0
push ecx
call fcn.0053f680
add esp, 0xc
push 0
push 0x1000
lea edx, [esp + 0x33c]
push edx
push ebx
call sub.WS2_32.dll_recv
mov edi, eax
test edi, edi
jle 0x5095fa
mov eax, dword [ebp + 0xc]
push 0
push eax
call esi
test eax, eax
je 0x50971f
mov ecx, dword [esp + 0x28]
lea esi, [edi + ecx]
lea ebx, [ebp + 0x64]
push esi
mov ecx, ebx
call fcn.004488b0
push edi
lea edx, [esp + 0x338]
push edx
mov ecx, ebx
call fcn.004478e0
add eax, dword [esp + 0x30]
push eax
call fcn.00543950
mov ecx, dword [ebp + 0x10]
add esp, 0xc
mov dword [esp + 0x28], esi
test ecx, ecx
je 0x509155
fldz
mov eax, dword [ecx]
mov edx, dword [eax + 4]
sub esp, 8
fstp qword [esp]
push 0
push ebp
call edx
mov esi, ebp
lea ecx, [esi + 0x64]
call fcn.004478e0
mov ebp, eax
mov eax, dword [esp + 0x28]
lea edi, [eax + ebp]
push str._r_n_r_n
push ebp
mov dword [esp + 0x28], edi
call fcn.0053c570
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x509591
cmp ebx, edi
jae 0x509591
add ebx, 4
cmp dword [esi + 0x7c], 0xffffffff
mov dword [esp + 0x24], ebx
jne 0x509230
push str.HTTP_1.1
push ebp
call fcn.0053c570
mov esi, eax
add esp, 8
test esi, esi
je 0x509230
cmp esi, edi
jae 0x509230
add esi, 9
push 0x5a3bd0
push esi
call fcn.0053c570
add esp, 8
test eax, eax
je 0x509230
cmp eax, edi
jae 0x509230
push ecx
sub eax, esi
mov ecx, esp
mov edi, eax
call fcn.004ed290
lea ecx, [esp + 0x178]
call fcn.00402330
push 0
push 0
lea ecx, [esp + 0x17c]
call fcn.00402280
push edi
push esi
lea ecx, [esp + 0x17c]
call fcn.00402420
lea ecx, [esp + 0x174]
call fcn.00402050
push eax
call fcn.0053a4f2
mov ecx, dword [esp + 0x18]
mov dword [ecx + 0x7c], eax
add esp, 4
lea ecx, [esp + 0x174]
call fcn.00402030
mov edi, dword [esp + 0x20]
mov edx, dword [esp + 0x14]
mov eax, dword [edx + 0x7c]
cmp eax, 0x12e
je 0x509249
cmp eax, 0x12d
jne 0x509300
lea ecx, [esp + 0x280]
call fcn.00402120
test al, al
je 0x509300
push str.Location:
push ebp
call fcn.0053c570
mov esi, eax
add esp, 8
test esi, esi
je 0x509300
cmp esi, edi
jae 0x509300
add esi, 0xa
push 0x5a3cf8
push esi
call fcn.0053c570
add esp, 8
test eax, eax
je 0x509300
cmp eax, edi
jae 0x509300
push ecx
sub eax, esi
mov ecx, esp
mov edi, eax
call fcn.004ed290
lea ecx, [esp + 0x178]
call fcn.00402330
push 0
push 0
lea ecx, [esp + 0x17c]
call fcn.00402280
push edi
push esi
lea ecx, [esp + 0x17c]
call fcn.00402420
lea eax, [esp + 0x174]
push eax
lea ecx, [esp + 0x284]
mov byte [esp + 0x1348], 0xd
call fcn.00445680
lea ecx, [esp + 0x174]
mov byte [esp + 0x1344], 0xc
call fcn.00402030
mov edi, dword [esp + 0x20]
lea ecx, [esp + 0x280]
call fcn.00402120
test al, al
je 0x50972c
mov ecx, dword [esp + 0x18]
cmp ecx, 0xffffffff
jne 0x509595
push str.Content_Length:
push ebp
call fcn.0053c570
mov esi, eax
add esp, 8
test esi, esi
je 0x5093ad
cmp esi, edi
jae 0x5093ad
add esi, 0x10
push 0x5a3cf8
push esi
call fcn.0053c570
add esp, 8
test eax, eax
je 0x5093ad
cmp eax, edi
jae 0x5093ad
push ecx
sub eax, esi
mov ecx, esp
mov edi, eax
call fcn.004ed290
lea ecx, [esp + 0x178]
call fcn.00402330
push 0
push 0
lea ecx, [esp + 0x17c]
call fcn.00402280
push edi
push esi
lea ecx, [esp + 0x17c]
call fcn.00402420
lea ecx, [esp + 0x174]
call fcn.00402050
push eax
call fcn.0053a4f2
add esp, 4
lea ecx, [esp + 0x174]
mov dword [esp + 0x18], eax
call fcn.00402030
mov ecx, dword [esp + 0x18]
cmp ecx, 0xffffffff
jne 0x509595
push 0x5a3cf8
push ebx
call fcn.0053c570
mov edi, eax
add esp, 8
test edi, edi
je 0x509446
cmp edi, dword [esp + 0x20]
jae 0x509446
push ecx
mov esi, edi
mov ecx, esp
sub esi, ebx
call fcn.004ed290
lea ecx, [esp + 0x178]
call fcn.00402330
push 0
push 0
lea ecx, [esp + 0x17c]
call fcn.00402280
push esi
push ebx
lea ecx, [esp + 0x17c]
call fcn.00402420
lea ecx, [esp + 0x18]
push ecx
push 0x5a3e48
lea ecx, [esp + 0x17c]
call fcn.00402050
push eax
call fcn.0053c27a
add esp, 0xc
cmp eax, 1
jne 0x50943a
add dword [esp + 0x18], 7
add edi, 2
mov dword [esp + 0x24], edi
lea ecx, [esp + 0x174]
call fcn.00402030
mov ecx, dword [esp + 0x18]
cmp ecx, 0xffffffff
jne 0x509595
push str.Connection:
push ebp
call fcn.0053c570
mov esi, eax
add esp, 8
test esi, esi
je 0x509591
cmp esi, dword [esp + 0x20]
jae 0x509591
add esi, 0xc
push 0x5a3cf8
push esi
call fcn.0053c570
add esp, 8
test eax, eax
je 0x509591
cmp eax, dword [esp + 0x20]
jae 0x509591
push ecx
sub eax, esi
mov ecx, esp
mov edi, eax
call fcn.004ed290
lea ecx, [esp + 0x178]
call fcn.00402330
push 0
push 0
lea ecx, [esp + 0x17c]
call fcn.00402280
push edi
push esi
lea ecx, [esp + 0x17c]
call fcn.00402420
lea ecx, [esp + 0x174]
mov byte [esp + 0x1344], 0xf
call fcn.00402050
mov ecx, eax
lea eax, [esp + 0x1e4]
call fcn.005038f0
push str.CLOSE
lea ecx, [esp + 0x54]
mov byte [esp + 0x1348], 0x10
call fcn.004020a0
lea ecx, [esp + 0x50]
call fcn.0042bf40
mov esi, eax
lea ecx, [esp + 0x1e4]
mov dword [esp + 0x3c], esi
call fcn.0042bf40
mov dword [esp + 0x40], eax
cmp eax, esi
lea eax, [esp + 0x3c]
jb 0x509531
lea eax, [esp + 0x40]
mov edx, dword [eax]
push edx
lea ecx, [esp + 0x54]
call fcn.00402100
lea ecx, [esp + 0x1e8]
mov esi, eax
call fcn.00402100
mov ecx, eax
mov eax, esi
call fcn.00503bd0
add esp, 4
test eax, eax
lea ecx, [esp + 0x50]
sete bl
call fcn.004020e0
test bl, bl
je 0x509571
mov dword [esp + 0x18], 0
lea ecx, [esp + 0x1e4]
call fcn.004020e0
lea ecx, [esp + 0x174]
mov byte [esp + 0x1344], 0xc
call fcn.00402030
mov ecx, dword [esp + 0x18]
cmp dword [esp + 0x24], 0
je 0x509040
test ecx, ecx
jle 0x509040
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
mov eax, edi
sub eax, ebp
sub edx, ebp
add eax, ecx
cmp edx, eax
jl 0x509040
mov eax, dword [esp + 0x14]
cmp dword [eax + 0x7c], 0xc8
jne 0x5095d5
mov dword [esp + 0x2c], 1
lea esi, [eax + 0x54]
push ecx
mov ecx, esi
call fcn.004488b0
mov ecx, dword [esp + 0x18]
push ecx
push edi
mov ecx, esi
call fcn.004478e0
push eax
call fcn.00543950
add esp, 0xc
mov ebx, dword [esp + 0x34]
lea ecx, [esp + 0x280]
call fcn.00402030
lea ecx, [esp + 0x190]
call fcn.00402030
lea ecx, [esp + 0x21c]
call fcn.00402030
lea ecx, [esp + 0x238]
call fcn.00402030
lea ecx, [esp + 0x264]
call fcn.00402030
lea ecx, [esp + 0x200]
call fcn.004020e0
lea ecx, [esp + 0x1c8]
call fcn.004020e0
lea ecx, [esp + 0x1ac]
mov byte [esp + 0x1344], 1
call fcn.004020e0
mov edi, dword [esp + 0x14]
cmp ebx, 0xffffffff
je 0x509689
push ebx
call sub.WS2_32.dll_closesocket
cmp eax, 0xffffffff
jne 0x509689
call sub.WS2_32.dll_WSAGetLastError
push eax
push str._connectAndSendData_:_closesocket_error__d.__r_n
call fcn.0053c054
add esp, 8
mov ecx, dword [edi + 0x10]
xor ebx, ebx
cmp ecx, ebx
je 0x509788
cmp dword [esp + 0x1c], ebx
jne 0x509788
cmp dword [esp + 0x30], ebx
jne 0x508ac0
mov esi, dword [esp + 0x14]
cmp dword [esp + 0x2c], ebx
mov edx, dword [ecx]
mov edx, dword [edx]
lea eax, [esi + 0xc]
push eax
sete al
movzx eax, al
push eax
push esi
lea eax, [esp + 0x1f0]
push eax
call edx
push eax
lea ecx, [esp + 0x2a0]
mov byte [esp + 0x1348], 0x11
call fcn.00403050
lea ecx, [esp + 0x1e4]
mov byte [esp + 0x1344], 1
call fcn.004020e0
lea ecx, [esp + 0x29c]
call fcn.00402120
test al, al
jne 0x509792
lea ecx, [esi + 0x30]
call fcn.00459610
jmp 0x508ac0
mov dword [esp + 0x1c], edi
jmp 0x5095fa
mov dword [esp + 0x1c], 1
jmp 0x5095fa
lea ecx, [esp + 0x280]
call fcn.00402050
mov ecx, eax
lea eax, [esp + 0x1e4]
call fcn.005038f0
push eax
lea ecx, [esp + 0x2a0]
mov byte [esp + 0x1348], 0xe
call fcn.00403050
lea ecx, [esp + 0x1e4]
mov byte [esp + 0x1344], 0xc
call fcn.004020e0
mov ecx, dword [esp + 0x14]
add ecx, 0x30
call fcn.00459610
mov dword [esp + 0x30], 1
jmp 0x5095f6
cmp dword [esp + 0x30], ebx
jne 0x508ac0
lea ecx, [esp + 0x29c]
call fcn.004020e0
lea ecx, [esp + 0x1354]
call fcn.004020e0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x133c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1320]
xor ecx, esp
call fcn.00538a54
add esp, 0x1334
ret 0x24