Register for your free account! | Forgot your password?

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

  • 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 07/28/2020, 17:11   #16
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by #HB View Post
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
I have included it in sro_dev but it shows nothing
Can you guide how to help it work. I really need it
thaidu0ngpr0 is offline  
Old 07/28/2020, 19:09   #17
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
Quote:
Originally Posted by thaidu0ngpr0 View Post
I have included it in sro_dev but it shows nothing
Can you guide how to help it work. I really need it
hello again

this can help you


Laag#82 is offline  
Old 07/28/2020, 23:03   #18
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Modification:-
-Fixed few bugs with string functions at CMsgStreamBuffer and updated code to be more readable.

Quote:
Originally Posted by thaidu0ngpr0 View Post
I have included it in sro_dev but it shows nothing
Can you guide how to help it work. I really need it
What do you mean it shows nothing?
#HB is offline  
Old 08/02/2020, 23:13   #19
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by #HB View Post
Modification:-
-Fixed few bugs with string functions at CMsgStreamBuffer and updated code to be more readable.



What do you mean it shows nothing?

How can I combine it with sro_devkit
thaidu0ngpr0 is offline  
Old 08/03/2020, 02:55   #20
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Quote:
Originally Posted by thaidu0ngpr0 View Post
How can I combine it with sro_devkit
You can't combine it, DevKit has its own CMsgStreamBuffer just with different labels and maybe better parse.

You can use both already by renaming the class.
#HB is offline  
Old 08/03/2020, 08:09   #21
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by #HB View Post
You can't combine it, DevKit has its own CMsgStreamBuffer just with different labels and maybe better parse.

You can use both already by renaming the class.

I tried, but it didn't work, I tried calling GUI with opcode 0xB070 but GUI didn't appear
I need to do something else for it to work
CPSMission.cpp
PHP Code:
#include "CPSMission.h"
#include "ClientNet/MsgStreamBuffer.h"
#include "GInterface.h"





int CPSMission::OnPacketRecv(CMsgStreamBufferMsgBuffer)
{
    if (
MsgBuffer->msgid() == 0xB070)//Show Form
    
{
        
int FormID 5004;
        
byte ShowHide = -1;
        *
MsgBuffer >> FormID >> ShowHide;

        if (
FormID != )
        {
            
g_pCGInterface->m_IRM.GetResObj(FormID1)->ShowGWnd(true);
        }

        
MsgBuffer->FlushRemaining();
    }
    
//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.
    
return reinterpret_cast<int(__thiscall*)(CPSMission*, CMsgStreamBuffer*)>(0x0084CAB0)(thisMsgBuffer);

thaidu0ngpr0 is offline  
Old 08/03/2020, 22:19   #22
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Are you sure you're hooking?
#HB is offline  
Old 08/04/2020, 05:46   #23
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by #HB View Post
Are you sure you're hooking?
florian0 he told me to need a vftable hook. but I don't know where to get the vftable hook. Can you guide me to hook it.
thank you for sharing
my discord : Thaidu0ngpr0#3327
thaidu0ngpr0 is offline  
Old 08/04/2020, 14:57   #24
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Quote:
Originally Posted by thaidu0ngpr0 View Post
Can you guide me to hook it.
Did you read main post? :3
#HB is offline  
Old 08/04/2020, 16:24   #25
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 271
Quote:
Originally Posted by #HB View Post
Did you read main post? :3

thank you very much . I did it
thaidu0ngpr0 is offline  
Old 08/05/2020, 09:06   #26
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
.

Quote:
Originally Posted by #HB View Post
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.

CPSMission example:
Code:
replaceAddr(0x00DD440C, addr_from_this(&CPSMission::OnPacketRecv));
#HB is offline  
Thanks
1 User
Old 11/13/2020, 18:10   #27
 
elite*gold: 0
Join Date: Aug 2010
Posts: 10
Received Thanks: 1
Quote:
Originally Posted by #HB View Post
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


Linkleri yenilermisiniz? sayfalar açılmıyor
d4rk123 is offline  
Old 11/13/2020, 18:57   #28
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,486
Quote:
Originally Posted by d4rk123 View Post
Linkleri yenilermisiniz? sayfalar açılmıyor
Links are fine
florian0 is offline  
Thanks
2 Users
Old 11/14/2020, 06:14   #29
 
elite*gold: 0
Join Date: Aug 2010
Posts: 10
Received Thanks: 1
Thumbs up

Quote:
Originally Posted by florian0 View Post
Links are fine
opened thanks to vpn. thank you
d4rk123 is offline  
Old 07/26/2021, 19:33   #30
 
elite*gold: 0
Join Date: Jul 2020
Posts: 163
Received Thanks: 15
Quote:
Originally Posted by sarkoplata View Post
you can hook: 0x008418D0
the first arg pushed into the stack is a CMsgStreamBuffer*.
Please boss add my discord i need your help
Kotsh#5187
kotsh23 is offline  
Reply

« BAN2OZZ | BSK2OZZ »

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:30.


Powered by vBulletin®
Copyright ©2000 - 2025, 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.

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