Jump to content
V3ct0r

Mod loading system for server and client (PKOdev.NET mod loader)

Recommended Posts

4 hours ago, Rinor said:

@V3ct0r can you make it work with CO gameserver.exe/game.exe?

Why would you want to make a mod loader that works for the pre-compiled binaries, work with corsairs which is using sources? for corsairs it's easier, just code & compile, no need to complicate things.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 1/8/2022 at 3:04 PM, flamyman1412 said:

i can fix it
But after installing the mod it doesn't show the effect of the mod.

[pkodev.mod.loader] -----------------------------------------------
[pkodev.mod.loader]    PKOdev.NET mod loader ver. 1.2 by V3ct0r    
[pkodev.mod.loader] -----------------------------------------------
[pkodev.mod.loader] Detected .exe file: 'Game.exe 1.3x (ID: 0)'.
[pkodev.mod.loader] Searching mods in 'mods' directory . . .
[pkodev.mod.loader] Done! (2) mods found out: 
+----+--------------------------------+----------+----------------+
|  # |                            Mod |  Version |         Author |
+----+--------------------------------+----------+----------------+
|  1.|            pkodev.mod.cooldown |      1.0 |         V3ct0r |
|  2.|           pkodev.mod.namelevel |      1.0 |         V3ct0r |
+----+--------------------------------+----------+----------------+
[pkodev.mod.loader] Launching mods . . .
[pkodev.mod.loader] All mods launched!

What mod did you install and what effect do you expect? You have to also port each mod for your Game.exe. A mod written for Game.exe ID: 2, for example, will not work with Game.exe ID: 3.

 

9 hours ago, Rinor said:

@V3ct0r can you make it work with CO gameserver.exe/game.exe?

It is pointless and that's why:

1) The loader uses the build time to determine the type and version of the destination .exe file. Each time you compile Game.exe from source code, this build time will change;

2) To work, each mod imports the necessary functions and objects from Game.exe using their addresses in memory. Each time you compile Game.exe from source code, these addresses will change too;

3) The loader was created to solve the problem of modifying compiled server and client .exe files to fix bugs and add new features. As @okitora said, when you work with source code, you can just add the necessary functionality directly to the source code. So you don't have that problem.


Share this post


Link to post
Share on other sites
6 hours ago, V3ct0r said:

What mod did you install and what effect do you expect? You have to also port each mod for your Game.exe. A mod written for Game.exe ID: 2, for example, will not work with Game.exe ID: 3.

 

It is pointless and that's why:

1) The loader uses the build time to determine the type and version of the destination .exe file. Each time you compile Game.exe from source code, this build time will change;

2) To work, each mod imports the necessary functions and objects from Game.exe using their addresses in memory. Each time you compile Game.exe from source code, these addresses will change too;

3) The loader was created to solve the problem of modifying compiled server and client .exe files to fix bugs and add new features. As @okitora said, when you work with source code, you can just add the necessary functionality directly to the source code. So you don't have that problem.

Is there any chance you could include changes to source code aswell, instead of mods only so we can add on source code, for us who use source codes?

Share this post


Link to post
Share on other sites
17 hours ago, Rinor said:

Is there any chance you could include changes to source code aswell, instead of mods only so we can add on source code, for us who use source codes?

I don't plan to develop the same modifications for the source code because I don't use source codes for development (only for research purposes) and it will be difficult to distribute modifications. I would also like to know the statistics of how many people use official binaries, and how many source codes, since mod development is taking a ton of time. But I'm sure that the official binaries are widely used, so development for them makes sense.

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, V3ct0r said:

I don't plan to develop the same modifications for the source code because I don't use source codes for development (only for research purposes) and it will be difficult to distribute modifications. I would also like to know the statistics of how many people use official binaries, and how many source codes, since mod development is taking a ton of time. But I'm sure that the official binaries are widely used, so development for them makes sense.

Well i guess most uses CO source code as they find them more secured talking about some known issues/exploits that still exist on public exe before, the main problem of CO might be some issues that are known to CO source only which most of them are fixed already, other than that its fine, thats why i asked if possible to share source codes instead of mods.

Share this post


Link to post
Share on other sites
On 1/19/2022 at 1:15 AM, Rinor said:

Well i guess most uses CO source code as they find them more secured talking about some known issues/exploits that still exist on public exe before, the main problem of CO might be some issues that are known to CO source only which most of them are fixed already, other than that its fine, thats why i asked if possible to share source codes instead of mods.

Regarding to the security things, vulnerabilities can also be easily fixed with mods and patches of the official binaries. The main problem is to find these vulnerabilities, that is, the lack of information about them. If we talk about source codes, then yesterday I noticed an unpleasant trend. I went to the @deguix repository and saw the following commit: "Removed "/byebyeleecher" backdoor on GateServer (mentioned by Dan).". Does this really mean that people are adding new vulnerabilities to the source codes? They can also do it unconsciously, adding new features.

 

All my mods are open source. Everyone in the our community can view them, understand their operating principle and port them to the client and server source codes.

Edited by Dan

Share this post


Link to post
Share on other sites
7 hours ago, V3ct0r said:

Regarding to the security things, vulnerabilities can also be easily fixed with mods and patches of the official binaries. The main problem is to find these vulnerabilities, that is, the lack of information about them. If we talk about source codes, then yesterday I noticed an unpleasant trend. I went to the @deguix repository and saw the following commit: "Removed "/byebyeleecher" backdoor on GateServer (mentioned by Tensei).". Does this really mean that people are adding new vulnerabilities to the source codes? They can also do it unconsciously, adding new features.

 

All my mods are open source. Everyone in the our community can view them, understand their operating principle and port them to the client and server source codes.

Well, it’s better to have a public source code without backdoors rather than having mods for exes, Extra features can be added later or paid to someone/you/anyone but would be good to see a public release of sources without backdoors/exploits which could be used as a base.

 

According to the /byebyeleecher it was there since day 1 of release, as the corsairs team added it incase someone could leak the files and use on their own without their permission, also theres one more i dont remember but everyone knows about it already “case 2” which is an exploit other than that corsairs is bugged only by their new features which some is fixed and posted/shared on forum/discord channel etc.. but people can just compare to the clean source and remove the new corsairs features if they don’t want to use them if thats the case.

Some stuff that you can keep is the Anti Ddos / Anti Wpe but also anti wpe has an exploit itself which none shared this fix about len 6 if you send a lower packet size than 6 it would crash gateserver.

Thats if you keep their Anti Wpe, if not you can remove it or if you do you can fix it (which i didn’t myself, as im not good on c++, still a learner beginner).

Edited by Rinor

Share this post


Link to post
Share on other sites

but i have problem whit possession when poss glow under my fit stay at same point where i poss!! how do i change it or so that poss glow track me...

Share this post


Link to post
Share on other sites
On 2/8/2022 at 8:05 PM, Mesut said:

but i have problem whit possession when poss glow under my fit stay at same point where i poss!! how do i change it or so that poss glow track me...

What mods have you installed? Was this bug before installing mods? Does it disappear after uninstalling mods?


Share this post


Link to post
Share on other sites

Hello @Rinor , no one and never? 

In general, we are talking about 2 bytes, this is the minimum length - the ping of the packet.

 

And here is the solution for Receiver.cpp:

