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

  • Like 2
  • Thanks 1
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

    • 📌 FORUM RULES (Revised – Legal Compliant) Η χρήση του forum προϋποθέτει την πλήρη αποδοχή των παρακάτω κανόνων. Οποιαδήποτε παραβίαση ενδέχεται να οδηγήσει σε περιορισμούς ή μόνιμο αποκλεισμό. 1. Spam & Κατάχρηση Δημοσιεύσεων Το spam απαγορεύεται. Μονολεκτικές, άσχετες ή πολλαπλές διαδοχικές δημοσιεύσεις δεν επιτρέπονται. Bumping επιτρέπεται μόνο στο Marketplace, μία φορά κάθε 24 ώρες. Απάντηση σε θέματα παλαιότερα των 6 μηνών δεν επιτρέπεται. Σχόλια τύπου «wrong section», «request lock» κ.λπ. απαγορεύονται — χρησιμοποιήστε το Report Section. 2. Συμπεριφορά & Τάξη Απαγορεύονται: βρισιές, trolling, drama, απειλές, ρατσισμός, flame posts. Οι κανόνες συμπεριφοράς ισχύουν και σε PMs, profile comments και λοιπές περιοχές. Πολιτικά θέματα επιτρέπονται μόνο εντός λογικών και πολιτισμένων ορίων. 3. Απαγορευμένο & Ακατάλληλο Περιεχόμενο Απαγορεύεται αυστηρά η δημοσίευση ή αναζήτηση περιεχομένου που είναι: Παράνομο βάσει ισχύουσας νομοθεσίας Πειρατικό (warez, cracks, serials, pirated software) Σεξουαλικό, πορνογραφικό ή βίαιο Προσβλητικό, ρατσιστικό ή εξτρεμιστικό Θρησκευτικά προκλητικό με σκοπό την ένταση ➡️ Όλα τα παραπάνω διαγράφονται άμεσα, χωρίς προειδοποίηση. 4. Διαφημίσεις & Προώθηση Απαγορεύεται κάθε μορφή διαφήμισης χωρίς έγκριση Administrator. Απαγορεύεται η προώθηση παράνομων ή μη αδειοδοτημένων υπηρεσιών. Affiliate links, referral systems και external promotions απαιτούν έγκριση. 5. Γλώσσα & Παρουσίαση Μην αναμειγνύετε γλώσσες (αγγλικά σε ελληνικά topics και αντίστροφα). Χρησιμοποιείτε tags [GR] ή [EN]. Τα Greeklish επιτρέπονται προσωρινά, ωστόσο προτιμάται η χρήση ελληνικών χαρακτήρων. 6. Credits & Πνευματικά Δικαιώματα Υποχρεωτική αναφορά πηγών και credits. Απαγορεύεται η αναδημοσίευση περιεχομένου χωρίς άδεια. Κάθε χρήστης είναι υπεύθυνος για τα δικαιώματα του περιεχομένου που δημοσιεύει. 7. Κυβερνοεγκλήματα & Επιβλαβείς Πρακτικές Απαγορεύεται αυστηρά: Hacking, DDoS, flooding, botnets, booters Οδηγίες, εργαλεία ή καθοδήγηση για παράνομες ψηφιακές επιθέσεις Αναζήτηση ή πώληση τέτοιων υπηρεσιών 8. Υπογραφές (Signatures) Μέγιστο μέγεθος: 800x300 pixels. Υπογραφές που παραβιάζουν τους κανόνες αφαιρούνται. 9. Λογαριασμοί & Ασφάλεια Ένας λογαριασμός ανά χρήστη. Κλεμμένοι, κοινόχρηστοι ή πολλαπλοί λογαριασμοί απαγορεύονται. Το forum διατηρεί το δικαίωμα άμεσης διαγραφής λογαριασμών. 10. Σεβασμός προς το Staff Υποτίμηση, απειλές ή προσβολές προς staff δεν γίνονται ανεκτές. Για διαφωνίες ή παραβάσεις χρησιμοποιήστε το Report Section. LEGAL POLICY (Updated – Strict Compliance) 1. Νομιμότητα Περιεχομένου Απαγορεύεται κάθε περιεχόμενο που: Παραβιάζει νόμους ή κανονισμούς Παραβιάζει copyright ή intellectual property Προωθεί παράνομες οικονομικές, τραπεζικές ή επενδυτικές υπηρεσίες Σχετίζεται με απάτη, phishing, money laundering 2. DMCA – Copyright Protection Το forum συμμορφώνεται πλήρως με τον DMCA. Έγκυρες αναφορές οδηγούν σε άμεση αφαίρεση περιεχομένου. Επαναλαμβανόμενες παραβιάσεις = μόνιμος αποκλεισμός. 3. AML / Financial Compliance Απαγορεύεται περιεχόμενο σχετικό με ξέπλυμα χρήματος. Απαγορεύεται η προώθηση μη αδειοδοτημένων χρηματοοικονομικών υπηρεσιών. Δεν παρέχεται καμία οικονομική ή επενδυτική συμβουλή. 4. User-Generated Content & Ευθύνη Όλο το περιεχόμενο δημιουργείται από τους χρήστες. Το forum δεν φέρει νομική ευθύνη, αλλά: Παρακολουθεί Διαγράφει Συμμορφώνεται με τον νόμο 5. AI Moderation Χρησιμοποιούνται AI-based εργαλεία για εντοπισμό παραβάσεων. Η τελική απόφαση λαμβάνεται πάντα από άνθρωπο. 6. Τελικές Διατάξεις Οι κανόνες μπορούν να τροποποιηθούν χωρίς προειδοποίηση. Η χρήση του forum συνεπάγεται αποδοχή όλων των πολιτικών. Η άγνοια των κανόνων δεν αποτελεί δικαιολογία.   ΠΟΛΙΤΙΚΗ ΑΠΟΡΡΗΤΟΥ (Privacy Policy) – Ελληνικά Η παρούσα Πολιτική Απορρήτου περιγράφει τον τρόπο με τον οποίο το forum συλλέγει, χρησιμοποιεί και προστατεύει τα προσωπικά δεδομένα των χρηστών του, σύμφωνα με τον Γενικό Κανονισμό Προστασίας Δεδομένων (GDPR – ΕΕ 2016/679). 1. Συλλογή Δεδομένων Το forum ενδέχεται να συλλέγει τα ακόλουθα δεδομένα: Όνομα χρήστη (username) Διεύθυνση email IP address Ημερομηνία και ώρα σύνδεσης Περιεχόμενο δημοσιεύσεων (posts, topics, private messages) Δεν συλλέγονται ευαίσθητα προσωπικά δεδομένα. 2. Χρήση Δεδομένων Τα δεδομένα χρησιμοποιούνται αποκλειστικά για: Τη λειτουργία και ασφάλεια του forum Τη διαχείριση λογαριασμών Τη βελτίωση της εμπειρίας χρήσης Την πρόληψη κατάχρησης, απάτης ή παράνομων ενεργειών Τη συμμόρφωση με νομικές υποχρεώσεις 3. User-Generated Content Όλο το περιεχόμενο που δημοσιεύεται στο forum δημιουργείται από τους χρήστες. Οι χρήστες φέρουν την αποκλειστική ευθύνη για τα δεδομένα που επιλέγουν να δημοσιεύσουν. 4. Cookies Το forum χρησιμοποιεί cookies μόνο για: Διατήρηση σύνδεσης χρήστη Βασική λειτουργικότητα Ασφάλεια Δεν χρησιμοποιούνται cookies για διαφημιστική παρακολούθηση τρίτων. 5. AI & Αυτοματοποιημένη Επεξεργασία Το forum ενδέχεται να χρησιμοποιεί αυτοματοποιημένα ή AI-based εργαλεία για: Ανίχνευση spam Εντοπισμό παραβιάσεων κανόνων ή παράνομου περιεχομένου ➡️ Οι αποφάσεις επιβολής λαμβάνονται πάντα από άνθρωπο. 6. Κοινοποίηση Δεδομένων Τα προσωπικά δεδομένα: Δεν πωλούνται Δεν διαμοιράζονται με τρίτους Εξαίρεση υπάρχει μόνο εφόσον απαιτείται από τον νόμο ή αρμόδιες αρχές. 7. Δικαιώματα Χρηστών (GDPR) Οι χρήστες έχουν δικαίωμα: Πρόσβασης στα δεδομένα τους Διόρθωσης ή διαγραφής Περιορισμού επεξεργασίας Υποβολής αιτήματος διαγραφής λογαριασμού 8. Ασφάλεια Δεδομένων Λαμβάνονται εύλογα τεχνικά και οργανωτικά μέτρα για την προστασία των δεδομένων, ωστόσο καμία πλατφόρμα δεν είναι απολύτως ασφαλής. 9. Τροποποιήσεις Η παρούσα πολιτική μπορεί να τροποποιηθεί χωρίς προηγούμενη ειδοποίηση. Η συνέχιση χρήσης του forum συνιστά αποδοχή των αλλαγών. ✅ Σημείωση Οποιοδήποτε παράνομο περιεχόμενο δεν επιτρέπεται πουθενά στο forum, ανεξαρτήτως ρόλου, πρόσβασης ή status (VIP / Donator / Staff). 📌 FORUM RULES (English – Legal Compliant) By accessing or using this forum, you agree to comply with the following rules. Violations may result in warnings, restrictions, or permanent account termination. 1. Spam & Abuse Spam is strictly prohibited. One-word, low-effort, off-topic, or consecutive posts are not allowed. Bumping is allowed only in the Marketplace, once every 24 hours. Replying to topics older than 6 months is not permitted. Posts such as “wrong section”, “request lock”, etc. are not allowed — use the Report Section instead. 2. Conduct & Behavior Insults, harassment, trolling, threats, racism, flame posts, and toxic behavior are prohibited. These rules apply to all areas, including private messages and profile comments. Political discussions are allowed only within reasonable and respectful limits. 3. Prohibited & Illegal Content The following content is strictly prohibited anywhere on the forum: Any content that violates applicable laws or regulations Pirated software, warez, cracks, serials, or copyright-infringing material Malware, hacking tools, exploits, or harmful code Sexual, pornographic, violent, or extremist material Hate speech, discrimination, or incitement Content intended to provoke religious or social conflict ➡️ Such content will be removed immediately, without notice. 4. Advertising & Promotion Advertising of any kind requires prior administrator approval. Promotion of illegal or unlicensed services is strictly forbidden. Affiliate links, referral systems, and external promotions require approval. 5. Language & Formatting Do not mix languages (English in non-English topics and vice versa). Use [GR] or [EN] tags when creating a topic. Greeklish is temporarily allowed, but native characters are preferred. 6. Credits & Intellectual Property Proper credit must be given when using third-party content. Reposting content without permission is prohibited. Users are solely responsible for the intellectual property rights of their posts. 7. Cybercrime & Harmful Activities Strictly prohibited: Hacking, DDoS, flooding, botnets, booters Requests, guides, tools, or services related to cyber attacks Buying, selling, or searching for such services 8. Signatures Maximum allowed size: 800x300 pixels. Non-compliant signatures will be removed. 9. Accounts & Security One account per user is allowed. Stolen, shared, or multiple accounts are prohibited. The forum reserves the right to suspend or delete accounts immediately. 10. Respect Toward Staff Disrespect, threats, or harassment toward moderators or administrators will not be tolerated. Use the Report Section to address issues. ⚖️ LEGAL POLICY (English – Strict Compliance) This policy defines the legal framework governing forum operation. 1. User-Generated Content & Liability All content is created by users. The forum and its staff are not legally responsible for user-generated content. Reasonable efforts are made to monitor, review, and remove unlawful material. 2. Legal Compliance Content that violates: Local, national, or international laws Intellectual property rights Terms of third-party services is strictly prohibited. 3. DMCA – Copyright Policy The forum complies fully with the Digital Millennium Copyright Act (DMCA). Valid takedown requests result in prompt content removal. Repeat copyright offenders will be permanently banned. 4. AML – Anti-Money Laundering Prohibited content includes: Money laundering schemes or instructions Fraud, scams, or financial manipulation Promotion of unlicensed or illegal financial services The forum cooperates with authorities when legally required. 5. FCS – Financial & Compliance Services The forum does not provide financial, investment, or legal advice. Promotion of unregulated banking, investment, or financial services is forbidden. 6. Privacy & GDPR Publishing personal data of others is prohibited. Sharing private communications without consent is forbidden. The forum operates in compliance with GDPR regulations. 7. AI-Assisted Moderation Automated and AI-based tools may be used to detect violations. All enforcement actions involve human review. 8. Final Provisions Policies may be updated without prior notice. Continued use of the forum constitutes acceptance of all rules. Ignorance of the rules is not an excuse. PRIVACY POLICY – English Version This Privacy Policy explains how the forum collects, uses, and protects user data, in accordance with the General Data Protection Regulation (GDPR – EU 2016/679). 1. Data Collection The forum may collect the following data: Username Email address IP address Login timestamps User-generated content (posts, topics, private messages) No sensitive personal data is intentionally collected. 2. Use of Data Data is used solely for: Forum operation and security Account management Improving user experience Preventing abuse, fraud, or illegal activity Legal and regulatory compliance 3. User-Generated Content All content posted on the forum is created by users. Users are solely responsible for any personal data they choose to publish. 4. Cookies Cookies are used only for: Session management Essential functionality Security purposes No third-party advertising or tracking cookies are used. 5. AI & Automated Processing The forum may use automated or AI-assisted tools to: Detect spam Identify rule violations or illegal content ➡️ All enforcement decisions are subject to human review. 6. Data Sharing Personal data is: Not sold Not shared with third parties Except where required by law or competent authorities. 7. User Rights (GDPR) Users have the right to: Access their personal data Request correction or deletion Request restriction of processing Request account deletion 8. Data Security Reasonable technical and organizational measures are implemented to protect data. However, no online platform can guarantee absolute security. 9. Policy Updates This policy may be updated at any time without prior notice. Continued use of the forum constitutes acceptance of the updated policy. ✅ Final Note If you have concerns regarding privacy or data protection, please contact the forum administration. ✅ Important Notice Illegal content is not allowed anywhere on the forum, regardless of user role, status, or access level.
    • Hello everyone, This topic has been created to report any content that is considered illegal under applicable law or in violation of the forum rules. This includes, but is not limited to: Illegal software (pirated, cracked, or unauthorized software) Copyright-infringing material Malware, viruses, or any harmful code Scams, fraud, phishing attempts, or impersonation Illegal banking or financial services Money laundering activities or related instructions Any other illegal, unethical, or rule-violating activity — you name it If you encounter any such content, please report it here so it can be reviewed and removed promptly. Legal Disclaimer All content published on this forum is created and posted by its users. The forum administration does not take responsibility for user-generated content. However, we make every reasonable effort to monitor, review, remove, and maintain the forum by deleting illegal or rule-violating content as soon as it is reported or identified. By using this forum, you acknowledge and agree to these terms.     Moderator Notice We would like to inform all users that we are currently developing a custom AI-powered API tool that will assist our moderation team in scanning the forum database for illegal or rule-violating activity. This system will be used strictly as a support tool to help identify potentially problematic content, which will then be reviewed by human moderators before any action is taken. The goal is to improve forum safety, compliance, and response time while maintaining fairness and transparency. 🚧 Coming soon — more details will be shared once the system is ready. Thank you for your cooperation and for helping us keep the forum clean and lawful.
    • Reporting Illegal or Rule-Violating Content (post here)
    • If anyone is reading this, until we find the 488 protocol system that works with AuthD + Authgated from High Five (HF), just use L2Filter included in the leak as the login server to be able to play. hAuthd does not works with this chronicle, @Hint. do you happen to know about this?   Be aware of the system you use! If UseEMailAccount is set as true in l2.ini, your user_info table linked to your account must have email column not NULL with a valid e-mail, and you will use that e-mail to login instead of the account name. (Post merged)   OKAY! Nevermind about the above, I just figured it out, AuthD and Authgated from HF requires GameGuard to be enabled and UseEMailAccount set to false. Enable GameGuard at server side as per Fyyre instructions,  Add the missing GameGuard files in your client system: https://mega.nz/file/xZMWQBjK#triEj7My9B9roiLqAKk32HOLcLmPynoOm-QhBI_Ligw
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock