View Full Version : minimum GPS functionality
whinge
02-01-2003, 08:03 AM
It's ugly, but... I hate looking over eqatlas maps!
Change the port (10000) and the IP (1.1.1.1) to match your previous keygrabber
My coding stinks at this time of night. It should check for the sig on the udp before deciding whether it is a old or new sniffer packet. Code style and variable types aren't standard. Not clean shutdown code in the console app. Ya get what ya pay for...
Anyone know why I chose ed b0 for the header, tell me and I might send you a jellybean.
Whinge
Builder Console app to watch the log file and spit out /loc's to seq
-----------------------------
//---------------------------------------------------------------------------
#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>
#include <stdlib.h>
#include <math.h>
//---------------------------------------------------------------------------
#define SNIFF_PACKET_H1 0xed
#define SNIFF_PACKET_H2 0xb0
#define SNIFF_PACKET_XYZxyzHh 1 // X,X,Y,Y,Z,Z,x,x,y,y,z,z,H,h
// class for sending UDP packets
class TSEQUDP
{
SOCKET Socket;
SOCKADDR_IN Addr;
public:
TSEQUDP();
~TSEQUDP();
bool Connect();
void Send(char* cpBuffer,int iBufLen);
};
// class for processing log lines
class TProcessLine
{ TSEQUDP* pSeqUdp;
double dLastX,dLastY,dLastZ;
double dHeading;
public:
void ProcessLine(char* cpLine);
void ProcessLocation(char* cpLocation);
TProcessLine(TSEQUDP* SeqUdp);
};
#pragma argsused
int main(int argc, char* argv[])
{
TSEQUDP SeqUdp;
if(! SeqUdp.Connect())
{
printf("Can't fire up winsock\r\n");
exit(1);
}
TProcessLine Process(&SeqUdp);
// parameter check
if(argc != 2)
{
printf("Usage: Sniff <log_filename>\r\n");
exit(1);
}
// load the log file (eqlog_zozo_30.txt)
int fh = open(argv[1], O_RDONLY | O_BINARY, S_IREAD|S_IWRITE);
if(fh == -1)
{
printf("Can't read %s\r\n",argv[1]);
exit(1);
}
// track the end of the file
int iLastFileLength = filelength(fh);
while(1)
{
printf("."); // ugly heartbeat to enable ctrl-c
int iNewFileLength = filelength(fh);
if(iNewFileLength > iLastFileLength) // changed?
{
int iDif = iNewFileLength - iLastFileLength;
char* cpBuffer = new char[iDif+5];
if(lseek(fh,iLastFileLength,SEEK_SET) != iLastFileLength)
{
printf("Seek error\r\n");
exit(1);
}
if(read(fh, cpBuffer, iDif) != iDif)
{
printf("Read error\r\n");
exit(1);
}
cpBuffer[iDif]=0;
char* cpHead = cpBuffer;
char* cpTail = cpBuffer;
char* cpEnd = cpBuffer + iDif;
while(cpHead < cpEnd)
{
if(*cpHead == 13 || *cpHead == 10)
{
int iLen = cpHead-cpTail;
if(cpHead[1] == cpHead[0] ^ 7) cpHead++; // crlf, lfcr
cpHead++;
cpTail[iLen]=0;
Process.ProcessLine(cpTail);
cpTail = cpHead;
}
else
cpHead++;
}
iLastFileLength = iNewFileLength;
} // if(iNewFileLength > iLastFileLength) // changed?
Sleep(500); // snooze a little
}
// finish off
close(fh); // prolly won't get here...
return 0;
}
//---------------------------------------------------------------------------
TSEQUDP::TSEQUDP()
{
Socket = INVALID_SOCKET;
}
TSEQUDP::~TSEQUDP()
{
if(Socket != INVALID_SOCKET)
{
shutdown(Socket,2);
Socket = INVALID_SOCKET;
}
WSACleanup();
}
bool TSEQUDP::Connect()
{
WSAData InitData;
int iStatus;
iStatus = WSAStartup(0x101,&InitData);
if(iStatus)
{
printf("Can't fire up winsock\r\n");
return false;
}
Socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(Socket == INVALID_SOCKET)
{
printf("can't open socket\r\n");
return false;
}
Addr.sin_family = PF_INET;
Addr.sin_port = htons(10000); // change me
Addr.sin_addr.s_addr = inet_addr("1.1.1.1"); // change me
return true;
}
void TSEQUDP::Send(char* cpBuffer,int iBufLen)
{
sendto(Socket,cpBuffer,iBufLen,0,(sockaddr*) &Addr,sizeof(Addr));
}
//---------------------------------------------------------------------------
TProcessLine::TProcessLine(TSEQUDP* SeqUdp)
{
pSeqUdp = SeqUdp;
dLastX=dLastY=dLastZ=0;
}
void TProcessLine::ProcessLine(char* cpLine)
{
printf("%s\r\n",cpLine);
// skip the time
while((*cpLine != ']') && *cpLine) cpLine++;
if(! *cpLine) return;
cpLine++;
// skip white space
while(isspace(*cpLine) && *cpLine) cpLine++;
if(! *cpLine) return;
// we now have a log line, see what we gots
// "Your Location is -368.05, 1334.55, -124.94"
if(!strncmp(cpLine,"Your Location is ",17))
ProcessLocation(cpLine+17);
}
// "-368.05, 1334.55, -124.94"
void TProcessLine::ProcessLocation(char* cpLocation)
{
double dX,dY,dZ;
sscanf(cpLocation,"%lf,%lf,%lf",&dY,&dX,&dZ);
printf("Location %d,%d,%d\r\n",(int)dY,(int)dX,(int)dZ);
// find heading
if(dLastX != dX && dLastY != dY)
dHeading = atan2(dLastX-dX,dLastY-dY) * 180 / M_PI;
// convert and send
int iX,iY,iZ,iH;
iX=(int)dX; iY=(int)dY; iZ=(int)dZ; iH=(int)((dHeading * 255.0 / 360.0) + 128);
//#define SNIFF_PACKET_XYZxyzHh 1 // X,X,Y,Y,Z,Z,x,x,y,y,z,z,H,h
unsigned char cData[] =
{ SNIFF_PACKET_H1,SNIFF_PACKET_H2,
SNIFF_PACKET_XYZxyzHh,14,
(unsigned char)(iX >> 8),(unsigned char)(iX),
(unsigned char)(iY >> 8),(unsigned char)(iY),
(unsigned char)(iZ >> 8),(unsigned char)(iZ),
0,0,0,0,0,0,
(unsigned char)(iH),0
};
pSeqUdp->Send(cData,sizeof(cData));
// save for next time
dLastX=dX; dLastY=dY; dLastZ=dZ;
}
------------------------------
diff -u packet.cpp.old packet.cpp >packet.cpp.diff
--- packet.cpp.old 2003-02-01 22:11:53.000000000 +1100
+++ packet.cpp 2003-02-02 00:37:12.000000000 +1100
@@ -988,6 +988,37 @@
return true;
}
+#define SNIFF_PACKET_H1 0xed
+#define SNIFF_PACKET_H2 0xb0
+#define SNIFF_PACKET_XYZxyzHh 1 // X,X,Y,Y,Z,Z,x,x,y,y,z,z,H,h
+
+void EQPacket::processSnifferPacket(unsigned char ucType,unsigned char ucLen,unsigned char* ucpData)
+{
+ switch(ucType)
+ {
+ case SNIFF_PACKET_XYZxyzHh: // location?
+ if(ucLen == 14)
+ {
+ playerPosStruct pps;
+ pps.opCode = 0xf3; pps.version = 0x20; pps.spawnId=0;
+ pps.heading=ucpData[12];
+ pps.deltaHeading=ucpData[13];
+ pps.x=int(ucpData[0] << 8) | int(ucpData[1]);
+ pps.y=int(ucpData[2] << 8) | int(ucpData[3]);
+ pps.z=int(ucpData[4] << 8) | int(ucpData[5]);
+ pps.deltaX=int(ucpData[6]) | int(ucpData[7]);
+ pps.deltaY=int(ucpData[8]) | int(ucpData[9]);
+ pps.deltaZ=int(ucpData[10]) | int(ucpData[11]);
+ pps.spawnId=1;
+ emit playerUpdate((const playerPosStruct*)(&pps),sizeof(pps),DIR_CLIENT);
+ }
+ break;
+ }
+
+
+
+}
+
/* This function decides the fate of the Everquest packet */
/* and dispatches it to the correct packet handling function */
void EQPacket::decodePacket (int size, unsigned char *buffer)
@@ -1016,12 +1047,35 @@
/* Key Sniffer Hook */
if ((packet.getDestPort() == m_keyPort))
- {
- keyStruct* keypacket = (keyStruct *)packet.getUDPPayload();
- m_decode->theKey(keypacket->key);
+ {
+ int iLen = packet.getRawPacketLength(); // should be UDP Packet length
+
+ if(iLen == sizeof(keyStruct))
+ {
+ keyStruct* keypacket = (keyStruct *)packet.getUDPPayload();
+ m_decode->theKey(keypacket->key);
+ }
+ else // not a key packet? process and decode sniff type packets
+ { // sniff packets go type,len,[data]...
+ unsigned char* ucpPacket;
+ ucpPacket = (unsigned char*)packet.getUDPPayload();
+ unsigned char *ucpEnd = ucpPacket + iLen;
+
+ if((iLen >= 4) && (ucpPacket[0] == SNIFF_PACKET_H1) && (ucpPacket[1] == SNIFF_PACKET_H2))
+ { ucpPacket += 2;
+
+ while(ucpPacket < (ucpEnd-2))
+ {
+ if((ucpPacket+ucpPacket[1]) > ucpEnd) break; // safety
+ processSnifferPacket(ucpPacket[0],ucpPacket[1],ucpPacket+2);
+ ucpPacket = ucpPacket + ucpPacket[1] + 2;
+ }
+ }
+ }
return;
}
-
+return; // decode is borked
+
/* Chat and Login Server Packets, Discard for now */
if ((packet.getDestPort() == ChatServerPort) ||
(packet.getSourcePort() == ChatServerPort))
-----------------------------------------------
diff -u packet.h.old packet.h >packet.h.diff
--- packet.h.old 2003-02-01 23:25:49.000000000 +1100
+++ packet.h 2003-02-01 23:48:06.000000000 +1100
@@ -755,6 +755,7 @@
int getEQTimeOfDay (time_t timeConvert, struct timeOfDayStruct *eqTimeOfDay);
void decodePacket (int size, unsigned char *buffer);
+ void processSnifferPacket(unsigned char cType,unsigned char cLen,unsigned char* cpData);
void dispatchSplitData (EQPacketFormat& pf, uint8_t dir, EQStreamID streamid);
void dispatchZoneData (uint32_t len, uint8_t* data, uint8_t direction = 0);
void dispatchWorldData (uint32_t len, uint8_t* data, uint8_t direction = 0);
UncleBen
02-01-2003, 10:08 AM
I tried and I tried, but I'm too stupid to get this to compile with VC++ I guess.
oh well
SeqTester
02-01-2003, 10:28 AM
I dont get any Errors or warnings, bu also no EXE file.
/hmmm
UncleBen
02-01-2003, 11:15 AM
ok, thought I had it all right till I got this error on compile.
fatal error C1010: unexpected end of file while looking for precompiled header directive.
I"m done messin with this *sigh*. Thanx for the code though
SeqTester
02-01-2003, 01:29 PM
thats also as far as I got before I got kicked off my PC so GF could play.
I told her if I cant stay on then no GPS.
She said "If I dont get on I dont LVL" how do you reply to that?
SeqTester
02-01-2003, 11:38 PM
anyone get anywhere with this one?
I keep getting "fatal error C1010" with VC++6.0
seqmage
02-02-2003, 01:20 AM
Did you make canges to packet.cpp and packet.h in the source code for SEQ ? then after these changes do the ./configure && make?
To restore GPS?
Reading over the code you posted... how do you use it?
whinge
02-02-2003, 02:16 AM
The code was compiled using borland builder 5, as a console app. I have extended Maggotboy's sniffer to make it sniff the eq memory space to get the locs, but I reckon that is a Bad Idea(tm). I'll probably extend it further with spawn locs if I can be bothered - the new encryption looks pretty involved fwiw... on the surface it seems that sony got smart (lol) and made themselves a real protocol for a change. I have faith in the dev's tho
Turn on logging (/log on) and set up a /loc hotkey. Load the right map for the zone, then every time you do a loc with the program running, seq will move your char's location. It is ugly, but does give some gps'ability back. Ironically, it is probably the first "legitimate" use of showeq =)
The changes to packet.cpp and packet.h are on the seq side. Don't bother configuring unless you change your box... just use make (and make install if you want it to automagically move the exe)
_whinge_
bonkersbobcat
02-02-2003, 03:23 AM
Anyone know why I chose ed b0 for the header, tell me and I might send you a jellybean.
Machine code for the LDIR (Block move) instruction? (Z80)
UncleBen
02-02-2003, 04:11 AM
can you post the code in between some {code} {/code} tags. it's still not compiling for me after downloading Borland Builder and was guessing some of the code didn't display right :(
use brackets [ ] and not these { } around the code tags of course :p
Thanx
seqmage
02-02-2003, 04:15 AM
Ok, using lcc compiler, this is what i did to get it built.
Edit the source to change the 1.1.1.1 to the IP of your SEQ box.
change the port number to the port your using.
save file. i saved as gps.c
opened wedit.
click on file then new then project
type a name of the project. i called mine GPSSystem... click ok
on the next window.
browsed to my projects folder where i had already created a GPSSystem folder from when i saved the gps.c source.
so browse to it.
left it on console app.
then i clicked yes to use the wizard to generate app skelly.
checked TCP/IP
clicked generate
then got a success message.. click ok on that
next got compiler settings...
i checked optimize and use pentium pro instructions
i left generate debug info on.
clicked next.. then linker settings comes up.
click next.. then debugger settings.. clicked on finish
in wedit click on compiler and make
got gpssystem.exe built successfully. (0.2 sec)
Now i am not runnig keyring.. i use uncle ben's program for grabbing a key.. but figured i could post how i got it to compile under lcc.
Thanks for your reply whinge
whinge
02-02-2003, 06:45 AM
/e throws bonkersbobcat a jellybean
you're either old (like me) or you know how to use the [search] button...
real coders use poke
_whinge_
whinge
02-02-2003, 07:00 AM
The console app built from a copy-and-paste, but the patch didn't 'cause the forum killed the leading spaces... Attached them this time
_whinge_
ps.
cd showeq/src
patch -u packet.cpp packet.diff
patch -u packet.h packet.h.diff
make
./showeq
Scorpius
02-02-2003, 10:35 AM
Pardon for what I'm sure most will seem as a ridiculously simple question. I just installed Red Hat 8.0 and ShowEQ. All this was done without any trouble, thanks in no small part to these forums. I know that SEQ is down currently, but If I read whinge's post correctly (and I hope I do) do I perform the following steps?
1. Open terminal window (on my SEQ system)
2. type the following in the term window:
a. cd showeq/src
b. patch -u packet.cpp packet.diff
c. patch -u packet.h packet.h.diff
d. make
e. ./showeq
f. open SEQ and under Network-Monitor EQ Client IP Address place in EQ systems IP address OR 1.1.1.1 as stated above? This part's a bit hazy to me.
OR do I simply open up a term window and copy-and-paste all of the information contained in the attached doc?
OR is it a combination of both?
OR do I have it all totally wrong? (which I'm sure it quite possible)
Sincere apologies for this, I'm sure this is quite easy for most of you, but I am fairly new to SEQ, and I'm still trying to figure this out. Thank you for any assistance that can be provided.
Scorpius
SeqTester
02-02-2003, 10:59 AM
1st things 1st, you need to compile the WINDOWS part of it.
That is where I am stuck, I can not get it to compile with VC++6.0, but still playing with it.
e28plug
02-02-2003, 11:03 AM
Thank you scorp for going where others fear to tread :) !!!:confused:
Scorpius
02-02-2003, 11:13 AM
Seq Tester:
Ok, I've downloaded VC++6.0 and VC++7.0. I assume these are compilers. Is there a forum that teaches one HOW to compile? Not sure what it means to compile... complie what. :( If this is too much for a novice to understance or comprehend I'll completely understand and not waste your or any others time.
Scorpius
SeqTester
02-02-2003, 11:19 AM
well he said its based off of Maggetboys sniffer, so I woudl goto that thread and look. His .CPP has some basic instructions to do it.
Scorpius
02-02-2003, 11:20 AM
e28plug:
Well, if I get flamed, that's ok. I'm a complete novice regarding this. I admit it. But I'm willing to learn. I read what I could understand and installed Linux & SEQ. I'm sure this is no big thing for most people in this forum. But I had never done it before. And if I MUST learn how to "compile"... whatever that is, I'll gladly give it a shot. Just point me in the right direction and I'll try. But I don't mind getting flamed... that's ok, I'm sure most of these guys have been asked the same questions over and over again... must get pretty frustrating. That might cause many of us to get a little testy when pressed with the same questions.
Scorpius
Cypsteel
02-02-2003, 11:21 AM
Guys he said he used Borland C++ Builder. Why not use what he used? I did just download it off borlands site. But I am getting a syntax error with line 20. The simple class statement:
class TProcessLine
I am assuming his program is right and I must be missing a compile flag or something.
bcc32 gps.c
What am I doing wrong?
Thanks everyone for all the insight and knowledge,
Cypress Steel
SeqTester
02-02-2003, 12:45 PM
I would try to get the borland compiler and try that.
I can not give you any tips on how to get this working, I have not been able to yet, next step download Borland.
As for the Compiling stuff, you need a WINDOWS compiler to do this, I never really compiled anything before sniffers but when they came out I figured it out kinda fast with the SEARCH button here and was up and runnign the same day Sniffers came out.
If you never got a sniffer working on your own, I would wait till a few more people get this working and then try what they said they did.
Scorpius
02-02-2003, 01:09 PM
seq tester:
Ok, perhaps that would be best. To wait till SEQ is fixed. Having no coding experience and not knowing how to compile, I guess I should wait till it's totally fixed. Thanks again for your advice. I'll keep watching the forums.
Scorpius
Poncho
02-02-2003, 01:22 PM
Skorp-
Take a look under Maggotboy's thread for his keysniffer. If you download that sniffer and open it using one of you VC's he has exact instructions on how to compile. Compiling, to be put in simple terms, is turning soucecode into executable files. The same rules apply for the soucecode posted in this thread.
Also, if you have successfully installed SEQ, you have already "compiled". You just didnt know it :)
Poncho
bonkersbobcat
02-02-2003, 02:36 PM
You're either old (like me) or you know how to use the [search] button...I am old.
Because I am old I know how to use search.
Actually I read the post and felt that the 0xedb0 seemed really familiar for some reason. I ran it over and over in my head and finally googled it. As soon as I saw it next to an LDIR and the familiar register names, a whole lot of memories came back. Thanks for the nostalgia trip!
SeqTester
02-02-2003, 03:10 PM
Hey seqmage, What LCC VER are you runnin? I just downloaded it and everytime I get to your step "then i clicked yes to use the wizard to generate app skelly. " it kills my gps.c and puts some stupid stuff in there instead. Did you repaste the code in the project? I tried that and get tons of errors.
Also did you do any reformatting for "White Space" I know some compilers freak out if not formated, I think this was my VC++6.0 Problem. Well one of them.
This (or similar) addition/extension to SEQ is actually something good.
Pulling location data out of memory with a keysniffer (or seperate loc sniffer, actually, perferrably) is a good idea. We're already invading the Windows memory, no sense in being timid about it.
I haven't tried fiddling with this code snippet yet... and may get around to it, or I may not. I have been swamped at work lately and haven't even had time to play, much less anything else. But I wanted to encourage further development along these lines.
SeqTester
02-02-2003, 04:10 PM
Well, I tried VC++6, Borland C++builder6 and LCC-win32.
I tried the reread to see that I missed, then tried the rereread.
My head hurts. :(
mxedisn
02-02-2003, 10:57 PM
Originally posted by bonkersbobcat
Machine code for the LDIR (Block move) instruction? (Z80)
When I first saw the EDB0, I started thinking, "Z80?"
hehe.
LD HL,3C00
LD BC, 3FF
LD DE,3C01
LD (DE), BF
LDIR
JP 402D
Care to name the platform this little oldie but goodie came from?
(come on, all the hints are there...)
whinge
02-03-2003, 03:02 AM
Hmmm... 64x16 screen at 15360?, filled with bf? bf is probably the big solid block, which would make your trs-80 monitor's power supply whistle in agony...
-
There is a very simple protocol the seq patch interprets... 0xed 0xb0 [code] [length] <data> [code]...
The windows code I posted is simply a log sniffer.
I'm playing with a memory sniffer along the lines of maggotboy's code - basically, it checks a few locations every keystroke and stays resident.
Once I find the spawn data, I'll send a bit of that over the link - probably grey dots like when the encryption was busted a few times ago. If I get it to do anything more than the log sniffer, I'll post that too.
Personally, I'd prefer the packet sniffer :|
_whinge_
SeqTester
02-03-2003, 06:07 AM
Whinge, I know Packet sniffing is better than looking at the log.
I think the log file fix is a great step forward, any tiem SOE makes big changes just load this version back up. being its reading logfiles there really isnt any way for then to break that.
Whinge I still having issues on compiling this, was there anything special you did to compile this? I tried in MS-VC++6.0, Borland C++Builder 6 and lcc-win32 all with no luck so far.
Thanks ,
ST
whinge
02-03-2003, 06:56 AM
was there anything special you did to compile this
start builder, make a new console app using the wizard, no vcl. select everything and delete it, paste the code in, compile...
There is nothing particularly intense in that code - what errors... are you getting?
_whinge_
Cypsteel
02-03-2003, 05:09 PM
Downloaded Borland Builder C++ compiler.
Did a bcc32.exe gps.c
Results:
gps.c:
Error E2141 gps.c 22: Declaration syntax error
Error E2141 gps.c 37: Declaration syntax error
Error E2451 gps.c 55: Undefined symbol 'TSEQUDP' in function main
Error E2379 gps.c 55: Statement missing ; in function main
Error E2451 gps.c 56: Undefined symbol 'SeqUdp' in function main
Error E2451 gps.c 62: Undefined symbol 'TProcessLine' in function main
Error E2379 gps.c 62: Statement missing ; in function main
Error E2140 gps.c 72: Declaration is not allowed here in function main
Error E2140 gps.c 80: Declaration is not allowed here in function main
Error E2140 gps.c 86: Declaration is not allowed here in function main
Error E2451 gps.c 91: Undefined symbol 'new' in function main
Error E2141 gps.c 91: Declaration syntax error in function main
Error E2140 gps.c 107: Declaration is not allowed here in function main
Error E2140 gps.c 108: Declaration is not allowed here in function main
Error E2140 gps.c 109: Declaration is not allowed here in function main
Error E2451 gps.c 120: Undefined symbol 'Process' in function main
Warning W8066 gps.c 135: Unreachable code in function main
Error E2141 gps.c 143: Declaration syntax error
*** 17 errors in Compile ***
Line 22 is :
Class Tsequdp
What am I doing wrong?
Thanks,
Cypsteel
Cypsteel
02-03-2003, 05:25 PM
Duh!
I just figured out what I was doing wrong. I am sure I am not alone.
SeqMage:
"save file. i saved as gps.c "
When using BCC32.exe you have to have a source file with .cpp or it thinks its regular C. Newbie programmer alert! I figured this out by just making a quick example program called Hi.c. It wouldn't compile until I named it Hi.cpp.
#include <iostream.h>
int main(void)
{
cout << "Hello." << endl;
return 0;
}
DING! You have become better at programming(1).
Compile it with a .cpp extension. Ignore the warning you get. You are supposed to get it. It is unreachable code.
Good luck everyone.
Cypress Steel
UncleBen
02-03-2003, 05:39 PM
gann, I get these errors compiling it as I think you said using Borland C++ Builder 6.0 :(
[C++ Warning] loc.cpp(131): W8066 Unreachable code
[C++ Error] loc.cpp(256): E2040 Declaration terminated incorrectly
[C++ Error] loc.cpp(262): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(262): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(262): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(262): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(264): E2190 Unexpected }
[C++ Error] loc.cpp(266): E2040 Declaration terminated incorrectly
[C++ Error] loc.cpp(266): E2206 Illegal character '#' (0x23)
[C++ Error] loc.cpp(267): E2206 Illegal character '#' (0x23)
[C++ Error] loc.cpp(268): E2206 Illegal character '#' (0x23)
[C++ Error] loc.cpp(300): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(300): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(300): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(300): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(348): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(348): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(348): E2206 Illegal character '@' (0x40)
[C++ Error] loc.cpp(348): E2206 Illegal character '@' (0x40)
SeqTester
02-03-2003, 06:23 PM
this is what I get with dos mode compile. I am new to C++ but trying to learn fast. Also put the path I have to rule out that.
----------------------------------------------------
C:\BCC55\Bin>path
PATH=C:\BCC55\Bin;C:\BCC55\Include;C:\BCC55\Lib
C:\BCC55\Bin>bcc32 -Ic:\bcc55\include GPS.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
GPS.cpp:
Warning W8066 GPS.cpp 133: Unreachable code in function main(int,char * *)
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Fatal: Unable to open file 'C0X32.OBJ'
C:\BCC55\Bin>
SeqTester
02-03-2003, 07:18 PM
got it compiled, now need to aply patches.
I GhettoFixed it by coping all the BCC55 files into 1 dir, all but includes being I figured out how to tell it where those were.
SeqTester
02-03-2003, 09:37 PM
still not working.
The windblows end seems to work now but when I tried patching like he said I got errors. I tried merging it in by hand got it to complie with 2 "Warnings" that I was hoping that was normal due to something being disabled in SEQ.
SEQ loads fine I can pull up maps but I am not getting player location from /loc. I will look into more on my problems with the patch files tomorrow after work.
And yes I got it from his link.
can you posibly post them as 2 .diffs ?
UncleBen
02-03-2003, 10:08 PM
I'm a dumb ass, there's 2 sets of code in that long first post.
that'll teach me not to read thru all of it *sigh*
for those that are trying to compile ALL that, don't, the C++ code is the first half and breaks where the line looking like this is
------------------------------------------
below that is the diffs patch *moan*
UncleBen
02-04-2003, 12:04 AM
got it compiled and checking my log file like it should. Now my problem is the diffs. I keep getting 'Hunk #2 FAILED at 1047 with the packet.cpp.diff
and both diff files give a 'patch unexpectedly ends in middle of line' message. I do get a 'hunk #1 succeeded at 755 with fuzz 1' after that message patching packet.h though.
dunno wth the problem is, type the patch -u command in and it should be as easy as that; hehe.
repost the diffs seperately maybe. just embed then in {code} {/code} tags and the forum will keep the white spaces np.
SOOO close :)
Thanx
whinge
02-04-2003, 02:59 AM
Try this...
and http://www.winzip.com if you really get stuck ;)
I don't think there is much left to go wrong... there are two showeq files to patch, and the windows program to compile. Make sure you get the right log file to watch.
_whinge_
UncleBen
02-04-2003, 07:07 AM
Thanx for the zip package Whinge (and the winzip link *giggle*). Seems I had it all right and still just lacking getting the packet.cpp to patch. packet.h still patches fine but I"m getting
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 1047
when patching packet.cpp
anyone have any luck patching packet.cpp? I'm using 'patch - u packet.cpp patch_packet_cpp.diff' and it's not working.
EDIT: this is the rejects file for the faild patch of packet.cpp
***************
*** 1016,1027 ****
/* Key Sniffer Hook */
if ((packet.getDestPort() == m_keyPort))
- {
- keyStruct* keypacket = (keyStruct *)packet.getUDPPayload();
- m_decode->theKey(keypacket->key);
return;
}
-
/* Chat and Login Server Packets, Discard for now */
if ((packet.getDestPort() == ChatServerPort) ||
--- 1047,1081 ----
/* Key Sniffer Hook */
if ((packet.getDestPort() == m_keyPort))
+ {
+ int iLen = packet.getRawPacketLength(); // should be UDP Packet length
+
+ if(iLen == sizeof(keyStruct))
+ {
+ keyStruct* keypacket = (keyStruct *)packet.getUDPPayload();
+ m_decode->theKey(keypacket->key);
+ }
+ else // not a key packet? process and decode sniff type packets
+ { // sniff packets go type,len,[data]...
+ unsigned char* ucpPacket;
+ ucpPacket = (unsigned char*)packet.getUDPPayload();
+ unsigned char *ucpEnd = ucpPacket + iLen;
+
+ if((iLen >= 4) && (ucpPacket[0] == SNIFF_PACKET_H1) && (ucpPacket[1] == SNIFF_PACKET_H2))
+ { ucpPacket += 2;
+
+ while(ucpPacket < (ucpEnd-2))
+ {
+ if((ucpPacket+ucpPacket[1]) > ucpEnd) break; // safety
+ processSnifferPacket(ucpPacket[0],ucpPacket[1],ucpPacket+2);
+ ucpPacket = ucpPacket + ucpPacket[1] + 2;
+ }
+ }
+ }
return;
}
+ return; // decode is borked
+
/* Chat and Login Server Packets, Discard for now */
if ((packet.getDestPort() == ChatServerPort) ||
any chance you could just post your patched packet.cpp file to end my nightmares? :D :D
Cypsteel
02-04-2003, 08:48 AM
Well first off, and most importantly, Thank you Whinge! Not only did you create a quick fix for gps to get us by, but you have also posted 4 times in attempt to help us nonprogrammers try to get your solution working. I can speak for myself, I appreciate your efforts immensely.
Now on to
You become better at programming(2).
I also got the same
"Hunk #2 FAILED at 1047 with the packet.cpp.diff"
What I did:
I cut and pasted the info out of patches.txt to to differant files: packet.cpp.diff and packet.h.diff. The second one patches fine. And the first hunk of the first patch works fine also. It just has a problem with the second one.
But to get around that. I manually patched the file by adding the lines with a + in front of them. And deleting the lines with a - in front of them. The lines with nothing in front of them I just used for reference. Also make sure you take out the +'s.
Next did a make. I get 2 warnings when compiling in packet.cpp. I am not at my home linux box so I can't tell you exactly what they were. Just 2 warnings something about :
Varible assumed int or something. // But the line referenced as a problem wasn't one of the lines added or subtracted anyways. So I figure this is not a problem.
So the next step was make install.
The sniffer seems to be working fine. It is monitoring my log file and I see it acknowledging my loc's. If my location was 123.45 56.78 9.9 it scrolls across the sniffer followed by Your loc is 123 56 9. I assume that the sniffer is finding it and truncating the fractional part. NOTE: I did make sure and change my address and port of my linux box in the sniffer.cpp before compiling.
I still get nothing on my Showeq... To double check the packets were getting to my box, I downloaded and installed ngrep-1.40-i386.rpm which is a network monitoring tool. I monitored for about 10 secs while doing a loc on my EQ machine and I get traffic on my port (5555) but it looks like :
.................../.....
This is where I am lost. It leads me to believe the sniffer is working because I am getting traffic on my selected port. Why does it look like this? Am I using ngrep right? I tried launching ./showeq with both
./showeq eth0 --ip-address 192.168.0.74 //linux box address
./showeq eth0 --ip-address 192.168.0.52 //EQ box address
I am lost. As I hope you can tell, I am one of those ppl that checks every possible step. I also try to RTFM and fix problems on my own. I have spent 5 hours on it and haven't given up yet. I again thank Ratt and Whinge and everyone else for all their knowledge. Everyone needs to remember, without yall, there wouldn't be a showeq.
/Cheers
Cypress Steel
UncleBen
02-05-2003, 03:16 PM
yay, finally got it working after manually patching the packet.cpp file; hehe.
Thanx a bunch Whinge, it works great.
could someone convert this code to compile in vc++?
UncleBen
02-05-2003, 10:52 PM
for those that need, here is my diff's file for packet.cpp which wouldn't patch with the one posted
SeqTester
02-06-2003, 05:16 PM
Well patch ran fine, but I get this on make
Going to let it finish and test it out.
packet.cpp: In member function 'void EQPacket::dispatchZoneData(unsigned int, uint8_t*, unsigned char)':
packet.cpp:1850: warning: comparison is always true due to limited range of data type
packet.cpp:1850: warning: comparison is always true due to limited range of data type
code tags so it would look correct.
ST
SeqTester
02-06-2003, 06:08 PM
OMG.... I am such a newb, I reread this thread about 10 times and for some reason thought that the "Change the port (10000) and the IP (1.1.1.1) to match your previous keygrabber
" and I changed it in SEQ. For some reason I was remembering the post that said to have SEQ watch another IP so it would not crash and use mouse to get /locs from it.
The warnings I posted above are NORMAL, it WIL work with those warnings.
This is an easy fix to get a good map system working. No Mobs and you need to change the maps by hand (should be easy to fix this) but better than running blind. And the best part is there is no real decode so technically it is not bannable to use this fix being it only reads your logfile.
On the fixing the auto map changing part, this could be modified to read the MEM address that says the zone name that matches ShowEQ. Can not really read this from logs unless you setup some table to change things like "You have now entered Plane of Knowledge" to "Poknowledge" for all zones.
ST
/thank whinge
Blinders but at least I can see, kinda. :)
Amadeus
02-13-2003, 08:35 PM
I like this code because it's a nice idea and he added the code to packet.cpp in a way where one could easily expand upon the idea.
I could see some real ideas for some nice log parsing->to->SEQ action if I knew that MQ would still be working after this next patch.
Using 'who npc' along with this kind of coding idea would allow you to have a "snapshot" of the zone I would imagine. Perhaps even a regular picture if you reduced the range of the command and had it going every few seconds.
Possibilities are somewhat endless for a broken-but-kinda-working SEQ if MQ doesn't get broken too soon and if you're willing to use it. It would still be a log parser...but wouldn't be as awkward as something such as Xylobot.
or...maybe I'm crazy
On the fixing the auto map changing part, this could be modified to read the MEM address that says the zone name that matches ShowEQ. Can not really read this from logs unless you setup some table to change things like "You have now entered Plane of Knowledge" to "Poknowledge" for all zones.
I read this after the fact; however, I should point out that the memory structure has been identified that contains the "short" name of the zones (ie, Poknowledge). Again, a simple mod to MQ would write this out to the log file quite easily when someone zoned.
Can someone clean up a patch for SEQ to handle the remote loc info...
Adding in an option to take mob data from MQ or some other memory sniffer as well would be a bonus.
I'll see what I can do about reviewing it and adding it to the tree.
As for the windows side part - a seperate patch for that would be good as well.
Amadeus
02-14-2003, 11:01 PM
I am currently working on the patch to MQ to do some of the things mentioned. I will post on a different thread when complete.
MQ could be broken next patch though from what I'm seeing on test...and the head MQ dev has been sortof missing in action lately...so...who knows....
Cryonic
02-15-2003, 04:07 PM
Finally got around to giving this a try. I succeeded just by reading and rereading the posts in this thread. I'm a total neophyte when it comes to Windows and compiling (but not to just Windows in general or I wouldn't have my current job).
Downloaded the Borland commandline compiler (free from their website) as I didn't feel like spending money or pirating something like VS. I only had to read one file and I was able to compile the gps.exe on my Win2k machine. The file was aptly named README. It showed me how to include the path to the appropriate .h files.
Now I have a minimal function SEQ, but it is enough :)
Originally posted by SeqTester
Well patch ran fine, but I get this on make
Going to let it finish and test it out.
packet.cpp: In member function 'void EQPacket::dispatchZoneData(unsigned int, uint8_t*, unsigned char)':
packet.cpp:1850: warning: comparison is always true due to limited range of data type
packet.cpp:1850: warning: comparison is always true due to limited range of data type
code tags so it would look correct.
ST
instead of 1850 i'm getting 1805 from a non edited copy from the cvs i don't recall this happening before. Is this normal during make?
Cryonic
02-24-2003, 05:50 PM
figured I'd just bump this thread. Since SEQ is borked again, back to trying this out :)
SeqTester
02-24-2003, 06:00 PM
I left hacked up a copy of "LogfileGPS-SEQ" with this being they can not really break this one.
But I am just going run current CVS, turn off unknowns and not run KeySniffer. It Seems much better than hitting /loc all the time.
SEQ is hosed but not as bad as it was last time, Or maybe that's just because I have not had time to play much today.
ST
Also you can hit [BACKSPACE] key and get there shitty maps, well not shitty maps (Being they stole them from here) but sucks on same PC.
Mr Guy
02-25-2003, 10:13 AM
SEQ is hosed but not as bad as it was last time, Or maybe that's just because I have not had time to play much today.
Seems to be fine except for the slight detail that it can't tell when you zone, so I'm betting on an opcode fix. Now I, of course, have no idea what to DO about that.
Powered by vBulletin® Version 4.1.11 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.