Jump to content

Recommended Posts

Posted

I find this forum extremely lacking in information for users on extenders, and the only semi-useful shares are pieces of code written by developers which are of no use to the average user or new-comer to the L2 Official experience. Many people also believe that as a result of commercially available extenders, such as dvampire and depmax, that there is no need for the average L2Off server owner to write their own extenders. But there are many things that neither dvampire or depmax do which can be of use to some.

So I have decided to write this little guide, with the full source-code included, that will show first of all how to create an IDA Pro Database for your L2Server.exe, and then how to remove the length limit from the //announce GM command using an extender.
I'm aiming this guide towards people who maybe know a little C++ but feel intimidated by the prospects of creating an extender, but rest assured, the basic's are quite easy once you get into it.

This guide is written for the dvampire L2Server.exe and so any addresses mentioned will only be valid for that exe, that also applies to the source.
Source -> http://rapidshare.com/files/394471289/Extender.rar.html
Attaching Guide -> http://www.maxcheaters.com/topic/75684-guide-attaching-an-extender/

The first thing you need when starting with extenders is IDA Pro, this program will disassemble the L2Server.exe into assembly, which is invaluable to any extender developer.
Some ASM knowledge is required, but the basics required to create simple but useful extenders are pretty easy to learn.


So, lets start by creating an IDA Pro database. Once you have downloaded and installed IDA Pro, you must open the 64bit version. You do not require a 64bit operating system to do this, so it is better you create an IDA database on your PC and not your server.
Once opened, you will be prompted by the "Welcome to IDA!" screen.
welcometl.jpg

The icon on the task bar, and at the top left of the welcome screen, should have a red "64" at the top right corner.
37924696.jpg

This means you are running the 64bit version of IDA Pro, if you do not see the red "64" you are running the wrong version.

Click the "New" button, and then IDA Pro will open and prompt you with the "New Disassembly Database" window.
newqm.jpg

Double click the "PE Executable" Icon and IDA will then ask you to locate the PE Executable you wish to disassemble, which is your L2Server.exe, so navigate to your L2Server.exe and select it.
selectx.jpg

You will now be prompted with the "PE Executable file loading wizard", with the latest version of IDA Pro, you don't have to change any of the analysis options to get a decent database, but the more advanced users may want/need to change some settings to get a correct analysis. If you want to change these settings, check the "Analysis Options" box and click next. I typically uncheck "Delete instructions with no xrefs" and "Create offset if data xref to seg32 exists" (After analysis and string generation I usually re-enable the 2nd option and reanalze to fix the data that should be offsets, without breaking unicode strings). Then just keep clicking next until the wizard closes.
IDA may then ask you to locate various .dll files depending on what other extenders are already attached to the L2Server.exe you have loaded, you can either locate these files and load them, or just click cancel as they are not necessary for the creation of the database. IDA will also ask if you wish to locate the debug information file, which you don't have, so click No. ( It doesn't matter if you click yes or no, as IDA will not find that file either way )
Now IDA will start analysing your L2Server.exe, depending on your computer's performance this process could take 5 minutes, or something like 20 minutes. For me it takes no longer than 5 minutes, and you can tell when it has finished by the auto analysis status icon on the toolbar, which looks like a yellow circle when IDA is still analysing, and it will turn green when it is done, you will also see "The initial autoanalysis has been finished" in the output window at the bottom of the IDA screen. Older versions of IDA will automatically generate strings on completion of the analysis, but the version I'm using doesn't, and so I go to View->Open Subviews->Strings (or SHIFT+F12) to generate the strings.

Congratulations. You have now created your IDA Database.


Now comes the more difficult part, now you have created your IDA Database you need to use it to find and fix the length limit for the //announce function.

For peoeple who aren't familliar with the structure of the l2server it may be difficult at first to find your way around, but after a while it becomes pretty easy. NCSoft has made our job as extender developers a lot easier because of the way they handle crashes, anyone who has seen a LinError.txt will have noticed the call-stack dump containing a lot of function names, and this is ultimately the easiest way to find a function you are looking for, by searching in the IDA Strings window for the name of the function.

The function we need to find is the builder command handler function for the //announce command. So to start looking, go to the strings window, click search at the top of the screen, and then click search under that (or ALT+T Shortcut), and then as we are looking for the announce function, type announce into the box and hit enter. As your analysis may not go exactly the same as mine, and you may be using a different L2Server.exe, the strings that your search picks up may not be in the same order as mine.
The first result I get is 'set_interval_announce', which is another GM command, but not the one we are looking for, so I hit CTRL+T to find the next result, and my next results are, critannounce, delannounce, setannounce, and then the command we are looking for... announce. This string is the command which is stored in the builder command handler array, and you can use this string to find the announce function but it is easier to carry on searching for the actual announce function. So CTRL+T once more brings us  to exactly what we are looking for, BuilderCmd_announce, this string is the function name used by the L2Server for LinErrors, and so is referenced from the function we need.

So I hit enter in the Strings window, and that then opens the location of the string in the IDA View window, by using the keyboard shortcut CTRL+X IDA will then show you the xref's to that string. Click OK and IDA will now jump to where that string is referenced in our BuilderCmd_announce function. If you don't know assembly, this is the point where you will be quite confused by what is on the screen, and so I would suggest learning some basic assembly before attempting this.

For this part I am going to assume anyone reading this far knows some assembly and so you should be able to follow this pretty easily. I happen to know the reason for the character limit is because the L2Server copies only a maximum of 50 characters into the buffer which is sent to the "BroadcastToAllUser_Announce" function, which actually sends the announcement to the players ingame. To overcome this problem is an incredibly simple operation. The easiest way to find what we need to change is look for where the announcement string is copied into the buffer to be sent to the players, which is at the address 0x450A5E. The correct way to fix this function would be to overwrite the address in the builder command handler array for this function with a completely new function and rewrite the command handler function itself. But a much easier and much quicker way is to simply send the whole announce command string to the broadcast function instead of the buffer which contains the maxixmum 50 chars. The full announcement string is sent to the function from the builder command handler in the register r8, and at the top of the function the server moves the string (r8) into r12, so all we need to do is move r12 to rcx (the first argument register) for the function call rather than the limited buffer. To do this we need to replace the code at 0x450A63, with "mov rcx, r12". Which in opcode form is 498BCC, and as the code we are replacing is 8 bytes, and our new code is only 3, we must remember NOP the area, which means writing 0x90, for 5 bytes after our code. So we write 498BCC9090909090 to 0x450A63.

And it's done!

You could also just write the changes into the L2Server.exe using a hex editor, but that's far less fun.
The code for these changes can be found here: http://rapidshare.com/files/394471289/Extender.rar.html
And I hope that this guide helps more people become extender developers, because we are a rare breed in L2 these days, and it would be great to see more people doing things for themselves, rather than relying on dvampire or depmax to do everything for them.

Check this link for a guide of how to attach an extender to your L2Server.exe -> http://maxcheaters.com/forum/index.php?topic=154347.0

Posted

For the other people!!!!

 

 

China Exe Address(WHICH BTW IS THE LATEST BUILD AND THEREFOR SUPERIOR TO NORMAL C4 AND DVAMP EXE):

0x0043F7D6

 

Normal C4 Exe Address (Open PP / L2storm - amped 2.0a versions):

0x00450416

 

 

PS: Chicken helps you code.

 

Posted

so use it then, the only reason I didn't is because I don't redistribute other people's work without their permission, plus as this was only a demonstration project to replace 4 bytes, it wasn't needed... or I would of included my memory writing class.

Posted

:o Really great.

Very good job.

 

/offtopic: you are little anarchy?

 

/offtopic2: when you are giving to s/o +1 karma, you are losing one of yours?

  • 2 weeks later...
Posted

does it matter if i compile the source in 32-bit machine or 64-bit machine?

 

