PDA

View Full Version : OpCodes, Patch 02/13/2007



QuietWolfe
02-14-2007, 09:14 PM
I am a novice user.

After reading and reading and searching, I read the threads about OpCodes and Structs.

I think I found an opcode using the methods described here;
http://www.showeq.net/forums/showthread.php?t=5314&highlight=Finding+Opcodes


However. I was looking for OP_ZoneEntry and found when I zoned, back and forth, that opcode 0x41a9 was frequent. checking and changing that opcode in zoneopcodes.xml and getting these messages now in the console.


Warning: OP_ZoneEntry (0x41a9) (dataLen: 18) doesn't match: sizeof(ClientZoneEntryStruct):68
Warning: OP_ZoneEntry (0x41a9) (dataLen: 18) doesn't match: sizeof(ClientZoneEntryStruct):68
Warning: OP_ZoneEntry (0x41a9) (dataLen: 18) doesn't match: sizeof(ClientZoneEntryStruct):68
Warning: OP_ZoneEntry (0x41a9) (dataLen: 18) doesn't match: sizeof(ClientZoneEntryStruct):68
Warning: OP_ZoneEntry (0x41a9) (dataLen: 18) doesn't match: sizeof(ClientZoneEntryStruct):68
Great! so, I might have found the opcode for ZoneEntry.. now what?

I looked in everquest.h, because that is where it said I needed to change the size and then do a recompile..

So, I find the section that is labeled 'struct ClientZoneEntryStruct'

And read on down.

If the size is 68, but it doesnt match... what exactly do I change in that struct in order to get the size to match?

Be easy.. I am a first timer at trying to figure out OpCodes and Structs.

purple
02-14-2007, 09:58 PM
18 to 68 is too big of a change more than likely. Feeling out what is getting removed/added/moved around in structs is kinda an experience thing. It helps a lot if the struct isn't mostly unknown.

OP_ZoneEntry is twice on zoning. The easiest way to find it is to find the ServerZoneEntryStruct which is just a spawnStruct for you. This should be obvious since it has your char name in it. Then find the opcode for that packet and now you have the opcode for ZoneEntry.

BlueAdept
02-14-2007, 10:09 PM
Looks pretty borked to me. At least the encryption didnt change. But it is beyond my limited capabilities. But hopefully most of it is just minor struct changes. Im sure several of the things are impacting it, like guild banners, new equipment slot and such.

Shame, in beta it pretty much worked ok.

purple
02-14-2007, 10:17 PM
It's not that hugely off. If you know how to pull from svn, Z has stuff semi-put back together. I should have more time tomorrow evening to look at things.

QuietWolfe
02-15-2007, 07:11 AM
easiest way to find it is to find the ServerZoneEntryStruct which is just a spawnStruct for you.

Right. I saw my charname show just in the unknown and zone logs/. I located the one thing that gave me the what zone I was in. Even if I have the wrong opcode, which it looks as though I have the wrong opcode. Once I find the correct opcode, where in everquest.h do I change the size?

Some1Else
02-15-2007, 08:41 AM
It isn't so much that you are changing the size of the struct directly. What you really need to do is one of the following:

Change the size of a variable from int to long, or char(xx) to a longer character string size, or whatever is required.
Add a variable to the struct to account for new, additional information.
Delete a variable from the struct for information no longer included in the struct.
Multiple items from above.
There are probably other things that can be done, but in my limited programming experience, these are not going to be straight-forward changes. It isn't as simple as changing the size of the struct from 18 to 68 or something. There definitely will be some changes or additions made, but figuring out which ones to change is going to be easier for those with experience.

EDIT: Don't let that stop you from hunting for the OP_CODES, as that will help get things running sooner. The codes need to be identified as well.

purple
02-15-2007, 10:54 AM
In the zoneopcodes.xml file, the opcode is mapped to a struct (if payload is configured for that opcode). These structs are in everquest.h. You just edit the struct so that its size is appropriate by either removing stuff that was removed, adding stuff that was added (or adding unknowns to pad out the new stuff), or moving stuff around when structs change.

Again, messing with structs is a lot of experience. It's daunting at first, but once you're used to what a spawnStruct or what not looks like, it gets a lot easier.

QuietWolfe
02-15-2007, 12:14 PM
Okay.. that really does help a huge amount. What I think I will do, is first try to ID the OpCodes that I can.

Then, list those as possibles.

After I do that, then check the code for size diffs and make adjustments based on the values in the struct, what seq is looking for, and what actually is represented in the logs.

I might just stick with locating the opcodes, and perhaps others will have a better chance at finding what moved or was removed.

Here are a couple of things I noticed in the zones.


struct added for Guild Banners
struct added for Fellowship Campfires
struct added for (what I believe is GuildHall to GuildBanner linkage)
struct added for charProfileStruct (looks like some new inventory/item slot)
I checked against everquest.h, and several things may need to be "added" to the header. I will have to re-run my logs and check them over several hours, but It looks like they not only added some new features but re-arranged alot of the locations within the struct for charProfileStruct.

Could that be why I MIGHT have the right opcode for ZoneEntry, but the size is so off? That alot has been moved around within eqgame.exe instead of just adding new stuff?

Also. purple, you mentioned decompiling the .exe. I know you said that it is easier, but wouldn't that entail that you have the previous .exe and then compare between the new and old decompile?

I just did that.. and boy.. that smacked me in the noggin...... I actually think one of my braincells started a riot...

I have headache now.. I think I'll douse them with some Capn' Morgans.........

purple
02-15-2007, 12:38 PM
I don't dissassemble the exe much. I'm not smart enough to do that. I wish I were. I've tried it, but I'm not good at by any means. All I use to do opcodes/structs are the zone log and world log that seq makes.

Your point that having old/new helps immensely is very true. That's the only reason I can do opcodes so quickly. I have logs built up (from turning on seq's zone and world logs) from each patch for the past long time and I grep over these for examples of packets. If you're truly interested in learning how to identify things in the network stream, I'd highly recommend turning on zone logging for 30 minutes or an hour or so after the new seq release comes out (if you do it now, the opcodes won't be named in the log file) and save the files off.

This will form the start of your reference library of what packets for specific opcodes looks like. Then next time, you'll have something to use to answer the question "what the hell did my spawnStruct used to look like" or "what kind of things did OP_Animation send".

BlueAdept
02-15-2007, 07:55 PM
It's not that hugely off. If you know how to pull from svn, Z has stuff semi-put back together. I should have more time tomorrow evening to look at things.

Heh every time I tried changing the struct it kept messing other stuff. I doubt I will ever be able to do what you guys do.

The files from the svn seem to work pretty good. Thanks for the suggestion.

QuietWolfe
02-15-2007, 09:48 PM
I am spending the time and downloading the svn. yes yes.. ALL of it. lol.
I went in and low and behold.
everquest.h , races, staticspells and zones,

Will be easier to sort through the opcodes and stuff now.

I have learned so much about it over the last few days, that I might actually be able to help in a few months.. LOL