setekh Cheater
Reputation: 0
Joined: 16 Feb 2006 Posts: 43
|
Posted: Sat May 12, 2007 1:51 pm Post subject: PacketFilter ?? PacketSniffer/Editor in CE |
|
|
Are you going to implement a sniffer/editor in CE ? I just saw the empty dir. in the project and i was wondering ... Someone in the forum was writing about it, so i was messing with it , using only winsock2, probably will try with WinPCap as well.. For now i can sniff the traffic , edit and resend TCP packets , TCP - cuz i can check if something is coming back or not, like when i send request to a web page and stuff .. But it's just a test you know.. But it seems that for a serious packet editor you must use PCap, I just create a socket :
SockA := Socket(AF_INET, SOCK_STREAM, strtoint(edit3.text));
if SockA = INVALID_SOCKET then
Exit;
SockAddr.sin_family := AF_INET;
SockAddr.sin_port := htons(80);
SockAddr.sin_addr.s_addr := inet_addr(PChar( edit2.text ));
and send the edited stuff :
if Send(SockA, Buffer[1], Length(Buffer), 0) = SOCKET_ERROR then
Exit;
I get the packets in RAW and IP and i just leave only the data part cutting out the first 20 bytes that are the header for the IP protocol, well i get the protocol type,and stuff from the IP header so i can put them back in the one that i send and to check if it's TCP/UDP so i can get the src/dest port numbers , but i'm not very sure that it would work this way for a game, i have not tried it yet .. I actually just started to work on it for about an hour or so .... And i was wondering if it could happen just using RAW sockets and winsock or for a actual packet editor WinPCap is a must ?
And also waht if the game is using it's own protocol - then it will suck
So it's not an very easy one after all at lwat not as easy as i thought it would be ...
btw - Does anyone have a nice WinPCap header for Delphi with all functions exported ? I found one but it's very incomplete and i really dont want to make an api conversion for Delphi i'm very lazy MF ...
|
|