Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ARP Sending in C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Sep 07, 2010 2:25 pm    Post subject: ARP Sending in C++ Reply with quote

I was wondering how would i send an arp request that i have built in c++?
so far i got here:
Code:

typedef struct arp {
        unsigned short   htype;
        unsigned short   ptype;
        unsigned char   hlen;
        unsigned char   plen;
        unsigned short   operation;
      unsigned int   source_mac;
      unsigned short   source_mac_con;
      unsigned int   source_ip;
      unsigned short   dest_mac;
      unsigned int   dest_mac_con;
      unsigned int   dest_ip;

} *ARP;

void SendARPRequest( void ) {
   ARP      arp_packet;

   arp_packet               = (ARP) malloc( sizeof arp );
   arp_packet->htype         = 1;
   arp_packet->ptype         = 0x0800;
   arp_packet->hlen         = 48;
   arp_packet->plen         = 32;
   arp_packet->operation      = 1;
   arp_packet->source_mac      = 0x000129d5;
   arp_packet->source_mac_con   = 0x98ef;
   arp_packet->source_ip      = 0x0a000001;
   arp_packet->dest_mac      = 0x00000000;
   arp_packet->dest_mac_con   = 0x0000;
   arp_packet->dest_ip         = 0x0a000007;
}

I created the arp structure as far as i guess it is.
but now where do i go?
how do i turn it into my network card to move on to the network?
i'm guessing there is no use in sockets in that level of frames / packets

any help would be great

_________________
Stylo
Back to top
View user's profile Send private message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Tue Sep 07, 2010 4:52 pm    Post subject: Reply with quote

Why are you using C-style code in C++ code?

Anyways, I think you can do this with raw sockets, but you should know that sending raw sockets on Windows is disabled.
You could write a driver or use one, I belive that the library WinPCap should help you.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Tue Sep 07, 2010 10:57 pm    Post subject: Reply with quote

Yea, I know winpcap and wondered if i could just write one in myself,
but i don't really know how to accomplish that.
by saying driver do you mean kmd?

_________________
Stylo
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Wed Sep 08, 2010 3:36 am    Post subject: Reply with quote

Yeah, kernel-level.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Sep 08, 2010 2:32 pm    Post subject: Reply with quote

Windows sockets do not allow ARP packets from usermode. So yes you need a kernelmode driver. The easiest would be to use WinPCap, though I'm not sure if it can send packets instead of only 'sniffing'.
It's probably quite difficult to make such a driver yourself if you've never made a driver before.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Wed Sep 08, 2010 4:08 pm    Post subject: Reply with quote

tombana wrote:
Windows sockets do not allow ARP packets from usermode. So yes you need a kernelmode driver. The easiest would be to use WinPCap, though I'm not sure if it can send packets instead of only 'sniffing'.
It's probably quite difficult to make such a driver yourself if you've never made a driver before.

Yea, that's pretty much what i want to get into right now.
I'd like to step into the KMD subject not only for that goal, but for knowing it properly.
got any good tutorials for beginners?

_________________
Stylo
Back to top
View user's profile Send private message
deffi
How do I cheat?
Reputation: 0

Joined: 17 Nov 2010
Posts: 2

PostPosted: Wed Nov 17, 2010 4:14 pm    Post subject: Reply with quote

How about using SendARP winapi?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites