PDA

View Full Version : decode.cpp for Dec 18 patch



codepig666
12-18-2003, 03:21 PM
I'm altering this post to reflect all known fixes in one place. As people post more opcodes, I will edit them onto this message.

Contents:
Decode.cpp
spawnStruct
playerSelfPosStruct
opcodes

--------------------------------------------------------------------------------------

/*
* Decode.cpp
*
* ShowEQ Distributed under GPL
* http://www.hackersquest.gomp.ch/
*/

#include "main.h"
#include "decode.h"

uint16_t implicitlen (uint16_t opcode)
{
switch (opcode) {
case 0x0022: // 34
return 0x08; // 8
case 0x0028: // 40
return 0x12; // 18
case 0x003f: // 63
return 0x0c; // 12
case 0x00c0: // 192
return 0x0c; // 12
case 0x00e4: // 228
return 0x17; // 23
case 0x00f5: // 245
return 0x04; // 4
case 0x0102: // 258
return 0x88; // 136
case 0x0103: // 259
return 0x1f; // 31
case 0x012e: // 302
return 0x09; // 9
case 0x0131: // 305
return 0x08; // 8
case 0x0142: // 322
return 0x04; // 4
case 0x021e: // 542
return 0x03; // 3
case 0x021f: // 543
return 0x03; // 3
case 0x0234: // 564
return 0x06; // 6
case 0x0235: // 565
return 0x06; // 6
default:
return 0;
}
}


-------------------------------------------------------------------------------------


struct spawnStruct
{
/*000*/ uint8_t NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a
/*001*/ char unknown001[42];
/*043*/ uint8_t class_;
/*044*/ char unknown044[2]; // *** Placeholder
/*046*/ int8_t curHp;
/*047*/ char unknown047[2];
/*049*/ int32_t race; // race
/*053*/ char unknown053;
/*054*/ char name[64]; // name
/*118*/ uint8_t haircolor; // hair color
/*119*/ uint8_t light; // 0=visible,1=invisible
/*120*/ uint8_t invis;
/*121*/ int8_t maxHp; // max hp
/*122*/ uint8_t pvp; // 0=Not pvp,1=pvp
/*123*/ uint8_t level;
/*124*/ uint8_t lfg; // 0=Not lfg,1=lfg
/*125*/ uint16_t heading; // spawn heading
/*127*/ uint8_t deltaHeading; // change in heading
/*128*/ uint8_t animation; // animation id
/*129*/ signed deltaX:13;
signed x:19;
/*133*/ signed y:19;
signed deltaZ:13;
/*137*/ signed deltaY:13;
signed z:19;
/*141*/ char unknown141[10];
/*151*/ float size; // Size
/*155*/ uint8_t helm;
/*156*/ float runspeed; //
/*160*/ uint8_t gm; // 0=not GM,1=GM
/*161*/ float walkspeed; //
/*165*/ uint32_t guildID; // GuildID
/*169*/ uint8_t anon; // 0=normal,1=anon,2=roleplaying
/*170*/ uint8_t gender; // 0=male,1=female,2=other
/*171*/ uint16_t spawnId; // Id of spawn
/*173*/ char unknown173[3];
/*176*/ char lastName[32]; // lastname
/*208*/ int32_t equipment[9];
/*244*/ uint8_t linkdead; // 0=Not LD, 1=LD
/*245*/ uint32_t bodytype; // Bodytype
/*249*/ char unknown249[5];
/*254*/ uint32_t petOwnerId;
/*258*/ int16_t deity;
/*260*/ char unknown260[7];
};

-----------------------------------------------------------------------------------


/*
** Self Position Update
** Length: 30 Octets
** OpCode: PlayerPosCode
*/

struct playerSelfPosStruct
{
/*0000*/ uint16_t spawnId;
/*0002*/ float z;
/*0006*/ float y;
/*0010*/ float deltaY;
/*0014*/ float x;
/*0018*/ float deltaX;
/*0022*/ float deltaZ;
/*0026*/ unsigned heading:12;
signed deltaHeading:10;
unsigned animation:10;
/*0030*/
};


-----------------------------------------------------------------------------------

Zone Opcodes:

0x0014 - OP_Consent
0x0018 - OP_AckPacket
0x0020 - OP_ItemLinkClick
0x0022 - OP_BeginCast
0x0025 - OP_CommonMessage
0x0027 - OP_TimeofDay
0x0028 - OP_ClientUpdate
0x003f - OP_MobUpdate
0x0057 - OP_WhoAllRequest
0x006c - OP_PlayerProfile
0x007a - OP_ExpUpdate
0x0087 - OP_PetitionQue
0x0088 - OP_RandomReply
0x008d - OP_SetRunMode
0x009d - OP_Hide
0x009e - OP_Sneak
0x00bf - OP_CastSpell
0x00c1 - OP_BuffFadeMsg
0x00e4 - OP_Action2
0x00ed - OP_NewZone
0x00f5 - OP_DeleteSpawn
0x00f8 - OP_Save
0x00f9 - OP_ShopRequest
0x00fb - OP_ClickObject
0x00fc - OP_GroundSpawn
0x00ff - OP_ReqClientSpawn
0x0103 - OP_Actoin
0x0107 - OP_Death
0x0129 - OP_MoveDoor
0x012e - OP_WearChange
0x0131 - OP_SpawnAppearance
0x0142 - OP_Animation
0x0144 - OP_ZoneChange
0x015d - OP_Weather
0x015e - OP_Consider
0x016c - OP_Logout
0x0172 - OP_ZoneSpawns
0x0174 - OP_AutoAttack
0x0175 - OP_TargetMouse
0x0187 - OP_AutoAttack2
0x0190 - OP_SwapSpell
0x0193 - OP_YellForHelp
0x0198 - OP_RandomReq
0x01eb - OP_AAAction
0x0199 - OP_SetDataRate
0x01ad - OP_PetCommands
0x01b2 - OP_LFGResponse
0x01bc - OP_ReqZoneObjects
0x01f7 - OP_ItemPLayerPacket
0x0208 - OP_NewSpawn
0x020c - OP_SpecialMesg
0x0219 - OP_WhoAllResponse
0x022b - OP_ZoneEntry
0x0237 - OP_SendZonePoints
0x025e - OP_GuildMemberUpdate
0x0260 - OP_LFGCommand
0x0261 - OP_LFGGetMatchesRequest
0x0262 - OP_LFPCommand
0x0263 - OP_LFPGetMatchesRequest
0x0264 - OP_LFGGetMatchesResponse
0x0265 - OP_LFPGetMatchesResponse
0x0276 - OP_Track
0x0281 - OP_ItemPlayerPacket
0x0282 - OP_SpawnDoor
0x0294 - OP_LoadSpellSet
0x02d0 - OP_ItemPacket


World Opcodes
0259 = Op_SetChatServer
0254 = Op_ZoneServerInfo
0251 = OP_EnterWorld
0241 = OP_SendLoginInfo
01b3 = OP_MOTD
0196 = OP_ApproveWorld
0188 = OP_LogServer
0160 = OP_World_Client_CRC2
015c = OP_World_Client_CRC1
0104 = OP_SendCharInfo
00e3 = OP_ExpansionInfo
005e = OP_GuildList
0018 = OP_AckPacket

Thanks to all who contribute.

Nstalkerga
12-18-2003, 04:17 PM
XML dumb here .. i got .18 up on one box

but the beta box at home ill be trying to figure out what yah said there :)

i know the file ... but know what to do with it is a bit diffrent.

Ill look it over some when i get home, maybe it will click.

thanks for the fast work.

codepig666
12-18-2003, 04:37 PM
blah

I lied about the packets just being shifted. Things are alittle messier than that.

The spawnstruct packet (opcode 0x0208) is bigger and re-arranged a bit, so cleaning it out will be a big help.

some other opcodes:

0x0144 - OP_ZoneChange
0x006c - OP_PlayerProfile
0x022b - OP_ZoneEntry
x00172 - OP_ZoneSpawns

I hate aligning packets, so I'm gonna go play and let someone else figure it out.

--piggy

perlmonkey
12-18-2003, 05:00 PM
Originally posted by codepig666
I hate aligning packets, so I'm gonna go play and let someone else figure it out.
Almost done at work... I have my version of the source all ready to go, and will start dumping packets as soon as I'm home. I imagine some endurance info has been added.

Quark
12-18-2003, 07:15 PM
Below is a mostly working spawnStruct, I'm sure some of the locations are wrong but it generates skittles.

Still havent figured out the changes to playerSpawnPosStruct because that appears to have changed along with manaDecrementStruct.


struct spawnStruct
{
/*000*/ uint8_t NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a
/*001*/ char unknown001[42];
/*043*/ uint8_t class_;
/*044*/ char unknown044[2]; // *** Placeholder
/*046*/ int8_t curHp;
/*047*/ char unknown047[2];
/*049*/ int32_t race; // race
/*053*/ char unknown053;
/*054*/ char name[64]; // name
/*118*/ uint8_t haircolor; // hair color
/*119*/ uint8_t light; // 0=visible,1=invisible
/*120*/ uint8_t invis;
/*121*/ int8_t maxHp; // max hp
/*122*/ uint8_t pvp; // 0=Not pvp,1=pvp
/*123*/ uint8_t level;
/*124*/ uint8_t lfg; // 0=Not lfg,1=lfg
/*125*/ uint16_t heading; // spawn heading
/*127*/ uint8_t deltaHeading; // change in heading
/*128*/ uint8_t animation; // animation id
/*129*/ signed deltaX:13;
signed x:19;
/*133*/ signed y:19;
signed deltaZ:13;
/*137*/ signed deltaY:13;
signed z:19;
/*141*/ char unknown141[10];
/*151*/ float size; // Size
/*155*/ uint8_t helm;
/*156*/ float runspeed; //
/*160*/ uint8_t gm; // 0=not GM,1=GM
/*161*/ float walkspeed; //
/*165*/ uint32_t guildID; // GuildID
/*169*/ uint8_t anon; // 0=normal,1=anon,2=roleplaying
/*170*/ uint8_t gender; // 0=male,1=female,2=other
/*171*/ uint16_t spawnId; // Id of spawn
/*173*/ char unknown173[3];
/*176*/ char lastName[32]; // lastname
/*208*/ int32_t equipment[9];
/*244*/ uint8_t linkdead; // 0=Not LD, 1=LD
/*245*/ uint32_t bodytype; // Bodytype
/*249*/ int16_t deity;
/*251*/ char unknown251[6];
/*257*/ uint32_t petOwnerId;
/*261*/ char unknown261[6];
};

perlmonkey
12-18-2003, 08:59 PM
Am I missing somethiing? I turmed on packet logging for all packets, and I'm not funding ANY of the opcodes shown in the log in the opcode list. In most cases, there's nothing even close. e.g.:

Dec 18 2003 21:34:42:499
Dec 18 2003 21:34:42:589
Dec 18 2003 21:34:43:449
Dec 18 2003 21:34:43:579
Dec 18 2003 21:34:50:639
[OPCode: 0x5102]
Dec 18 2003 21:34:50:779
Dec 18 2003 21:34:52:129
[OPCode: 0xb311]
Dec 18 2003 21:34:52:179
Dec 18 2003 21:34:53:109
[OPCode: 0x5902]
Dec 18 2003 21:34:53:109
[OPCode: 0x5412]
Dec 18 2003 21:34:53:119
[OPCode: 0x0002]
Dec 18 2003 21:34:53:129
[OPCode: 0x9901]
Dec 18 2003 21:34:53:220
[OPCode: 0x56b2]
Dec 18 2003 21:34:53:270
[OPCode: 0x5902]
Dec 18 2003 21:34:53:289
Dec 18 2003 21:34:53:299
[OPCode: 0x5412]
Dec 18 2003 21:34:53:839
[OPCode: 0x2b02]
Dec 18 2003 21:34:53:850
[OPCode: 0x6c31]
Dec 18 2003 21:34:53:939
[OPCode: 0x1318]
Dec 18 2003 21:34:53:949
[OPCode: 0x2020]
Dec 18 2003 21:34:53:949
[OPCode: 0x6c50]
Dec 18 2003 21:34:54:009
Dec 18 2003 21:34:54:089
[OPCode: 0x2b52]
Dec 18 2003 21:34:54:097
[OPCode: 0x1800]
Dec 18 2003 21:34:54:211
[OPCode: 0x7251]
Dec 18 2003 21:34:54:212
Dec 18 2003 21:34:54:249
[OPCode: 0xfeed]
Dec 18 2003 21:34:54:299
Dec 18 2003 21:34:54:369
[OPCode: 0xc95c]
Dec 18 2003 21:34:54:419
Dec 18 2003 21:34:54:479
[OPCode: 0x6abb]
Dec 18 2003 21:34:54:529
Dec 18 2003 21:34:54:609
[OPCode: 0x286b]
Dec 18 2003 21:34:54:659
Dec 18 2003 21:34:54:729
[OPCode: 0xae38]
Dec 18 2003 21:34:54:779
Dec 18 2003 21:34:54:859
[OPCode: 0x0907]
Dec 18 2003 21:34:54:909
Dec 18 2003 21:34:54:979
[OPCode: 0xc324]
Dec 18 2003 21:34:55:029
Dec 18 2003 21:34:55:109
[OPCode: 0xd658]
Dec 18 2003 21:34:55:159
Dec 18 2003 21:34:55:225
[OPCode: 0x7951]
Dec 18 2003 21:34:55:279
Dec 18 2003 21:34:55:352
[OPCode: 0xc9b6]
Dec 18 2003 21:34:55:399
Dec 18 2003 21:34:55:479
[OPCode: 0x9d6f]
Dec 18 2003 21:34:55:569
Dec 18 2003 21:34:55:599
[OPCode: 0x647c]
Dec 18 2003 21:34:55:649
Dec 18 2003 21:34:55:789
[OPCode: 0x5a4d]
Dec 18 2003 21:34:56:047
[OPCode: 0x7251]
Dec 18 2003 21:34:56:047
Dec 18 2003 21:34:56:047
Dec 18 2003 21:34:56:047
[OPCode: 0xd96c]
Dec 18 2003 21:34:56:048
Dec 18 2003 21:34:56:048
[OPCode: 0xb5d1]
Dec 18 2003 21:34:56:129
Dec 18 2003 21:34:56:221
[OPCode: 0xf8b9]
Dec 18 2003 21:34:56:222
Dec 18 2003 21:34:56:279
[OPCode: 0x9b60]
Dec 18 2003 21:34:56:329
Dec 18 2003 21:34:56:402
[OPCode: 0x6d24]
Dec 18 2003 21:34:56:449
Dec 18 2003 21:34:56:539
[OPCode: 0x45a5]
Dec 18 2003 21:34:56:579
Dec 18 2003 21:34:56:649
[OPCode: 0x9c99]
Dec 18 2003 21:34:56:699
Dec 18 2003 21:34:56:793
[OPCode: 0xb530]
Dec 18 2003 21:34:56:829
Dec 18 2003 21:34:56:900
[OPCode: 0xa714]
Dec 18 2003 21:34:56:939
[OPCode: 0x76ba]
Dec 18 2003 21:34:56:949
Dec 18 2003 21:34:57:209
[OPCode: 0x6757]
Dec 18 2003 21:34:57:210
Dec 18 2003 21:34:57:259
[OPCode: 0x83d7]
Dec 18 2003 21:34:57:585
Dec 18 2003 21:34:57:585
[OPCode: 0x7251]
Dec 18 2003 21:34:57:586
Dec 18 2003 21:34:57:586
[OPCode: 0x0152]
Dec 18 2003 21:34:57:587
Dec 18 2003 21:34:57:587
[OPCode: 0x6405]
Dec 18 2003 21:34:57:619
Dec 18 2003 21:34:57:709
[OPCode: 0xd3d4]
Dec 18 2003 21:34:57:759
Dec 18 2003 21:34:57:849
[OPCode: 0x1d2a]
Dec 18 2003 21:34:57:886
Dec 18 2003 21:34:57:959
[OPCode: 0xa7a2]
Dec 18 2003 21:34:58:070
Dec 18 2003 21:34:58:131
[OPCode: 0x09ec]
Dec 18 2003 21:34:58:149
Dec 18 2003 21:34:58:209
[OPCode: 0x93ae]

What am I missing here, are these opcodes that are traditionally ignored? If I could identify which structures were where, I'm sure I could puzzle out the allignment easily enough, figure out what padding is needed, etc..

Zaphod
12-18-2003, 09:44 PM
Originally posted by perlmonkey
Am I missing somethiing? I turmed on packet logging for all packets, and I'm not funding ANY of the opcodes shown in the log in the opcode list. In most cases, there's nothing even close. e.g.:

Dec 18 2003 21:34:42:499
Dec 18 2003 21:34:42:589
Dec 18 2003 21:34:43:449
Dec 18 2003 21:34:43:579
Dec 18 2003 21:34:50:639
[OPCode: 0x5102]
Dec 18 2003 21:34:50:779
Dec 18 2003 21:34:52:129
[OPCode: 0xb311]
Dec 18 2003 21:34:52:179
Dec 18 2003 21:34:53:109
[OPCode: 0x5902]
Dec 18 2003 21:34:53:109
[OPCode: 0x5412]
Dec 18 2003 21:34:53:119
[OPCode: 0x0002]
Dec 18 2003 21:34:53:129
[OPCode: 0x9901]
Dec 18 2003 21:34:53:220
[OPCode: 0x56b2]
Dec 18 2003 21:34:53:270
[OPCode: 0x5902]
Dec 18 2003 21:34:53:289
Dec 18 2003 21:34:53:299
[OPCode: 0x5412]
Dec 18 2003 21:34:53:839
[OPCode: 0x2b02]
Dec 18 2003 21:34:53:850
[OPCode: 0x6c31]
Dec 18 2003 21:34:53:939
[OPCode: 0x1318]
Dec 18 2003 21:34:53:949
[OPCode: 0x2020]
Dec 18 2003 21:34:53:949
[OPCode: 0x6c50]
Dec 18 2003 21:34:54:009
Dec 18 2003 21:34:54:089
[OPCode: 0x2b52]
Dec 18 2003 21:34:54:097
[OPCode: 0x1800]
Dec 18 2003 21:34:54:211
[OPCode: 0x7251]
Dec 18 2003 21:34:54:212
Dec 18 2003 21:34:54:249
[OPCode: 0xfeed]
Dec 18 2003 21:34:54:299
Dec 18 2003 21:34:54:369
[OPCode: 0xc95c]
Dec 18 2003 21:34:54:419
Dec 18 2003 21:34:54:479
[OPCode: 0x6abb]
Dec 18 2003 21:34:54:529
Dec 18 2003 21:34:54:609
[OPCode: 0x286b]
Dec 18 2003 21:34:54:659
Dec 18 2003 21:34:54:729
[OPCode: 0xae38]
Dec 18 2003 21:34:54:779
Dec 18 2003 21:34:54:859
[OPCode: 0x0907]
Dec 18 2003 21:34:54:909
Dec 18 2003 21:34:54:979
[OPCode: 0xc324]
Dec 18 2003 21:34:55:029
Dec 18 2003 21:34:55:109
[OPCode: 0xd658]
Dec 18 2003 21:34:55:159
Dec 18 2003 21:34:55:225
[OPCode: 0x7951]
Dec 18 2003 21:34:55:279
Dec 18 2003 21:34:55:352
[OPCode: 0xc9b6]
Dec 18 2003 21:34:55:399
Dec 18 2003 21:34:55:479
[OPCode: 0x9d6f]
Dec 18 2003 21:34:55:569
Dec 18 2003 21:34:55:599
[OPCode: 0x647c]
Dec 18 2003 21:34:55:649
Dec 18 2003 21:34:55:789
[OPCode: 0x5a4d]
Dec 18 2003 21:34:56:047
[OPCode: 0x7251]
Dec 18 2003 21:34:56:047
Dec 18 2003 21:34:56:047
Dec 18 2003 21:34:56:047
[OPCode: 0xd96c]
Dec 18 2003 21:34:56:048
Dec 18 2003 21:34:56:048
[OPCode: 0xb5d1]
Dec 18 2003 21:34:56:129
Dec 18 2003 21:34:56:221
[OPCode: 0xf8b9]
Dec 18 2003 21:34:56:222
Dec 18 2003 21:34:56:279
[OPCode: 0x9b60]
Dec 18 2003 21:34:56:329
Dec 18 2003 21:34:56:402
[OPCode: 0x6d24]
Dec 18 2003 21:34:56:449
Dec 18 2003 21:34:56:539
[OPCode: 0x45a5]
Dec 18 2003 21:34:56:579
Dec 18 2003 21:34:56:649
[OPCode: 0x9c99]
Dec 18 2003 21:34:56:699
Dec 18 2003 21:34:56:793
[OPCode: 0xb530]
Dec 18 2003 21:34:56:829
Dec 18 2003 21:34:56:900
[OPCode: 0xa714]
Dec 18 2003 21:34:56:939
[OPCode: 0x76ba]
Dec 18 2003 21:34:56:949
Dec 18 2003 21:34:57:209
[OPCode: 0x6757]
Dec 18 2003 21:34:57:210
Dec 18 2003 21:34:57:259
[OPCode: 0x83d7]
Dec 18 2003 21:34:57:585
Dec 18 2003 21:34:57:585
[OPCode: 0x7251]
Dec 18 2003 21:34:57:586
Dec 18 2003 21:34:57:586
[OPCode: 0x0152]
Dec 18 2003 21:34:57:587
Dec 18 2003 21:34:57:587
[OPCode: 0x6405]
Dec 18 2003 21:34:57:619
Dec 18 2003 21:34:57:709
[OPCode: 0xd3d4]
Dec 18 2003 21:34:57:759
Dec 18 2003 21:34:57:849
[OPCode: 0x1d2a]
Dec 18 2003 21:34:57:886
Dec 18 2003 21:34:57:959
[OPCode: 0xa7a2]
Dec 18 2003 21:34:58:070
Dec 18 2003 21:34:58:131
[OPCode: 0x09ec]
Dec 18 2003 21:34:58:149
Dec 18 2003 21:34:58:209
[OPCode: 0x93ae]

What am I missing here, are these opcodes that are traditionally ignored? If I could identify which structures were where, I'm sure I could puzzle out the allignment easily enough, figure out what padding is needed, etc..

You really want to be looking at the zone and world data logs which contain the uncompressed/decrypted/split data and not the all data log which contains the raw compressed/encrypted/combined data.

Enjoy,
Zaphod (dohpaZ)

codepig666
12-18-2003, 09:44 PM
Originally posted by perlmonkey
Am I missing somethiing?

Ya...there are 3 tasks when they do an update (putting asside an actual change in encryption)

1: identify "implicit length" packets
2: assign opcodes to packets
3: correct packet structures.


Task 1 was nicely automated (God bless you, Fester)

Task 2 is a group effort on the part of the community. you have to associate events in the game with the packets they generate. So someone sits in an empty zone and drops 13 pods of water and then looks in the log for 13 packets with the same opcode. chances are that is the opcode for a drop. Everyone has different strategy for workin it out, but people post the ones they find. Eventually Zaphod comes across and munges it all down for us (yay!)

Task 3 is when you line up items in a packet with their actual meaning (Sure its the player packet, but which byte holds your level, etc)

--piggy

codepig666
12-18-2003, 09:47 PM
bleh. had to decouple this one from what had formerly been shared structure elements.

opcode is 0x0028 if anyone hadn't figured that out yet.

/*
** Self Position Update
** Length: 30 Octets
** OpCode: PlayerPosCode
*/

struct playerSelfPosStruct
{
/*0000*/ uint16_t spawnId;
/*0002*/ float z;
/*0006*/ float y;
/*0010*/ float deltaY;
/*0014*/ float x;
/*0018*/ float deltaX;
/*0022*/ float deltaZ;
/*0026*/ unsigned heading:12;
signed deltaHeading:10;
unsigned animation:10;
/*0030*/
};


--piggy

showeqnewb
12-18-2003, 10:31 PM
Hey Code,

Could you help me out here, i am not all here tonight, could you idiot proof walk me through what i need to do.

I am running 5.0.0.2

Thanks in advance from tonights idiot :(

Cryonic
12-18-2003, 10:36 PM
the spawn and player structs are in everquest.h

What used to go into decode.cpp is now held by the xml config file zoneopcodes.xml.

Because the everquest.h file is being changed, this will require a recompile of SEQ.

PhoenixZorn
12-19-2003, 12:23 AM
can someone hop on over to the macroquest IRC room and tell us all when the CVS update is done? =)

Talorn
12-19-2003, 12:28 AM
I was told that there will be another patch tonight so I stopped working on locating opcodes and such. I'll pick back up tomorrow after the patch.

perlmonkey
12-19-2003, 07:18 AM
Zaphod thanks, I did not realize the all packet log was pre-decryption. That explains the migrain I was getting ;-)