long Receiver::Process()
{
	int			l_reallen	=0;
	long		l_retval	=0;

	bool isFirstData = true;

	while(!m_datasock->m_delflag && !GetExitFlag())
	{
		if(!HasSpace())
		{
			m_rpk	=__bufheap.Get(max(m_datasock->GetRecvBuf(),__tca->__pkt_maxlen));
			m_p		=0;
		}

		l_reallen	=recv(m_datasock->m_socket,const_cast<char*>(m_rpk.GetPktAddr()) + m_p,int(HasSpace()),0);
		
		if (isFirstData) {
			
			isFirstData = false;  
			
			if (l_reallen == 2 && m_rpk.GetPktLen() > 2) {

				l_retval = -5; 
				break;

			}
		
		}

		// ............. other code
      
}

 

Share this post


Link to post
Share on other sites
9 часов назад, V3ct0r сказал:

What mods have you installed? Was this bug before installing mods? Does it disappear after uninstalling mods?

nvm it,s working now i add on some more file it,s dissepaer

  • Thanks 1

Share this post


Link to post
Share on other sites
On 2/10/2022 at 8:10 PM, Mesut said:

nvm it,s working now i add on some more file it,s dissepaer

Great!

 

On 2/11/2022 at 7:51 AM, elara said:

Hii All! one Guy is closing my server and i donw know what to do... i have Abyss files 1.36

Hello @elara!

 

Create a separate topic in Questions & Help section and explain your problem in more details. Stop flooding please.


Share this post


Link to post
Share on other sites
On 2/10/2022 at 11:48 AM, Де-Компанье said:

Hello @Rinor , no one and never? 

In general, we are talking about 2 bytes, this is the minimum length - the ping of the packet.

 

And here is the solution for Receiver.cpp:


long Receiver::Process()
{
	int			l_reallen	=0;
	long		l_retval	=0;

	bool isFirstData = true;

	while(!m_datasock->m_delflag && !GetExitFlag())
	{
		if(!HasSpace())
		{
			m_rpk	=__bufheap.Get(max(m_datasock->GetRecvBuf(),__tca->__pkt_maxlen));
			m_p		=0;
		}

		l_reallen	=recv(m_datasock->m_socket,const_cast<char*>(m_rpk.GetPktAddr()) + m_p,int(HasSpace()),0);
		
		if (isFirstData) {
			
			isFirstData = false;  
			
			if (l_reallen == 2 && m_rpk.GetPktLen() > 2) {

				l_retval = -5; 
				break;

			}
		
		}

		// ............. other code
      
}

 

I guess you did this for wpe?

Cuz i have same logic but is just 3 lines of code, “if you meant that for wpe length that crashes gate”

Share this post


Link to post
Share on other sites
8 hours ago, Rinor said:

Hey @V3ct0r just wondering since you sharing all this mods do you have Server-Side 1.38 exes that are stable? No exploits/crashes?

Hello!

 

I don't have any specific GameServer.exe. I use the one from public releases, for example from PKO 1.38 server files.

 

For the future: don't quote the whole post, please. Thank you!


Share this post


Link to post
Share on other sites
4 hours ago, V3ct0r said:

Hello!

 

I don't have any specific GameServer.exe. I use the one from public releases, for example from PKO 1.38 server files.

 

For the future: don't quote the whole post, please. Thank you!

Yo, i'm just asking cuz the mods you sharing are very useful, but i don't see it useful to use them on public exes as they are full exploits and theres no fixes for them, unless these was source-code, i think would be great to share fixes for exploits aswell so this mods can be used safely on public exes and we could use them for good.

As we all know we'd be dealing with crashes/exploits when using the public exes and theres many already.

Edited by Rinor

Share this post


Link to post
Share on other sites
12 hours ago, Rinor said:

Hey @V3ct0r just wondering since you sharing all this mods do you have Server-Side 1.38 exes that are stable? No exploits/crashes?

In my opinion, instead of relying and wishing on someone to release something like this, learn how to work with assembly/debugging vulnerabilities.

But for people who want to help, I suggest @V3ct0r & @patrick13 to create a new category for debugging 'exploits' & 'crashes' with a template like:

Vulnerability Title:
Vulnerability Information:
Executable type:
Executable version:
Dump file link:

A dump file of your .exe crash helps a lot more than you think in terms of debugging.
If you want to generate a dump file of your executable when it's crashing, use Procdump.

Share this post


Link to post
Share on other sites
On 12/14/2021 at 3:35 AM, V3ct0r said:

Mod loading system for server and client (PKOdev.NET mod loader)

 

screenshot_1.png

 


Installing the Mod Loader

 

screenshot_2.png


1) In the root directory of the executable file, create a folder called "mods*. This folder will store DLL libraries of mods;
2) Open the executable file in CFF Explorer. Go to the "Import adder" tab (1);
3) Click the "Add" button (2) and select the pkodev.mod.loader.dll file (see the attachments at the end of this post);
4) In the "Exported functions" list, select "ExportedFunction" (3);
5) Click the "Import By Name" button (4);
6) Uncheck the "Rebuild OFTs" checkbox (5);
7) Click the "Rebuild Import Table" button (6);
8 ) Save the file (7).
9) Run the executable file. You should see the following message in the console window: 