It would be fairly bad to try an inject a 32bit dll into a 64bit application ;)

  • 1 month later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • FOREVERCAST AUTOMATED FISHING FOR WORLD OF WARCRAFT FOREVER Cast. Relax. Repeat. READY FOR LAUNCH AVAILABLE JUST HOURS BEFORE WOW FOREVER RELEASES 1-HOUR FREE TRIAL — NO PAYMENT REQUIRED   MEET FOREVERCAST Your fishing companion for WoW Forever. ForeverCast is a Windows-based fishing automation application designed to make fishing simpler, smoother, and more convenient. Automatically cast your line, detect bites, interact with the bobber, and repeat — all through an easy-to-use interface. Featuring two fishing methods, customizable controls, randomized behaviors, and session management, ForeverCast gives you control over how you fish. Development is complete, and ForeverCast is being prepared for its official launch alongside WoW Forever.   SEE FOREVERCAST IN ACTION OFFICIAL GAMEPLAY SHOWCASE       TWO FISHING METHODS 01 — NATIVE INTERACT (RECOMMENDED) Audio-based splash detection combined with WoW's native interaction controls. No manual bobber positioning or screen calibration required. 02 — CURSOR SCAN Our original visual fishing method. Detects the fishing bobber on screen and interacts through cursor-based controls. Two methods. One goal. A simpler fishing experience.   AUTOMATION FEATURES AUTOMATED FISHING Cast, detect bites, interact, and repeat automatically. RANDOMIZED TIMING Variable interaction delays and recast cooldowns. RANDOM IDLE PAUSES Optional fishing breaks with automatic resumption. AUTOMATIC BAG CHECKS Optional randomized bag checks between casts. SMOOTH MOUSE MOVEMENTS Optional gradual cursor movements with varied paths and speeds. RANDOM CHARACTER MOVEMENT Optional alternating movements using configurable strafe keys. Each optional behavior can be enabled or disabled independently.   DESIGNED AROUND YOUR PREFERENCES CUSTOMIZABLE CONTROLS Configure fishing keys, interaction methods, audio sensitivity, and timing. SMART SESSION LIMITS Set maximum fishing duration and catch limits. SESSION TRACKING Monitor catches, elapsed time, and saved session progress. QUICK START & STOP Start or stop fishing using the F6 hotkey. SIMPLE WINDOWS INTERFACE Clean dashboard, activity logs, guided setup, and helpful settings. EXTERNAL OPERATION Runs outside World of Warcraft without reading game memory or injecting code.   PRICING & ACCESS FREE TRIAL — €0 60 MINUTES OF ACCESS Experience ForeverCast before purchasing. No payment required. MONTHLY LICENSE — €8.99 30 DAYS OF ACCESS One month of access starting from activation. LIFETIME LICENSE — €39.99 ONE-TIME PURCHASE Permanent access to ForeverCast. No recurring subscription fees.   LAUNCH INFORMATION FOREVERCAST IS READY Core fishing functionality implemented and tested. Both fishing methods available. Automation features integrated. Session management implemented. License activation and free trial system prepared. Standalone Windows application built. OFFICIAL RELEASE PLAN ForeverCast will become available approximately a few hours before the official opening of WoW Forever. This gives players an opportunity to download the application, activate their free trial or license, and configure their preferred fishing settings ahead of launch. The exact download and activation details will be published through our Discord community.   JOIN THE FOREVERCAST COMMUNITY Want to be among the first to try ForeverCast? Join our Discord for release notifications, downloads, license information, support, and future updates. JOIN THE OFFICIAL FOREVERCAST DISCORD Developer Contact: Nythrand     FOREVERCAST A SMARTER WAY TO FISH. READY FOR WOW FOREVER Cast. Relax. Repeat.
    • 911reg MapExtractor — The Community Contributions Update   Another update, gentlemen.   First of all, I'd like to express my sincere gratitude to the wonderful members of this community who have been kind enough to dedicate their valuable time and expertise to helping me improve this project.   The amount of support I've received since releasing this tool has been truly overwhelming. I honestly didn't expect so many experienced developers to volunteer their services completely free of charge.   @Mobius, in particular, was kind enough to point out that my generator lacked pathnode support. Excellent suggestion! I immediately added it with a single ChatGPT prompt, remotely through AnyDesk on my phone. I wasn't even sitting at my computer. It's genuinely inspiring to see someone with three months of dedicated development experience taking time out of his busy schedule to help someone who was lying in bed.   I'd also like to extend my gratitude to Mobius for providing the L2jMobius emulator, which I've been using to test both geodata and pathnode generation. While the emulator itself remains somewhat underdeveloped, it has proven to be an amazing testing environment for my little project. It's wonderful to see developers contributing to the community in so many different ways, even when they aren't the best at it. Thank you for your continued support!   @Galagard deserves special recognition for his outstanding commitment to quality assurance. He generously provided a comprehensive list of issues involving boundaries, heightmaps, WorldZ, water generation, and 256×256 errors, completely unprompted! I was honestly surprised by the amount of effort he put into helping me. I simply forwarded his findings to ChatGPT, saving myself the inconvenience of investigating anything manually. It's rare to find someone so passionate about improving another developer's free software. Thank you for your unpaid service. Your dedication will not be forgotten.   @Bazookarpm, our unofficial UI/UX consultant, also provided some exceptionally detailed feedback regarding the visual appearance of the application. His assessment was so passionate that he even reported experiencing visual cancer after looking at the interface. Naturally, I took his concerns very seriously and redesigned the entire UI. I sincerely hope the new design meets his expectations and that his recovery is progressing well. Thank you for sacrificing your eyesight in the name of open-source software.   Changelog: Completely redesigned interface. Added pathnode generation. Improved geodata generation. Addressed reported issues with boundaries, heightmaps, WorldZ and water. Various fixes and improvements. Tested geodata and pathnodes using the generously provided L2jMobius emulator.   I genuinely cannot express how grateful I am for this level of community involvement.   Some developers have to spend months identifying problems, gathering feedback, and planning new features. Fortunately, I have access to a group of highly motivated individuals who are willing to do all of that for me, entirely voluntarily.   Not only did they identify areas for improvement, but they also took the time to write lengthy, detailed explanations of their findings. All without being asked, without expecting payment, and apparently without requiring any encouragement whatsoever.   This is what a healthy open-source community should look like.   At 911reg, I believe in recognizing the people who make our achievements possible. That's why I would like to officially acknowledge the following contributors:   Mobius — Pathnode Research & Development / Testing Infrastructure Provider Galagard — Quality Assurance & Bug Reporting Bazookarpm — User Interface & Ophthalmological Testing I sincerely hope this collaboration continues. With enough community support, I might eventually be able to release updates without even reading the source code. Or even asking another AI to prompt for me.   To @Mobius and @Galagard, I would also like to wish you both the very best of luck finding employment in this rapidly evolving industry.    Once again, thank you for your continued dedication to the 911reg MapExtractor project. Your contributions are deeply appreciated, and I look forward to receiving further unsolicited assistance.   This is what 911reg stands for. Haters, eat your hearts out. https://github.com/911reg/911reg-MapExtractor/releases/download/v0.8.0/911reg-MapExtractor-0.8.0-win64.zip
    • Version 0.8.5 - Lobby viewing and batch NPC export   Download   I originally wasn’t planning to release this version, as I was working towards 1.0.0. However, a regression in NPC position editing changed those plans a little.   New   - You can now view lobbies through the new Other maps tab in the main menu. Exporting these maps isn’t available yet, I’ll add it in 1.0.0. - Export multiple NPCs as a single scene or as separate ones.   Improvements   - When exporting locations to Blender, terrain layers and masks are saved separately for editing. Grass and flowers use instancing, reducing file sizes and speeding up import. Fixed issues with empty material slots and seams at hidden terrain edges. - You can now specify a custom export scale.   Fixes   - Clicking an NPC now activates position editing, allowing you to move and rotate it.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..