Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 20:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Guide] Handling Client Networking @ Any State Process

Discussion on [Guide] Handling Client Networking @ Any State Process within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2017
Posts: 1,012
Received Thanks: 716
Lightbulb [Guide] Handling Client Networking @ Any State Process

Hey there,

I've been hella busy lately, some guy asked me about handling messages in client-side like a week ago, I told 'em I'll make a guide and I totally got busy & forgot.

Anyways, lets get into this.




Note: Structures don't really have to be 100% correct, that's just analyzing & guesses.

How To Hook State Process: Since OnPacketRecv is a virtual function, its a different function with a different address per state process.

The main place where OnPacketRecv is called should be at:
Code:
00BA8FB1 | FF D0                  | call eax                                         | OnPacketRecv
So basically, you can set a breakpoint there in different state processes & get the address of the function.

For example, I want the address of CPSTitle::OnPacketRecv, so I set a breakpoint on that address above during login section, when the breakpoint hits, get the value of EAX, thats your function address.

I made an example as for CPSMission, which handles msgs after selecting your character.




Code:
replaceAddr(0x00DD440C, addr_from_this(&CPSMission::OnPacketRecv));
And that's all.

Note: If you're planning to use ReadStringA or ReadStringW functions, you need to ensure you're using VC80 compiler, AKA Visual Studio 2005.

Special thanks to: florian0
#HB is offline  
Thanks
10 Users
Old 11/30/2019, 10:48   #2
 
elite*gold: 0
Join Date: Apr 2016
Posts: 264
Received Thanks: 58
Thank's #HB.
florian everywhere :v super thank's
hoangphan7 is offline  
Old 11/30/2019, 17:30   #3
 
elite*gold: 0
Join Date: Oct 2019
Posts: 12
Received Thanks: 3
Quote:
Originally Posted by #HB View Post
Sure, I'll check my old projects & release it as soon as I have some free time.
we also expect this
Frukio92 is offline  
Old 01/06/2020, 09:16   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 202
Received Thanks: 86
Please add an example
concucu is offline  
Old 01/07/2020, 12:51   #5
 
elite*gold: 0
Join Date: Sep 2017
Posts: 1,012
Received Thanks: 716
Quote:
Originally Posted by concucu View Post
Please add an example
mmm

Quote:
Originally Posted by #HB View Post
I made an example as for CPSMission, which handles msgs after selecting your character.



#HB is offline  
Old 01/25/2020, 22:48   #6
 
elite*gold: 0
Join Date: Jan 2020
Posts: 36
Received Thanks: 4
Cannot access pastebin extensions
Empire1453 is offline  
Old 01/30/2020, 03:56   #7
 
elite*gold: 0
Join Date: Sep 2017
Posts: 1,012
Received Thanks: 716
Quote:
Originally Posted by hoangphan7 View Post
But how can i send / receiver custom packet like 0x8888 ?
Everything is explained in example's comments.
Code:
Returning 1 means packet is accepted & read, 0 means fail & afair client may crash if
you do return 0.

Also, if you're planning to read original packets, set TotalReadBytes to 0 after you
finish reading, because sro_client will re-read this stuff and if any byte were read before,
it'll crash because it attempts to read over max bytes limit.
#HB is offline  
Old 06/12/2020, 12:16   #8
 
elite*gold: 0
Join Date: May 2020
Posts: 37
Received Thanks: 1
Hi Brother!
I want to read packet C->S (Client to Server. like 0x7074 7045 ...). How can i do it?
Your CPSMission only have read packet receiver from Server (S->C)
Thank's you ^^
WolfgangNeverDie is offline  
Old 06/12/2020, 13:38   #9
 
elite*gold: 0
Join Date: Sep 2017
Posts: 1,012
Received Thanks: 716
Quote:
Originally Posted by WolfgangNeverDie View Post
Hi Brother!
I want to read packet C->S (Client to Server. like 0x7074 7045 ...). How can i do it?
Your CPSMission only have read packet receiver from Server (S->C)
Thank's you ^^
Hey,

Well, actually client only receives server messages and server can only receive client messages, otherwise it won't make any sense.

If you really wanna handle client messages sent from client, you can hook SendMsg(CMsgStreamBuffer*) and do so. But I don't recommend doing such a thing as its not safe at all, and you'll need more things to do than just hooking that function.

If you wanna modify the structure of some message, I suggest you to go to the place where it gets written and sent in the client and modify it, that'd be much cleaner, safer and less processing.
#HB is offline  
Thanks
2 Users
Old 06/12/2020, 14:07   #10
 
elite*gold: 0
Join Date: May 2020
Posts: 37
Received Thanks: 1
Quote:
Originally Posted by #HB View Post
Hey,

Well, actually client only receives server messages and server can only receive client messages, otherwise it won't make any sense.

If you really wanna handle client messages sent from client, you can hook SendMsg(CMsgStreamBuffer*) and do so. But I don't recommend doing such a thing as its not safe at all, and you'll need more things to do than just hooking that function.

If you wanna modify the structure of some message, I suggest you to go to the place where it gets written and sent in the client and modify it, that'd be much cleaner, safer and less processing.

Yeah. Thank's you
WolfgangNeverDie is offline  
Old 06/15/2020, 23:24   #11
 
elite*gold: 266
Join Date: Apr 2009
Posts: 2,306
Received Thanks: 2,568
Quote:
Originally Posted by WolfgangNeverDie View Post
Hi Brother!
I want to read packet C->S (Client to Server. like 0x7074 7045 ...). How can i do it?
Your CPSMission only have read packet receiver from Server (S->C)
Thank's you ^^
you can hook: 0x008418D0
the first arg pushed into the stack is a CMsgStreamBuffer*.
sarkoplata is offline  
Old 06/16/2020, 15:13   #12
 
elite*gold: 0
Join Date: May 2018
Posts: 244
Received Thanks: 115
Quote:
Originally Posted by sarkoplata View Post
you can hook: 0x008418D0
the first arg pushed into the stack is a CMsgStreamBuffer*.
btw we can prevent a c->s packet ?
Hercules* is offline  
Old 06/16/2020, 15:18   #13
 
elite*gold: 266
Join Date: Apr 2009
Posts: 2,306
Received Thanks: 2,568
yes you can.
sarkoplata is offline  
Old 06/16/2020, 18:44   #14
 
elite*gold: 0
Join Date: May 2020
Posts: 37
Received Thanks: 1
Quote:
Originally Posted by sarkoplata View Post
you can hook: 0x008418D0
the first arg pushed into the stack is a CMsgStreamBuffer*.
No. i want to handle packet send from client. (like cancel some function ..)
WolfgangNeverDie is offline  
Old 07/01/2020, 16:23   #15
 
elite*gold: 266
Join Date: Apr 2009
Posts: 2,306
Received Thanks: 2,568
Quote:
Originally Posted by WolfgangNeverDie View Post
No. i want to handle packet send from client. (like cancel some function ..)
yes you can with the addr I gave above.
sarkoplata is offline  
Reply


Similar Threads Similar Threads
Any legit networking site here ?
12/13/2017 - Cryptocurrencies - 1 Replies
Permision to post admin im just asking here if they got legit networking site TIA
Mit Process Explorer /Process Hacker Hs umgehen
05/22/2010 - General Gaming Discussion - 1 Replies
Ich habe hier im Forum gelesen, das man mit Process Explorer bzw. Process Hacker das HS umgehen kann. Leider ist mir irgendwie schleierhaft wie das gehen soll. Vllt erbarmt sich jemand und erklärt es (:, da man den sogenannten Bypasser nur noch las Premium Dings Da bei Upload.to runterladen kann :rolleyes:
C# how to pause a process/freeze process
12/08/2008 - CO2 Programming - 2 Replies
ya so i was semi bored and after little bit of looking around i didnt find to many examples of how to do this so attached is a demo project to show you how. basically it comes down to calling ResumeThread() and SuspendThread() (API functions) on all the threads of a process...simple enough http://img388.imageshack.us/img388/9762/exampleil 6.png please note when you enter the process name there's no ".exe" to the end Warning: this isn't idiot proof . .



All times are GMT +1. The time now is 20:50.


Powered by vBulletin®
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2021 elitepvpers All Rights Reserved.