C# :: Sending X-AMF Type Packets
Jan 10, 2015
create BOT that adds friends on one of Chat websites.
Im using C#
On website there is a button that adds user to friends
<li class="friend"><a href="javascript:void(0)">Add Friend</a></li>
I captured packet that is sended to server then that button is clicked
POST (info hided)/amfgateway.php HTTP/1.1Host: (info hided)
Connection: keep-alive
Content-Length: 52
[Code].....
It apears that this is AMF(Action Message Format) type packet Content-Type: application/x-amf it is in binary and this complicates things a little because I cannot send it with regular httpwebreqeuest class(Or I think so)
I used Fiddler4 with AMF plugin to check what data was passed with that packet
It apears that these numbers under content / 0 are User-id that is needed to add user to friends
I did a research with little success finding any usefull examples. I just found that there is a library for FLEX/FLASH remoting called fluorinefx and this should do the job but when I opened documentation it seems little too complex for me.
View 2 Replies
ADVERTISEMENT
Feb 26, 2013
I need to send a packet of type byte:
0x00, 0x01, 0x02, 0x11, 0x00, 0x00
to a device via the serial port and then I receive and store data coming from device like this:
0x01, 0x01, 0x01 , 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x01, 0x00.
Writing lines of code through which:
1) I create the array
2) the sending the array to serial port
3) I'll see what I'm sending
4) I get the data
I'm using Visual Studio 2010 and C + + or VC++ language.
View 14 Replies
View Related
Jun 2, 2013
I'm trying to get a UDP server working and just can't seem to get it to read in any UDP packets. I can see the packet coming in on the correct interface and port from tcpdump, but my program never logs that it got the data.
I just keep getting a log showing that my recvfrom timed out. I'm pretty sure I'm setting everything up correctly.
Code:
int create_listen_socket() {
struct sockaddr_in si_me;
int sock_fd;
struct ifaddrs * ifAddrStruct=NULL;
struct ifaddrs * ifa=NULL;
void * tmpAddrPtr=NULL;
struct timeval tv;
[Code] ....
View 1 Replies
View Related
Nov 24, 2014
I have to write a program to take packets of information destined for certain ports then provide the current message using the packets I've gotten so far. Packets can come out of order, so when asked for the message, packets that haven't arrived yet are skipped and the next packet is appended. After giving the message, I have to delete all the current packets as well as ones that are received late, after the packets that were supposed come after the late packet were already provided in the message.
Data:Up to 1000 ports, numbered 0-64000, and each message can contain up to 1000 packets.
View 2 Replies
View Related
Jul 18, 2014
I am receiving packets of data from an ethernet cable. This is the line of code that is streaming in data from the ethernet cable:
size_t num_rx_samps = rx_stream->recv(&buff.front(), buff.size(), md, 3.0, enable_size_map);[code]
Here are the segments of me trying to push the packets onto a vector:
[code]
std::vector<size_t> processing_queue; //HERE IS WHERE I'M TRYING TO PUSH THE PACKETS ONTO A VECTOR
processing_queue.push_back(num_rx_samps);
[code]
I previously had my program saving to a .dat file (the commented out lines), but I need to change it to pushing values onto a vector so I can stream the data packets from the ethernet cable to be processed. However, the packets aren't being pushed onto the stack as I suspected. What do I need to change to push the data packets onto a vector? The following is the code:
[code]
#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/exception.hpp>
#include <boost/program_options.hpp>
[code]....
View 1 Replies
View Related
Jul 22, 2012
I have a simple UDP client that should be able to send and receive packets. It does its job, however if there are no packets received for a while it stops listening for any new packets and I'm not sure what's causing it.
This is my code:
#define WIN32_LEAN_AND_MEAN
#include "Client.h"
#include <winsock2.h>
#include <ws2tcpip.h>
#include <vector>
#include <sstream>
#pragma comment(lib, "Ws2_32.lib")
[Code] ....
View 1 Replies
View Related
Feb 5, 2015
I have a requirement to sniff the wifi packets. There are examples available which does the sniffing using pcap functionality. I need a C program which will sniff the wifi packets without using pcap functionality..
Code:
#include<pcap.h>
#include<stdio.h>
#include<stdlib.h> // for exit()
[Code].....
View 13 Replies
View Related
Jan 30, 2015
There is something I didn't understand. I use the sample given from the cpp reference to generate numbers:
const int nrolls = 10; // number of experiments
std::default_random_engine generator;
std::poisson_distribution<int> distribution(4.1);
for (int i=0; i<nrolls; ++i){
int number = distribution(generator);
cout<<number<<" "<<endl;
}
(original code: [URL] ... )
This outputs: 2 3 1 4 3 4 4 3 2 3 and so on... First of all what those numbers mean? I mean do I have to sum them to create timing? For example: 2, (2+3)=5, (5+1)=6, (6+4)=10,..., and so on..
Secondly, my real question is, I need to produce both random arrivals for network packets and the size of packets. I mean, when the packets come and if packets come, what are the size of packets? How can I do that? I need something like that: [URL] ...
View 1 Replies
View Related
Jul 17, 2014
I am receiving packets of data from an ethernet cable. This is the line of code that is streaming in data from the ethernet cable:
size_t num_rx_samps = rx_stream->recv(&buff.front(), buff.size(), md, 3.0, enable_size_map);
and here is my attempt to push it onto a vector:
std::vector<size_t> processing_queue; //HERE IS WHERE I'M TRYING TO PUSH THE PACKETS ONTO A VECTOR
processing_queue.push_back(num_rx_samps);
I previously had my program saving to a .dat file (the commented out lines), but I'm trying to change it to pushing values onto a vector so I can stream the data packets from the ethernet cable to be processed. However, I'm having issues with pushing the data packets onto the vector?
The following is the code:
#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
[Code].....
View 1 Replies
View Related
May 28, 2013
I wrote this simplified version of a program i am writing that parses data in UDP packets. In the process of doing so i pretty much answered all my questions and fix all the problems i was having.
decodeSystemMap function will be in loop, and will proccess packets that have mostly the same data, only a few items will be added or changed or deleted.
whats the best way to check if there are any new, deleted, or removed items in the packet and only modify those?
Is there anything unsafe / dangrous about the way the code is now?
Code:
/* * File: main.c
* Author: david
*
* Created on May 23, 2013, 11:57 AM
*/
#include <stdio.h>
#include <stdlib.h>
[Code] ....
View 4 Replies
View Related
Sep 16, 2014
why this code works only for file of smaller data. When I try to send for istance a image, the image arrive corrupted.
Client:
//read all file
byte[] vett = File.ReadAllBytes(s);
//read filename
[Code]....
View 11 Replies
View Related
Nov 21, 2013
What's the problem with the following:
Code:
#define K 3;
int max(int a, int b) {
return a>b? a : b;
} int main() {
cout<<max(K, K+3);
return 0;
}
Why is it not allowed, and how is it different from:
Code:
int max(int a, int b) {
return a>b? a : b;
} int main() {
cout<<max(3, 3+3);
return 0;
}
View 3 Replies
View Related
Oct 30, 2013
I have a socket connection already set up, my thing is what would be the best way to send a packet through sockets? My teacher wants us to convert the packet to bits first before we send it. I think he wants something like this:
Code:
struct packet{
int header
int message
int flag
}clientpacket; m
My question is how do we covert this to bits, before sending it. One of my friends said we can create a char[] array the size of the struct as a buffer. will memcpy() change the struct to bits if I copy it to the buffer?
this is how is suppose to look in bits for the header field/column.
Field : header
Field size(bits): 8
data format: Unsigned int
value example: 1
Value in bits: 0000 0001
I am confused, I think I send a structure over the socket but I did not convert it to bits before I sent it .
View 13 Replies
View Related
May 18, 2014
I want to apply program to send matrix from client and server ,and return back a processed matrix ..
How I can do it using UDP ,it was easy to use tcp for that!?
View 3 Replies
View Related
Dec 18, 2014
Verify my Method . I am not getting expected output ..
Code:
int Amount=500;
send(newSocket,Amount,4,0);
close(welcomeSocket);
recv(clientSocket,Amount,4,0);
// Amount= ntohl(Amount);
printf("Data received: %d",atoi(Amount[0]));
View 5 Replies
View Related
Nov 1, 2013
I want to write a program(s) so that the client sits and waits for a scanf to receive an int, then send to server, server then receives the int, processes it, then goes back to sit and wait for new input. to start with, where do i start! server side, or client side? and also what order do i have to go in my program before the loop to set up the socket, and listen? and then what gets looped to keep the connection open and wait for new receive?
View 4 Replies
View Related
Jul 21, 2013
I have a project, to make a program that spams chat programs. I've been trying to figure out how to send a string to an open program such as notepad, or a chat window. I know how to simulate keystrokes but I have yet to figure out or find out any way of sending a string to a program. pseudo code:
int main() {
string a;
int howManyTimes;
cin >> a;
cin >> howManyTimes;
//user enters "pizza"
for(int i = 0; i < howManyTimes; i++) {
//now I want "pizza" to be sent to the program keystroke enter or whatever the correct syntax is sleep
} }
View 1 Replies
View Related
Mar 1, 2013
I am writing some code to send text to a third part software. Basically each sending looks like this:
p << "set terminal eps
";
p << "set output '07.eps'
";
p << "plot '-' using ($1 == 0 ? NaN : $1) with lines linecolor 2 title 'comparison ratio',
'-' using ($1 == 0 ? NaN : $1) with lines title 'comparison ratio'
";
p.send(TOex_ar).send(TOnew_ar);
p << "set terminal wxt 7
";
p << "plot '-' using ($1 == 0 ? NaN : $1) with lines linecolor 2 title 'comparison ratio',
'-' using ($1 == 0 ? NaN : $1) with lines title 'comparison ratio'
";
p.send(TOex_ar).send(TOnew_ar);
Each time I have to change the number "07" and "7";decide to add or not the following parts: "using ($1 == 0 ? NaN : $1)", "with lines", "linecolor 2";and write the title 'comparison ratio' and the name of data to send "TOex_ar" and "TOnew_ar".Since I have to do this kind of thing 50 times in my code, and it is in the form of text, I am wondering whether in C++ we can write a template or function to simplify the program, just to input the changing parts.
View 3 Replies
View Related
Apr 20, 2014
I wanted to make an program which is sending messages to log in and password, but instead of message it gives me "System.Windows.Forms.TextBox, Text: AND HERE MY TEXT I WANTED.
View 9 Replies
View Related
Jul 23, 2014
If I have a text file named, stuff at a specified path in the c : drive, how do I send the contents of this file to another computer using the Internet?
View 5 Replies
View Related
Nov 4, 2013
I am trying to get all these functions work together and send the value of countX and countY back into main from function2() and function3() to be used by function4() later on.. But I keep getting 0 printed out and I am not quite sure why.
Code:
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define maxrow 20 //defines maxrow as a constant of 20
#define maxcol 30 //defines maxcol as a constant of 30
}
[code]....
View 2 Replies
View Related
May 11, 2013
I want to send data from a file via winsock. The problem is that the only first line in the file is send.
Client
#include <iostream>
#include <winsock2.h>
#include <fstream>
#include <string>
#pragma comment(lib,"ws2_32.lib")
#define SERVER "127.0.0.1" //ip address of udp server
[Code] ....
View 2 Replies
View Related
Dec 17, 2013
I am trying to convert decimal value 1 to 32 to hex value and insert it at 4th pos of char array and send it as hex value at the serial port .
My issue is it is converting to decimal to hex value but when it sends, it treat the converted hex value as char and sends it equivalent hex value.
For example
if decimal =1 then its hex = 1.
so , writebuffer[3] =1
But when we send whole writebuffer through send function, it treat this 1 as char and sends its hex value as 31. how to send its hex value.
unsigned int i=0;
char hex[3];
unsigned char hexunsigned[3];
unsigned int dec;
do {
unsigned char writebuffer[8] ={0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
[Code] ....
The send function is
void serial::send(unsigned char data[], DWORD noOfByte) {
DWORD dwBytesWrite;
WriteFile(serialHandle, data, noOfByte, &dwBytesWrite, NULL);
}
View 2 Replies
View Related
Feb 3, 2014
I've got something I'm trying to accomplish, but crashes my program.
I've got my server and client code.
Having the client send a message they type (char Chat[1024]) And the server receiving the chat (char recv_chat[1024]) only to send it to all connected clients again. Which the server sends the recv_chat.
The client receives it (char recv_chat[1024]). This works, and the client gets the right info. However, I'm trying to store it using a vector. I'm sure I've tried any way possible.
Client storing vector pseudo-code:
vector<char*> SaveChat;
int main () {
while (true) {
if (newClientConnected) {
[Code]....
This doesn't work, and crashes my application. I've tried changing the vector to string, const char*, basically anything I can with no avail.
View 8 Replies
View Related
Mar 21, 2015
I'm building a project in my free time and in the last part of it I need to fill a form of a website and then 'hit submit', but how it can be done. Btw the form is a 'POST' form so it's harder than a 'GET' one.
View 2 Replies
View Related
Apr 21, 2014
How to send a keystroke or a mouse event to another running process in Ubuntu? I want to write a C program that reads data from the USB port sent by AVR Micro Controller board continuously.In response to that it checks the data received and sends a command to another process running on the computer? Example,when the program reads 101 from the USB port it sends left mouse button down to the VLC media player window that is currently running?
View 1 Replies
View Related