[pkodev.mod.loader] -----------------------------------------------
[pkodev.mod.loader]    PKOdev.NET mod loader ver. 1.0 by V3ct0r
[pkodev.mod.loader] -----------------------------------------------

If the executable file does not have a console window, for example, Game.exe, then run it as follows:


system\Game.exe startgame > output.txt

The console output will now be redirected to the text file output.txt.


* Note: for Game.exe, the mods folder must be in the client's root directory, not in the "system" folder.

 

This is the gameserver I have with certain fixes

 

830383185_gameservereditedwrexor.png.daddfb38e0009d8274eefb6f731b2ead.png

 

 

if i inject pkodev.mod.loader.dll from us mods, this error appears

 

1319960721_gameservererror2.png.927293d705bc219b090a5ecee6e9b7f7.png

 

If I remove the previous DLL that made the bug fixes, the same error appears

 

1335477106_gameserverError.png.aa2de842e803567186bfd3118b1d1b19.png

 

If I remove the previous DLL without injecting the pkodev.mod.loader.dll it works normal

 

1965553632_gameservernowreror.png.46888f615279ec8ff805bbe21d0058f8.png

 

How do I make everything work with the fixes that are and with your DLL to implement the Mods?

 

Thanks for listening!!

Edited by Xoskis

Share this post


Link to post
Share on other sites

Hello @Xoskis,

 

your problem is related with pkodev.mod.antibot mod:

 

On 1/17/2022 at 12:10 PM, V3ct0r said:

Installation

 

1) In the "mods" directory of your GameServer, create a "pkodev.mod.antibot" folder and place into it the mod DLL file "pkodev.mod.antibot.server.13<x>.dll" for your version of GameServer.exe;

2) In the folder "resource" of your GameServer place the folder "Pic" from the attached archive with the mod;

3) In the file "functions.lua" ("GameServer\resource\script\calculate") add the code from the corresponding file from the attached archive with the mod.

Have you completed these steps?


Share this post


Link to post
Share on other sites
7 hours ago, V3ct0r said:

Hello @Xoskis,

 

your problem is related with pkodev.mod.antibot mod:

 

Have you completed these steps?

Hello V3ct0r,

 

I had not completed! Now that I've completed it, everything works without any errors.

Thank you for your attention and help sir! 🙏

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @V3ct0r, i would like to ask if you could share the serverside exes and client that you use for this mods for yourself.

Just wondering if you have the serverside exes that has some exploits and sql injections fixed that people use to crash server and get into host these old school exploits i don’t remember all (maybe people could share their ideas how they work, so you could contribute to fix) but which are still available on public exes, so we could use this mods of yours safely. Maybe some exes that could be a good for starting a server without many troubles of this kind of exploits. Not asking for myself only, i’m asking for all our community if thats possible by you.

 

Thanks for the contribute and your hard work. 🙌

Edited by Rinor

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...