Code, yeah I understand the process, I was trying to lend a hand in stage 2, because I need to get my bazaar stuff working again (and my guess is that I'm the only one who will be looking at / caring about the bazaar search structures from my patch).

perlmonkey
12-19-2003, 07:23 AM
The servers are still locked, and I have to go to work. I really wish they could get these patches right on the first try. Don't they realize the seq people are trying to work, here?! And how come Absor never posted on OUR board? Geez, "community" my shiny metallic orb! ;-)

Talorn
12-19-2003, 08:10 AM
OP_ItemPlayerPacket 0x0281
OP_SpawnDoor 0x0282
OP_MoveDoor 0x0129
OP_ShopRequest 0x00f9
OP_Save 0x00f8
OP_ItemPacket 0x02d0
OP_TargetMouse 0x0175
OP_GroundSpawn 0x00fc



I could be wrong on these but i've spent a few hours playing around with them as i hate to post bad info ~

Zaphod
12-19-2003, 09:17 AM
Well, so far it looks like this mornings patch didn't change any of the implicitlen stuff or other opcodes. So opcode collection can continue where it left off...

Enjoy,
Zaphod (dohpaZ)

perlmonkey
12-19-2003, 11:43 AM
0x0063 and 0040 are the most common unknown packets I'm getting, so I'm going to assume they are some kind of player position updates (testing in bazaar).

perlmonkey
12-19-2003, 11:56 AM
[dumb post deleted by me, since my opcodes were decimal (%04u) not hex (%04x)... doh -perlmonkey]

Quark
12-19-2003, 12:29 PM
Fixed spawnStruct.. I had diety and petOwnerId wrong.

struct spawnStruct
{
/*000*/ uint8_t NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a
/*001*/ char unknown001[42];
/*043*/ uint8_t class_;
/*044*/ char unknown044[2]; // *** Placeholder
/*046*/ int8_t curHp;
/*047*/ char unknown047[2];
/*049*/ int32_t race; // race
/*053*/ char unknown053;
/*054*/ char name[64]; // name
/*118*/ uint8_t haircolor; // hair color
/*119*/ uint8_t light; // 0=visible,1=invisible
/*120*/ uint8_t invis;
/*121*/ int8_t maxHp; // max hp
/*122*/ uint8_t pvp; // 0=Not pvp,1=pvp
/*123*/ uint8_t level;
/*124*/ uint8_t lfg; // 0=Not lfg,1=lfg
/*125*/ uint16_t heading; // spawn heading
/*127*/ uint8_t deltaHeading; // change in heading
/*128*/ uint8_t animation; // animation id
/*129*/ signed deltaX:13;
signed x:19;
/*133*/ signed y:19;
signed deltaZ:13;
/*137*/ signed deltaY:13;
signed z:19;
/*141*/ char unknown141[10];
/*151*/ float size; // Size
/*155*/ uint8_t helm;
/*156*/ float runspeed; //
/*160*/ uint8_t gm; // 0=not GM,1=GM
/*161*/ float walkspeed; //
/*165*/ uint32_t guildID; // GuildID
/*169*/ uint8_t anon; // 0=normal,1=anon,2=roleplaying
/*170*/ uint8_t gender; // 0=male,1=female,2=other
/*171*/ uint16_t spawnId; // Id of spawn
/*173*/ char unknown173[3];
/*176*/ char lastName[32]; // lastname
/*208*/ int32_t equipment[9];
/*244*/ uint8_t linkdead; // 0=Not LD, 1=LD
/*245*/ uint32_t bodytype; // Bodytype
/*249*/ char unknown249[5];
/*254*/ uint32_t petOwnerId;
/*258*/ int16_t deity;
/*260*/ char unknown260[7];
};

World Opcodes
0259 = Op_SetChatServer
0254 = Op_ZoneServerInfo
0251 = OP_EnterWorld
0241 = OP_SendLoginInfo
01b3 = OP_MOTD
0196 = OP_ApproveWorld
0188 = OP_LogServer
0160 = OP_World_Client_CRC2
015c = OP_World_Client_CRC1
0104 = OP_SendCharInfo
00e3 = OP_ExpansionInfo
005e = OP_GuildList
0018 = OP_AckPacket

Zone Opcodes (Some of these have already been posted)
00ed = OP_NewZone
006c = OP_PlayerProfile
01eb = OP_AAAction
00e4 = OP_Action2
0199 = OP_SetDataRate
01bc = OP_ReqZoneObjects
007a = OP_ExpUpdate
0237 = OP_SendZonePoints
0087 = OP_PetitionQue
0144 = OP_ZoneChange
0142 = OP_Animation
012e = OP_WearChange
00c1 = OP_BuffFadeMsg
0131 = OP_SpawnAppearance
02d0 = OP_ItemPacket
0018 = OP_AckPacket
0172 = OP_ZoneSpawns
0022 = OP_BeginCast
0027 = OP_TimeofDay
0028 = OP_ClientUpdate
0103 = OP_Actoin
0282 = OP_SpawnDoor
0281 = OP_ItemPlayerPacket
003f = OP_MobUpdate
00ff = OP_ReqClientSpawn
00fc = OP_GroundSpawn
016c = OP_Logout
00f5= OP_DeleteSpawn
015d = OP_Weather

To make charProfileStruct mostly usable these should be the final two lines:

/*4380*/ uint8_t unknown4380[540]; // *** Placeholder
/*4920*/
}

don'tdoit
12-19-2003, 12:30 PM
ok, very new to this, but I think my method is sound at finding the opcodes, but not sure how to verify. I'm monitoring my zone.log and comparing it to zoneopcodes.xml.

0x0175 OP_TargetMouse
0x00fc OP_GroundSpawn
0x0014 OP_Consent
0x00bf OP_CastSpell
0x0020 OP_ItemLinkClick
0x01f7 OP_ItemPLayerPacket
0x008d OP_SetRunMode
0x025e OP_GuildMemberUpdate
0x0025 OP_CommonMessage

As I indicated, this is my first time trying to help with opcodes, so use lube if you must rape me. Definitely needs verification from an experienced person.

Adding more here as I find them (let me know if you'd rather have a new post):
0x0208 OP_NewSpawn
0x0294 OP_LoadSpellSet
0x0057 OP_WhoAllRequest
0x0219 OP_WhoAllResponse

sure hope i'm doing this right:
0x020c OP_SpecialMesg
0x0260 OP_LFGCommand
0x0261 OP_LFGGetMatchesRequest
0x0262 OP_LFPCommand
0x0263 OP_LFPGetMatchesRequest
0x0264 OP_LFGGetMatchesResponse
0x0265 OP_LFPGetMatchesResponse

Quark
12-19-2003, 12:54 PM
0x0107 = OP_Death
0x015e = OP_Consider
0x0276 = OP_Track
0x009d = OP_Hide
0x009e= OP_Sneak

perlmonkey
12-19-2003, 01:05 PM
First off, I want to appologize for any confusion, since the above "hex" numbers are actually decimal ;-)

I've finished patching now to the point that I have moving skittles for myself and mobs, and also my bazaar searches are working again. Attached are just the changes that were posted above, plus the new opcodes I've found.

perlmonkey
12-19-2003, 01:07 PM
Doh! I missed your 3 updates, I'll go add those in to the mix.... damn browser, not doing what I want heh.

perlmonkey
12-19-2003, 01:46 PM
Ok, combining my findings, and everything that I have seen in this thread, I get the attached patch (note: this also contains the bazaar search code and datastructures, it would be cool if that could be added to the code base so that my bazaar patch was just the logging, and not the data changes).

jeff221
12-19-2003, 01:56 PM
I was pretty damn proud of myself when I did a clean install of RedHat and got SEQ fired up on the first attempt, now the patch arrives and f'd it all up a few months later.

