fester
08-27-2003, 06:34 PM
Originally posted by Zaphod
One of these days I'll have to find out how you guys are generating that.
http://seq.sourceforge.net/forums/showthread.php?s=&threadid=3432&highlight=opcode+decode.cpp
Originally posted by DebianSEQ
charProfileStruct is pissing me off ... Even made clean first, and still no change.
Often the structures are padded alignment boundaries. Add the uint32_t and a uint8_t [2] before skills. Also you might find this code interesting (I use it to diff charprofile for changes:)
Insert in void Player::backfill(const charProfileStruct* player) and follow these notes:
char pos_data should be updated with the included shell commands.
CLEAR_CHARPROFILESTRUCT should be modified to include things you KNOW you are not interested in seeing.
Some items from my everquest.h which you may want to ignore are
/*0150*/ uint32_t birthdate; // Birthdate in epoch format
/*0154*/ uint8_t unknown0154[4]; // uint16_t[0] Incremented by seconds, uint16_t[1]? Seems to be tied to /played "current sessions" time.
/*0158*/ uint32_t playedtotal; // Number of Minutes Played
/*0590*/ char servername[64]; // length probably not right
/*2902*/ uint8_t playerpos[0]; // Player Position (4 dwords) [16]
/*2902*/ unsigned heading:12; // Uses bitfields
/*2903*/ signed deltaHeading:10;
/*2904*/ unsigned animation:10; // end of 1st
/*2906*/ signed deltaX:13;
/*2907*/ signed x:19; // end of 2nd
/*2910*/ signed y:19;
/*2912*/ signed deltaZ:13; // end of 3rd
/*2914*/ signed deltaY:13;
/*2915*/ signed z:19; // end of 4th
/*3594*/ uint32_t counter; // +=2 for every time you zone or camp/return
/*3922*/ char groupmembers[6][64];// Names of each group member
// fester fancy differ for CharProfileCode
#define CLEAR_CHARPROFILESTRUCT(x) \
memset(x.unknown0002, 0, 4); /* Random Number */ \
memset(x.name, 0, 64); \
memset(x.lastName, 0, 32); \
memset(&x.gender, 0, 4); \
memset(&x.level, 0, 4); \
memset(&x.deity, 0, 4); \
memset(&x.birthdate, 0, 4); \
memset(&x.playedtotal, 0, 4); \
memset(x.servername, 0, 64); \
memset(&x.points, 0, 4); \
memset(&x.curHp, 0, 4); \
memset(&x.STR, 0, 7 * 4); /* All 7 Stats */ \
memset(x.languages, 0, 28); \
memset(x.sSpellBook, 0, 400 * 4); \
memset(x.sMemSpells, 0, 8 * 4); \
memset(&x.playerpos[0], 0, 4 * 4); \
memset(&x.platinum, 0, 8 * 4); /* All Money */ \
memset(x.skills, 0, 74 * 4); \
memset(&x.counter, 0, 4); \
memset(&x.zoneId, 0, 4); \
memset(&x.buffs[0], 0, 15 * sizeof(spellBuff)); \
memset(x.groupmembers, 0, 6 * 64);
{
unsigned int cc, cpc, tt;
float *f;
unsigned char *o, *c;
static struct charProfileStruct old_stash = { 0 };
struct charProfileStruct curr_stash = *(player);
/*
Made with:
printf "\tstruct char_pos {\n\t\tint\tpos;\n\t\tchar\t*name;\n"; \
(echo "} posdata[] = {"; cat everquest.h | \
perl -e '@i=<STDIN>;$d=join("",@i);$d=~s/^.*\nstruct charProfileStruct\n{\n//s;$d=~s/\n};\n.+/\n/s;print $d;' | \
grep '^\/\*[0-9][0-9][0-9][0-9]\*\/' | sed -e 's/\[.*$//' -e 's/;.*$//' -e 's#[\/\*]*##g' | \
awk 'NF > 1 {print "{ "$1+0", #"$3"# }, "}'; echo "{ -1, ## } };") | sed -e 's/ /_/g' | xargs -s 120 | \
sed -e 's/_/ /g' -e 's/^{/\t{/' -e 's/^/\t/' -e 's/#/"/g'
*/
struct char_pos {
int pos;
char *name;
} posdata[] = { { 0, "opCode" }, { 1, "version" }, { 2, "unknown0002" }, { 6, "name" },
{ 70, "lastName" }, { 102, "gender" }, { 106, "race" }, { 110, "class " }, { 114
, "unknown0114" },
{ 118, "level" }, { 122, "unknown0122" }, { 142, "deity" }, { 146, "unknown0146"
},
{ 150, "birthdate" }, { 154, "unknown0154" }, { 158, "playedtotal" }, { 162, "unk
nown0162" },
{ 590, "servername" }, { 654, "unknown0654" }, { 662, "points" }, { 666, "MANA" }
, { 670, "curHp" },
{ 674, "unknown0674" }, { 678, "STR" }, { 682, "STA" }, { 686, "CHA" }, { 690, "
DEX" }, { 694, "INT" },
{ 698, "AGI" }, { 702, "WIS" }, { 706, "unknown0706" }, { 754, "languages" }, {
782, "unknown0782" },
{ 786, "sSpellBook" }, { 2386, "unknown2386" }, { 2834, "sMemSpells" }, { 2866, "
unknown2866" },
{ 2902, "heading:12" }, { 2903, "deltaHeading:10" }, { 2904, "animation:10" }, {
2906, "deltaX:13" },
{ 2907, "x:19" }, { 2910, "y:19" }, { 2912, "deltaZ:13" }, { 2914, "deltaY:13" },
{ 2915, "z:19" },
{ 2918, "unknown2918" }, { 2922, "platinum" }, { 2926, "gold" }, { 2930, "silver"
}, { 2934, "copper" },
{ 2938, "platinumBank" }, { 2942, "goldBank" }, { 2946, "silverBank" }, { 2950, "
copperBank" },
{ 2954, "unknown2954" }, { 2970, "skills" }, { 3266, "unknown3266" }, { 3594, "co
unter" },
{ 3598, "unknown3598" }, { 3678, "zoneId" }, { 3682, "buffs" }, { 3922, "groupmem
bers" },
{ 4306, "unknown4306" }, { -1, "" } };
// fprintf(stderr, "copied info into curr_stash, opcode = %d\n", curr_stash.opCode);
if (old_stash.opCode == 0) {
old_stash = *(player);
CLEAR_CHARPROFILESTRUCT(old_stash)
// fprintf(stderr, "copied info into old_stash, opcode = %d\n", old_stash.opCode);
}
tt = player->birthdate;
fprintf(stderr, "Unknown0002 %08lx, gender %d (0=m;1=f) Race %d Class %d\n"
"Unknown0114 %08lx, Unknown0122 %08lx%08lx%08lx%08lx%08lx\n"
"Deity %ld, Unknown0146 %08lx(%%f %f) Birthdate %s\n"
"Unknown0154 %04x%04x Played %d days, %d hours, %d mins\n"
"Server %s, Unknown0654 %08lx, Unknown0658 %08lx(%%f %f)\n"
"Points %ld, MANA %ld, HP %ld, Unknown0674 %08lx\n"
"STR %ld STA %ld CHA %ld DEX %ld INT %ld AGI %ld WIS %ld\n"
"Unknown0782 %08lx Heading %d(%d), ani %d, x %d(%d), y %d(%d), z %d(%d)\n"
"Unknown2918 %08lx, Counter %ld, ZoneId %d, Unknown4306 %08lx\n"
, *( (unsigned long *) &player->unknown0002[0] )
, (unsigned) player->gender
, (unsigned) player->race
, (unsigned) player->class_
, (unsigned long) player->unknown0114
, *( (unsigned long *) &player->unknown0122[0] )
, *( (unsigned long *) &player->unknown0122[4] )
, *( (unsigned long *) &player->unknown0122[8] )
, *( (unsigned long *) &player->unknown0122[12] )
, *( (unsigned long *) &player->unknown0122[16] )
, (unsigned long) player->deity
, *( (unsigned long *) &player->unknown0146[0] )
, *( (float *) &player->unknown0146[0] )
, ctime((time_t*)&tt)
, *( (unsigned short *) &player->unknown0154[0] )
, *( (unsigned short *) &player->unknown0154[2] )
, player->playedtotal/60/24, ((player->playedtotal/60) % (60*24) )/60, player->playedtotal %
60
, player->servername
, *( (unsigned long *) &player->unknown0654[0] )
, (unsigned long) player->altexp * 65536 + (unsigned long) player->exp
, *( (float *) &player->exp)
, (unsigned long) player->points
, (unsigned long) player->MANA
, (unsigned long) player->curHp
, (unsigned long) player->unknown0674
, (unsigned long) player->STR
, (unsigned long) player->STA
, (unsigned long) player->CHA
, (unsigned long) player->DEX
, (unsigned long) player->INT
, (unsigned long) player->AGI
, (unsigned long) player->WIS
, *( (unsigned long *) &player->unknown0782[0] )
, player->heading, player->deltaHeading, player->animation, player->x, player->deltaX, playe
r->y, player->deltaY
, player->z, player->deltaZ
, *( (unsigned long *) &player->unknown2918[0] )
, (unsigned long) player->counter
, (unsigned int) player->zoneId
, *( (unsigned long *) &player->unknown4306[0] )
);
f = (float *) &player->unknown0122[0];
fprintf(stderr, "floats of Unknown0122: ");
for (cc=0; cc<20/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown0162[0];
fprintf(stderr, "\nfloats of Unknown0162: ");
for (cc=0; cc<428/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown0706[0];
fprintf(stderr, "\nfloats of Unknown0706: ");
for (cc=0; cc<48/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown2386[0];
fprintf(stderr, "\nfloats of Unknown2386: ");
for (cc=0; cc<448/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown2866[0];
fprintf(stderr, "\nfloats of Unknown2866: ");
for (cc=0; cc<36/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown2954[0];
fprintf(stderr, "\nfloats of Unknown2954: ");
for (cc=0; cc<16/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown3266[0];
fprintf(stderr, "\nfloats of Unknown3266: ");
for (cc=0; cc<328/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
f = (float *) &player->unknown3598[0];
fprintf(stderr, "\nfloats of Unknown3598: ");
for (cc=0; cc<80/4; cc++) {
fprintf(stderr, "%.4g, ", f[cc]);
}
fprintf(stderr, "\nUnknown0162:\n");
for(cc=0; cc<428; cc+=4) {
fprintf(stderr, "%08lx ", *( (unsigned long *) &player->unknown0162[cc] ) );
if (cc && ((cc % 52) == 0))
fprintf(stderr, "\n");
}
fprintf(stderr, "\nUnknown0706:\n");
for(cc=0; cc<48; cc+=4) {
fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown0706[cc] ) );
if (cc && ((cc % 32) == 0))
fprintf(stderr, "\n");
}
// fprintf(stderr, "\nLanguages:\n");
// for(cc=0; cc<28; cc++) {
// fprintf(stderr, "%d ", player->languages[cc]);
// if (cc && ((cc % 17) == 0))
// fprintf(stderr, "\n");
// }
// fprintf(stderr, "\nUnknown2386:\n");
// for(cc=0; cc<448; cc+=4) {
// fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown2386[cc] ) );
// if (cc && ((cc % 32) == 0))
// fprintf(stderr, "\n");
// }
fprintf(stderr, "\nUnknown2866:\n");
for(cc=0; cc<36; cc+=4) {
fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown2866[cc] ) );
}
fprintf(stderr, "\nUnknown2954:\n");
for(cc=0; cc<16; cc+=4) {
fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown2954[cc] ) );
}
// fprintf(stderr, "\nSpellBook:\n");
// for(cc=0; cc<400; cc++) {
// if (player->sSpellBook[cc] && player->sSpellBook[cc] != -1) {
// fprintf(stderr, "%s, ", spell_name(player->sSpellBook[cc]).ascii());
// if (cc && ((cc % 3) == 0))
// fprintf(stderr, "\n");
// }
// }
// fprintf(stderr, "\nSpell Mem:\n");
// for(cc=0; cc<8; cc++) {
// fprintf(stderr, "%s, ", spell_name(player->sMemSpells[cc]).ascii());
// if (cc && ((cc % 3) == 0))
// fprintf(stderr, "\n");
// }
fprintf(stderr, "\nUnknown3266:\n");
for(cc=0; cc<328; cc+=4) {
fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown3266[cc] ) );
if (cc && ((cc % 52) == 0))
fprintf(stderr, "\n");
}
fprintf(stderr, "\nUnknown3598:\n");
for(cc=0; cc<80; cc+=4) {
fprintf(stderr, "%08lx", *( (unsigned long *) &player->unknown3598[cc] ) );
if (cc && ((cc % 52) == 0))
fprintf(stderr, "\n");
}
fprintf(stderr, "\nSpell Buff:\n");
for(cc=0; cc<15; cc++) {
if (player->buffs[cc].spell != -1) {
fprintf(stderr, "%s: #%d, L:%d, D:%d, U:%02x-%04x-%08lx\n",
spell_name(player->buffs[cc].spell).ascii(), cc, player->buffs[cc].l
evel,
player->buffs[cc].duration, (unsigned) player->buffs[cc].unknown0000
,
(unsigned) player->buffs[cc].unknown0002[0] +
(unsigned) player->buffs[cc].unknown0002[1] * 256,
(unsigned long) player->buffs[cc].unknown0012);
}
}
fprintf(stderr, "\nGroup:\n");
for(cc=0; cc<6; cc++) {
if (player->groupmembers[cc][0])
fprintf(stderr, "%d:%s\n", cc, player->groupmembers[cc]);
}
CLEAR_CHARPROFILESTRUCT(curr_stash)
if (strncmp(&old_stash.name[0], &curr_stash.name[0], 64)) { // Changed Characters
fprintf(stderr, "Switching Characters from %s to %s\n", old_stash.name, curr_stash.n
ame);
old_stash = curr_stash;
}
fprintf(stderr, "Differences:\n");
o = (unsigned char *) &old_stash;
c = (unsigned char *) &curr_stash;
for(cc=0; cc<sizeof(curr_stash);cc++) {
if (*c != *o) {
char *found_pos = "not found";
int begin_pos = 0;
for (cpc=1; posdata[cpc].pos != -1; cpc++) {
if ((unsigned) posdata[cpc].pos > cc && (unsigned) posdata[cpc-1].po
s <= cc) {
found_pos = posdata[cpc-1].name;
begin_pos = posdata[cpc-1].pos;
}
}
fprintf(stderr, "0x%03x: %02x -> %02x (%s[%d])\n", cc, *o, *c, found_pos, cc
- begin_pos);
}
c++; o++;
}
old_stash = curr_stash;
}
Generic Differ:
// fester diff the memory
{
unsigned int cc, cclen;
char *o, *c;
static char old_stash[16384] = { 0 };
char curr_stash[16384] = { 0 };
cclen = len;
if (cclen > 16384)
cclen = 16384;
memcpy(curr_stash, (char *) data, cclen);
fprintf(stderr, "copied into curr_stash, opcode = %d\n", *(short *) &curr
_stash[0]);
if (!old_stash[0] && !old_stash[1]) {
memcpy(old_stash, (char *) data, cclen);
fprintf(stderr, "copied into old_stash, opcode = %d\n", *(short *) &curr_stash[0]);
}
fprintf(stderr, "Generic Differences (Op %d):\n", *(short *) &curr_stash[0]);
o = (char *) &old_stash[0];
c = (char *) &curr_stash[0];
for (cc=0; cc<cclen;cc++) {
if (*c != *o) {
fprintf(stderr, "0x%03x: %02x -> %02x\n", cc, *(unsigned char *)o, *(unsigned char *)c);
}
c++; o++;
}
memcpy(old_stash, curr_stash, cclen);
}
Also the Make clean issue is very likely due to showeq not redoing the moc'd files. Add this:
diff -c -r ./src/Makefile.am /root/showeq/src/Makefile.am
*** ./src/Makefile.am Thu Aug 21 00:51:29 2003
--- /root/showeq/src/Makefile.am Sun May 18 13:14:10 2003
***************
*** 55,61 ****
MAINTAINERCLEANFILES= Makefile.in
! m_%.cpp: %.h %.cpp
$(MOC) -nw $< -o $@
if CGI
--- 55,61 ----
MAINTAINERCLEANFILES= Makefile.in
! m_%.cpp: %.h
$(MOC) -nw $< -o $@
if CGI
diff -c -r ./configure.in /root/showeq/configure.in
*** ./configure.in Tue Aug 19 17:47:26 2003
--- /root/showeq/configure.in Tue May 20 02:32:16 2003
***************
*** 515,523 ****
CXXFLAGS="$USE_THREADS $USE_OPT_CXX $USE_DEBUG_CXX $USE_INLINE_CXX $USE_PROFILE_CXX -DQT_THREAD_S
UPPORT=1 -DDISPLAY_ICONS=${CGI_ICONS} -DICON_DIR=\\\"${CGI_ICON_DIR}\\\""
AC_DEFUN(SUCCESS,[
- cp -f src/Makefile src/Makefile.bak
- echo "#DO NOT DELETE - Make depend" >> src/Makefile
- (cd src; ${CXX} -MM *.c *.cpp 2>/dev/null >> Makefile)
echo "Success!"
case $target_os in
solaris*)
--- 515,520 ----
Then run this command:
make distclean
rm Makefile.dist.dbg Makefile.in conf/Makefile.in config.guess config.sub configure ltmain.sh maps/Makefile.in src/Makefile.in stamp-h.in aclocal.m4 src/Makefile.bak
You now have a "factory" clean (fresh CVS) version.
i]Originally posted by Enduron
stumbled upon this one...
BeginCastCode is 0x0017...old was like 16 lol..but I found it by casting over and over and over lol...
0x0017 was BeginCastCode for ShowEQ prior to the patch; It evidently did not change if you see it as 0x0017 after the patch. StartCastCode was 0x00c5 and CastOnCode was 0x0110. One thing of note. StartCastCode contained the target id your character had targeted, so spells that are group buffs (that are not targeted group buffs), pet buffs and personal only buffs may look confusing to ShowEQ.
Powered by vBulletin® Version 4.1.11 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.