[Guide] Extracting Parsed Packets in Silkroad

09/03/2009 22:21 fanste#46
I have still the same errors also after the client update today (it was a new installation). But it works here most of the time with an seperated dll injector. We will see if Drew is able to improve his logic a bit or it has really only to do with my PC...
09/07/2009 23:35 pushedx#47
Quote:
Originally Posted by fanste View Post
I have still the same errors also after the client update today (it was a new installation). But it works here most of the time with an seperated dll injector. We will see if Drew is able to improve his logic a bit or it has really only to do with my PC...
Can you please try using the attached project to see if it works now or not? I've updated it to the latest version of ISRO, so it won't work on anything else.

I found some bugs in my gui based analyzer, but non so much in my console version you have been using. So, I've made a few compiler changes for the project and moved a few things around.

If you spawn in a crowded town, the client will freeze a little as the console I/O is really cpu intensive, but you should not actually crash. If possible, can you move your char to Jan/HT spawn and relogin to test that assuming it doesn't crash on the character select.

[Only registered and activated users can see links. Click Here To Register...]
09/08/2009 04:08 soadmania#48
Quote:
Originally Posted by pushedx View Post
Can you please try using the attached project to see if it works now or not? I've updated it to the latest version of ISRO, so it won't work on anything else.

I found some bugs in my gui based analyzer, but non so much in my console version you have been using. So, I've made a few compiler changes for the project and moved a few things around.

If you spawn in a crowded town, the client will freeze a little as the console I/O is really cpu intensive, but you should not actually crash. If possible, can you move your char to Jan/HT spawn and relogin to test that assuming it doesn't crash on the character select.

[Only registered and activated users can see links. Click Here To Register...]
tested on jangan and works great, no crashes. but i cant see the S->C opdoces. its always [0].
can u share the new code? i think i can solve this S->C [0] problem :p
09/08/2009 13:18 pushedx#49
Quote:
Originally Posted by soadmania View Post
tested on jangan and works great, no crashes. but i cant see the S->C opdoces. its always [0].
can u share the new code? i think i can solve this S->C [0] problem :p
Oops, sorry. I accidentally deleted that code and didn't notice that. It's readded now and should show it.

Anyways, here's an update:

The source code is about the same. All I did was:
* Remove static arrays from functions into global namespace
* Added pushfd/popfd alongside pushad/popad
* Still used the original ASM patch rather than my updated one

The compiler changes I did was:
* Runtime Library: Multi-threaded (/MT) [C/C++->Code Generation->Runtime Library]
* Stack Reserve Size: 8000000 [Linker->System->Stack Reserve Size] [for my gui version, not needed for the console version]

Attached is the project. Can you and fanste retest again? I have a bit of rewriting to do on my GUI version, so that won't be ready for a bit.
09/09/2009 03:12 soadmania#50
Quote:
Originally Posted by pushedx View Post
Attached is the project. Can you and fanste retest again? I have a bit of rewriting to do on my GUI version, so that won't be ready for a bit.
trying to login now. its harder than c++ :D
09/09/2009 14:18 soadmania#51
Quote:
Originally Posted by pushedx View Post
Oops, sorry. I accidentally deleted that code and didn't notice that. It's readded now and should show it.

Anyways, here's an update:

The source code is about the same. All I did was:
* Remove static arrays from functions into global namespace
* Added pushfd/popfd alongside pushad/popad
* Still used the original ASM patch rather than my updated one

The compiler changes I did was:
* Runtime Library: Multi-threaded (/MT) [C/C++->Code Generation->Runtime Library]
* Stack Reserve Size: 8000000 [Linker->System->Stack Reserve Size] [for my gui version, not needed for the console version]

Attached is the project. Can you and fanste retest again? I have a bit of rewriting to do on my GUI version, so that won't be ready for a bit.
Tested on hotan. there was a goldbot hunt so it froze about 1 min. im still online with that loader. no crashes but freezes sometimes. probably because of debug console.
09/09/2009 14:52 pushedx#52
Quote:
Originally Posted by soadmania View Post
Tested on hotan. there was a goldbot hunt so it froze about 1 min. im still online with that loader. no crashes but freezes sometimes. probably because of debug console.
Awesome, thanks for testing. :) That's expected and the game is not really playable with the debug console since the console output eats up so much CPU time. However, as long as you had no crashes it means the fixes worked.

There must have been a gold bot problem on Gaia when I did some testing earlier because I got a group spawn packet that had 153 players in it for one region and that caused my Gui analyzer to self destruct. I traced the problem down to my underestimating how large the group spawn can be (in theory, it can be humongous!). I need to move the object allocation to the heap since the object size is 917,491 bytes currently and I probably should make it even larger.

I also noticed another really weird bug in my code before the fix yesterday as well. Everything I logged on, it'd get the "this client is an invalid Silkroad version" message at the character select. That didn't make any sense because that error is packet based, so that would mean I was corrupting the packets as I processed them somehow. That was exactly what was happening and why you and fanste probably crashed after character selection. Somewhere in the code, a loop was being executed whose condition was being changed since I wasn't using pushfd/popfd, so it messed up how the packet was parsed.

I think the new changes take care of all these things, so I'm excited I know what the problem was and can move on with the rest of the project. I will still need to get more people to test the final version to make sure I got everything, but at least now I understand the extra things I have to take into consideration.
09/09/2009 15:55 fanste#53
Sorry, that i didn't reply that fast... I forgot to look into this topic :(

I'm not able to test it for isro, but tsro works also perfect with the last release. I have only some lags (when i move it needs up to 5sec until i see it in the client), but thats absolutly OK. Nice work!! :))

The problem with the changed packets did i also metioned some posts ago until i undid some changes you made. I will look if im able to include the GUI without causing a crash again, cuz its much more comfortable :) (copy & paste for example^^)
09/19/2009 01:12 illstar#54
Can someone provide me a updated version of the edxanalyzer (V1.213)
09/19/2009 02:09 soadmania#55
DLL.h
Quote:
#pragma once

// Bin: 33 C0 89 46 10 89 46 14 C7 46 08 00 00 00 00 C7 46 04 00 00 00 00 8B C6 5E C2 04 00 CC
// First line in function
#define CC_ExtractSentPacket_Address 0x5376D0

// 56 57 8D 9B 00 00 00 00 8B 73 08 81 E6 FF 0F 00 80 8B FD
// MOV EBX,ECX
// MOV DWORD PTR SS:[ESP+10],EAX
#define CC_ExtractSentPacket_Address_1 0x504E3C

// 64 A1 00 00 00 00 50 B8 08 10 00 00
// MOV EAX, 1008
#define CC_ExtractSentPacket_Address_2 0x775B4E

//00A95CAD 8B 42 18 53 FF D0 83 F8 01
// PUSH EBX
// CALL EAX
// CMP EAX,1
#define CC_ExtractPacket_Address_1 0xA95CF0

// End of ReadBytes function
// POP ESI
// MOV EAX,EBX
// POP EBX
// RETN 8
#define CC_ExtractPacket_Address_2 0x4F321C
09/20/2009 17:18 asdfg11#56
Thanks pushedx,

altough i do not know asm,only c++ this tutorial is very usefull.

I have a question, how can i find the x , y coord or the data for movement (c->s)

so .. opcode (xx) (xx) (?? ??) , this Word i don't know where to get or how it's processed,

from a call 008E68D0

FLDCW WORD PTR SS:[ESP+1C] this has 0C7F ??? what's this?
FISTP DWORD PTR SS:[ESP+1C] <- conversion to hex
MOV CX,WORD PTR SS:[ESP+1C] ..

How is this data processed?where?
Do i have to look further?where?

thanks for your time.
10/18/2009 21:55 drake3498#57
yall should next start to patch and make it work with isro next.
07/05/2010 13:39 konserwa#58
some one can make Video how find this functions ?
07/11/2010 13:35 jack11111#59
Nice Guide. Thx.
09/09/2010 23:05 MagiCircle#60
Hello,

i tried this with rSro but my client allways crashs after my character spawned...

I tried this code:

Quote:
#pragma once

// Bin: 33 C0 89 46 10 89 46 14 C7 46 08 00 00 00 00 C7 46 04 00 00 00 00 8B C6 5E C2 04 00 CC
// First line in function
#define CC_ExtractSentPacket_Address 0x539A30

// 56 57 8D 9B 00 00 00 00 8B 73 08 81 E6 FF 0F 00 80 8B FD
// MOV EBX,ECX
// MOV DWORD PTR SS:[ESP+10],EAX
#define CC_ExtractSentPacket_Address_1 0x506C2C

// 64 A1 00 00 00 00 50 B8 08 10 00 00
// MOV EAX, 1008
#define CC_ExtractSentPacket_Address_2 0x7E4B9E

// PUSH EBX
// CALL EAX
// CMP EAX,1
#define CC_ExtractPacket_Address_1 0xB17670

// End of ReadBytes function
// POP ESI
// MOV EAX,EBX
// POP EBX
// RETN 8
#define CC_ExtractPacket_Address_2 0x4F4F4C
any idea?

€: Ah, ok...i saw lot of ppl got this problem^^ I tried it with the Solution1.zip Project, but its not working >.>