My question is simple, where can I find a few links to how one goes about changing these op codes, how to cleanly recompile and get back up and running?

Some links and information to where you geniuses find these opcodes would be nice too. Feed my brain, I'm hungry!

~Jeff


p.s. Oh yeah, also.. what the hell do I do with a *.diff file?!?

perlmonkey
12-19-2003, 02:05 PM
I'm still seeing some broken opcodes after applying the above patch, but we're getting very close. These are the codes I've seen in the last few minutes:

Unknown opcode 0x01c5 len=8
Unknown opcode 0x01c5 len=8
Unknown opcode 0x01c5 len=8
Unknown opcode 0x01e7 len=8
Unknown opcode 0x01e7 len=8
Unknown opcode 0x01c5 len=8
Unknown opcode 0x0208 len=267
Unknown opcode 0x01c5 len=8
Unknown opcode 0x01c5 len=8
Unknown opcode 0x0208 len=267
Unknown opcode 0x0208 len=267
Unknown opcode 0x01c5 len=8

Jeff, I'm sorry but those of us working on getting seq working again are kind of busy. Any intro to Unix tools should discuss the use of patch to apply diffs, and grep is a great tool for finding what file something is in. As for how we (and I say 'we' loosly, since I'm an outsider here) find opcodes and such, it's all guesswork based on the data we have available to us: network packets, patch messages from SOE (which might hint at what changed), the EQ files (which contain many things, of course).

perlmonkey
12-19-2003, 02:20 PM
About 0x0208.... the data for those packets always has two names in it, and 208 is not far from 1f0, so my guess is that 0x208 is actually TraderShop. Anyone think that sounds wrong?

don'tdoit
12-19-2003, 02:25 PM
0x0193 OP_YellForHelp
0x01ad OP_PetCommands
0x01b2 OP_LFGResponse
0x0198 OP_RandomReq
0x0088 OP_RandomReply
0x0190 OP_SwapSpell
0x0187 OP_AutoAttack2
0x0174 OP_AutoAttack

perlmonkey
12-19-2003, 02:26 PM
We just got a serverwide ad for the new server, so I can happily report that 0x01da is the op for serverwide message, and the data, which is 200 bytes long has a leading data header of 12 bytes followed by the text, which is null-padded at the end.

Heh, finally a broadcast ad was good for something.

Teh_Ish
12-19-2003, 06:02 PM
Anyone get this working with SEQ5? I've put in all the numbers but my position isn't working, and I'm still getting massive spam in my console

I updated the structs, as well.

Specific problems are..

OP_ClientUpdate (0x28) (dataLen: 30) doesn't match: sizeof(playerSelfPosStruct):36

and

Warning: error on zone-client: size > left (size=76, left=23, opcode=0x003f)

Codepig: Are you sure on that selfPosStruct? That's 36 total, should only be 30 from the data I"m getting..

UnGod
12-19-2003, 06:43 PM
Well first off, your missing whats in the first post of this thread, and the title of it.

Belith/UnGoD

Teh_Ish
12-19-2003, 06:59 PM
Originally posted by UnGod
Well first off, your missing whats in the first post of this thread, and the title of it.

Belith/UnGoD

Mind being a bit more specific? I'm getting hit with "size > left" spam constantly, and I can't figure out why. I've put in all the changes, and it's not working. Hence I'm here, asking for help. Simple, no?

Zaphod
12-19-2003, 07:01 PM
Originally posted by Teh_Ish
Mind being a bit more specific? I'm getting hit with "size > left" spam constantly, and I can't figure out why. I've put in all the changes, and it's not working. Hence I'm here, asking for help. Simple, no?

I'd say ShowEQ 5 is about 2-4 opcodes from being committed to CVS...

Enjoy,
Zaphod (dohpaZ)

perlmonkey
12-19-2003, 07:41 PM
I don't know where my head is today... duh. 0x0208 is NewSpawn, which btw makes things much more usable... see attached, up-to-date patch that has a few changes from the last one, and is the last I'll do until I make some struct progress.

I'll post the needed Bazaar patch to the relevant thread later.

makeitworknow
12-19-2003, 07:46 PM
Ok, I downloaded a fresh CVS of .18 and applied the second .diff patch. Using RH 8.0, was not able to get SEQ working, and had a couple of questions.

I saw that under the SEQ beta 5 that it said SEQ must be compiled with QT 3.1. Is that only for the 5 beta or is that also for the .18 version also? Currently using QT 3.0.5 to compile the .18 version.

Can anyone verify that a fresh CVS of .18 plus the second .diff patch listed here works?

I am able to ping my EQ box from my SEQ box. Got no errors during compile process, however it appeared that SEQ was not recognizing or picking up the traffic. Tried logging in and out, zoning, and no joy...no maps, no skittles, no nada. No errors in the logs that I can find....SEQ appears to start up normally but still not picking up the data. I've got the IP address of the EQ box in the Network config, and verified correct. I'm using the same equipment network wise that I was using before the patch and SEQ ran fine then. In the process of recompiling from scratch again to make sure everything went ok, but I wanted to make sure I wasn't jacking up something obvious here.


And DOH new patch!

Never mind. Second shot at it with the new patch worked like a champ.

Zaphod
12-19-2003, 07:46 PM
Originally posted by perlmonkey
I don't know where my head is today... duh. 0x0208 is NewSpawn, which btw makes things much more usable... see attached, up-to-date patch that has a few changes from the last one, and is the last I'll do until I make some struct progress.

I'll post the needed Bazaar patch to the relevant thread later.

What other structs are you having difficulty with?

Thanks and Enjoy,
Zaphod (dohpaZ)

P.S. Maybe you could pop onto the IRC and we can talk about what you are seeing.

Hobo
12-19-2003, 08:09 PM
Did a little searching since it's been a long time since I've done any kind of patch to my SEQ. Can someone confirm that this is the proper way to apply Perlmonkey's patch?

1) Save the patch file to /seq

2) cd seq

3) patch < seq2003121904.diff

3) rm *.o

4) cd ..

5) make

6) make install


Or do I need a ./configure before I make and make install?


Thanks,

Hobo

perlmonkey
12-19-2003, 08:31 PM
You should not HAVE to remove any object files OR configure, but it will not hurt. make should Do The Right Thing.

Hobo
12-19-2003, 08:41 PM
Thanks much for the quick reply. Once it again I am a living example that the SEARCH feature works! =P

Zaphod
12-19-2003, 08:55 PM
Just an FYI, I believe I've got all the necessary opcodes and structure changes for ShowEQ and will be doing a new release of ShowEQ 5 in the next couple hours.

I'll probably get around to 4.3.x sometime tommorrow as long as noone pisses me off. Certain individuals have been pushing my patience in the Help forums with their whining. So, we'll see.

Enjoy,
Zaphod (dohpaZ)

ieatacid
12-19-2003, 09:05 PM
I'm just happy I got it working again by reverting back to the pre-beta build. Thanks again for the great work guys!


Anxiously awaiting the working beta version,

- ieatacid

Hobo
12-19-2003, 09:14 PM
Zaph, not to suck up or anything but most of us truly appreciate the efforts you and the rest of the "brains" around here put into SEQ.


Thanks.



Now a comment. Ran the patch or Perlmonkey's and it sort of works for me. When I zone the map loads properly for a few seconds and then just about the time the spawns come up the map shrinks to a tiny, tiny little size. I can zoom in x32 and it's still smaller than normal. Spawns are shown off the map with long strange white lines spewing out from them. SEQ then crashes with a seg fault.

Looking back through the data I can see multiple error messages like this:

WARNING: Op_ClientUpdate (0028) (dataLen: XXX != sizeof(playerSpawnPosStruct):18 or sizeof(playerSpawnSelfStruct) :30)

Note the "XXX" in the above warning is a number that varies from message to message.


I also see an error message that says:

error on zone-client: size > left (size=57, left=52, opcode=0x0028)


I don't know if any of this info is of help to you guys or not, but thought I'd post it anyway.


I should note that this is using the non-beta version 4.xx.xx


Hobo

Teh_Ish
12-19-2003, 10:33 PM
edit

Hobo
12-19-2003, 10:46 PM
nm

Elyon
12-20-2003, 12:31 AM
Zaphod, Please try to ignore those that tend to piss you off. We want you to know that we CERTAINLY DO APPRECIATE all the HARD WORK you put into this Project.... I wish I could contribute more, but I do not posses the Skillz to do it.....

Thanks again and Have a GREAT HOLIDAY !!!!!

BlueAdept
12-20-2003, 01:22 AM
Hey Zaphod, dont let anyone get on your nerves. I almost left the boards because of a poster. I had even put up a poll asking if I should leave.

Ive relegated myself to the fact that there are some idiots that visit here from time to time. Eventually they get bored when they are done stirring up trouble and leave. Dont let it get to you. 99.9% of the people here really respect you and your work.

If you let things get to you on here, you will end up like this guy.

http://home.planet.nl/~roverdriver/2429.jpg

MotleyC
12-20-2003, 10:37 AM
This is the 1st time I have had to patch as I am a new SEQ user. Here is what I did but it still doesn't seem to be working. Please tell me if I did something wrong.

1) I put the latest patch in the /showeq/src folder
2) I patched the files via "patch < seq2003121904.diff"
3) cd ..
4) make
5) make install

I had no errors at any point but when I run showeq it does not display the map or any information. Did I miss a step?

perlmonkey
12-20-2003, 10:50 AM
I am getting some map resizing artifacts too... I'll see if I can track it down. No promises.

uRit1u2CBBA=
12-20-2003, 11:09 AM
use patch -p0 < {file} and don't forget to do a new make -f Makefile.dist && ./configure

Frank25
12-20-2003, 12:48 PM
When i apply the latest diff with patch it gives me a lot of
"Hunk #XX FAILED at XXX"
and tells me the rejects were saved to file.rej.

Does this mean the patch failed? or is this normal?
I dont hve to much experience with patching files by hand )

Sneaky
12-20-2003, 02:12 PM
I applied the patch and recomplied but still no display and I segfault. Guess I will wait for teh real fix...thanks for trying

perlmonkey
12-22-2003, 03:33 PM
It looks like CVS has been updated, so you should probably ignore this patch now....

lildr00d
12-28-2003, 01:05 PM
Not sure if the opcodes are wrong or SEQ just intercepting then bad. SEQ works Im getting skittles and updates. I don't see any ''unknown'' on the map so unsure if thats related


Im seeing alot of:

unknown [server->client] [side 76] [opcode 0x025e]
*Guildmember name* -----------trash
*Guildmember name* -----------more trash
-----------even more trash

025e is listed as Guildmember update and that seems fitting since I get this message when one of them zones in and out.

getting same message when I loot my corpse seems opcode is right cause its saying 0x0141


Breakdown of opcodes giveing unknown so far. Hard to see as they scroll by so fast

262
25e -size 75
12a -size 2
141 -size 16
1a9
16a -size 8


sorry I dont have more data. Just started writeing all this down on a raid.. ;-)