GİRİŞ & PROBLEM
Merhaba, GM kodlarında canımı sıkan ufak tefek şeyleri düzeltirken bununla alakalı da bir değişiklik yapmıştım fakat paylaşmaya vakit olmamıştı, detaylara önem verenler için işe yarayabilir o yüzden paylaşmak istedim.
NEDEN ?
Fonksiyonlar içerisinde gerekli kontroller ve bilgilendirme/hata mesajları eksikti, gereken her şey eklenerek kodlar yenilendi.
ÇÖZÜM
Öncelikle "cmd_gm.cpp" dosyası açılır.
Merhaba, GM kodlarında canımı sıkan ufak tefek şeyleri düzeltirken bununla alakalı da bir değişiklik yapmıştım fakat paylaşmaya vakit olmamıştı, detaylara önem verenler için işe yarayabilir o yüzden paylaşmak istedim.
NEDEN ?
Fonksiyonlar içerisinde gerekli kontroller ve bilgilendirme/hata mesajları eksikti, gereken her şey eklenerek kodlar yenilendi.
ÇÖZÜM
Öncelikle "cmd_gm.cpp" dosyası açılır.
Kod:
// BULUNUR; ACMD (do_advance) // KOMPLE DEĞİŞTİRİLİR; ACMD (do_advance) // DevFix 53 { char arg1[256], arg2[256]; two_arguments (argument, arg1, sizeof (arg1), arg2, sizeof (arg2)); if (!*arg1 || !*arg2) { ch->ChatPacket (CHAT_TYPE_INFO, "Syntax: /a <player name> <level>"); return; } LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC (arg1); if (!tch) { ch->ChatPacket (CHAT_TYPE_INFO, "<GM> %s does not exist!", arg1); return; } unsigned char old_level = tch->GetLevel(); // DevFix 122 unsigned char new_level = 0; // DevFix 122 str_to_number (new_level, arg2); new_level = MINMAX (1, new_level, PLAYER_MAX_LEVEL_CONST); if (new_level == old_level) { ch->ChatPacket (CHAT_TYPE_INFO, "<GM Control> The specified level is the SAME as the player's current level!"); return; } tch->ResetPoint (new_level); if (new_level < old_level) { //tch->ClearSkill(); // If you want to clear players current skills after the level downgrade, uncomment this line. - [MT2Dev Note] tch->ChatPacket (CHAT_TYPE_INFO, "<GM> Your level downgrade to %u", new_level); } else if (new_level > old_level) { tch->ChatPacket (CHAT_TYPE_INFO, "<GM> Your level increased to %u", new_level); } if (new_level < 50 && old_level >= 50) // Hard-coding for subskills, 50 because of the combo and horse skills.. - [MT2Dev Note] { tch->ClearSubSkill(); // If you don't want to clear players current subskills after the level downgrade under 50, comment this line. - [MT2Dev Note] } } // BULUNUR; ACMD (do_level) // KOMPLE DEĞİŞTİRİLİR; ACMD (do_level) // DevFix 53 { char arg1[256]; one_argument (argument, arg1, sizeof (arg1)); if (!*arg1) { ch->ChatPacket (CHAT_TYPE_INFO, "Syntax: /level <level>"); return; } unsigned char old_level = ch->GetLevel(); // DevFix 122 unsigned char new_level = 0; // DevFix 122 str_to_number (new_level, arg1); new_level = MINMAX (1, new_level, PLAYER_MAX_LEVEL_CONST); if (new_level == old_level) { ch->ChatPacket (CHAT_TYPE_INFO, "<GM Control> The specified level is the SAME as the your current level!"); return; } // This code use only allowed for GM chars, so we don't need to check or reset skills and subskills.. - [MT2Dev Note] ch->ChatPacket (CHAT_TYPE_INFO, "<GM> Your level set to %u", new_level); ch->ResetPoint (new_level); }
LLVM Obfuscation (LLVM Karartma veya Şifreleme)
LLVM, genellikle derleyici altyapısı olarak bilinir. Ancak aynı zamanda güçlü bir karartma (obfuscation) altyapısı sunar. Özellikle gizlilik ve güvenlik gerektiren projelerde LLVM Obfuscation, kodun okunabilirliğini düşürerek tersine mühendisliği zorlaştırır. Bu özellikle Metin2 gibi özel sunucuların geliştirildiği sistemlerde, kaynak kodların korunması açısından büyük önem taşır. Bu yazıda LLVM Obfuscation nedir, nasıl çalışır ve Metin2 özel sunucu geliştirme süreçlerinde nasıl kullanılabilir detaylıca ele alınacaktır.
LLVM Obfuscation Nedir?
LLVM Obfuscation, LLVM tabanlı derleme sürecinde kodun anlaşılmasını zorlaştırmak amacıyla uygulanan teknikler bütünüdür. Bu teknikler sayesinde C, C++, Python gibi dillerde yazılmış kaynak kodlar derlenirken karıştırılır ve orijinal yapıyı koruyamaz hale gelir. Bu işlem, kodun çalışabilirliğini etkilemeden, içeriğinin okunabilirliğini azaltır.
Neden LLVM Obfuscation Kullanılır?
Güvenlik: Kodun dış dünyaya açılması, özellikle oyun sunucularında ciddi güvenlik açıklarına neden olabilir. Bu nedenle karartma işlemleriyle kodun dışarıdan analiz edilmesi zorlaştırılır.
Lisans Koruma: Özel sunucular için geliştirilen sistemlerin çoğaltılması engellenmek istendiğinde LLVM Obfuscation tercih edilir.
Tersine Mühendislik Engeli: Oyun sunucuları, bazı saldırganlar tarafından incelenip açıklar aranabilir. Karartılmış kodlarla bu tür tehditler minimize edilir.
LLVM Obfuscation Nasıl Çalışır?
LLVM Obfuscation, LLVM IR (Intermediate Representation) seviyesinde uygulanır. Yani kod henüz makine diline çevrilmeden, ara temsilde manipülasyon yapılır. Bu seviyede uygulanan işlemler hem yüksek düzey dilde hem de düşük seviyede anlamlıdır. LLVM IR üzerinde uygulanan karartma teknikleri şunlardır:
- Control Flow Flattening: Kodun akış yapısını parçalayıp karmaşık hale getirir. Orijinal kontrol yapısı bozulur.
- Instruction Substitution: Belirli komutları başka komutlarla değiştirerek kodun anlamını gizlemeye çalışır.
- Bogus Control Flow: Kodun içinde sahte dallanmalar ekleyerek analizcileri yanıltır.
Metin2 Geliştirme Sürecinde LLVM Obfuscation
Metin2 özel sunucularında kullanılan C++ tabanlı sistemlerde, LLVM Obfuscation ile oyun sunucusu kaynak kodlarının korunması mümkündür. Özellikle game server ve auth server gibi kritik bileşenlerde bu yöntemler büyük fayda sağlar. Örneğin, PvP sistemlerinde kullanılan özel algoritmalar ya da DB bağlantı süreçleri LLVM karartmasıyla korunabilir.
Python GUI Uygulamalarında LLVM Obfuscation
Metin2 geliştirme sürecinde Python GUI tabanlı yönetim panelleri veya script sistemleri de olabilir. Bu tür sistemlerin PY dosyaları doğrudan okunabilir durumdaysa, LLVM Obfuscation yardımıyla bu içerikler daha güvenli hale getirilebilir. Elbette Python doğası gereği LLVM üzerinde doğrudan derlenmez ama PyInstaller gibi araçlarla derlenen uygulamalarda LLVM karartması uygulanabilir.
Obfuscation Uygularken Nelere Dikkat Etmeliyiz?
Performans Etkisi: Bazı karartma yöntemleri performansı düşürebilir. Özellikle sunucu taraflı sistemlerde bu dikkatle yönetilmelidir.
Debugging Zorluğu: Karartılmış kodlar üzerinde hata ayıklama işlemleri zorlaşabilir. Bu nedenle sadece üretim ortamında kullanılmalıdır.
Derleme Süreci: LLVM Obfuscation, derleme sürecini uzatabilir. Geliştirme süreçlerinde bu göz önünde bulundurulmalıdır.
LLVM Obfuscation Araçları
LLVM Obfuscation için bazı açık kaynak araçlar mevcuttur. Bunlardan bazıları şunlardır:
-
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
: En popüler LLVM karartma araçlarından biridir. Farklı obfuskasyon teknikleri sunar.-
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
: LLVM tabanlı sistemlerde kullanılan gelişmiş karartma örnekleri içerir.Sonuç
LLVM Obfuscation, özellikle Metin2 gibi özel sunucuların geliştirildiği sistemlerde kritik bir güvenlik ve gizlilik aracıdır. Kodun anlamını koruyarak okunabilirliğini zorlaştırması sayesinde, saldırganların tersine mühendislik yapmasını ciddi derecede zorlaştırır. Geliştiriciler, bu yöntemi doğru kullanarak sunucu sistemlerini daha güvenli hale getirebilirler.
LLVM Obfuscation (LLVM Obfuscation or Encryption)
LLVM is commonly known as a compiler infrastructure. However, it also provides a powerful obfuscation framework. In projects requiring privacy and security, LLVM Obfuscation reduces readability of code and makes reverse engineering more difficult. This is particularly important in systems like Metin2 private servers where source code protection is essential. This article will explain what LLVM Obfuscation is, how it works, and how it can be used within Metin2 private server development processes in detail.
What is LLVM Obfuscation?
LLVM Obfuscation is a set of techniques applied during the LLVM-based compilation process to obscure the readability of code. These techniques scramble source codes written in languages such as C, C++, and Python while compiling, making the original structure unrecognizable. This process reduces readability without affecting the functionality of the code.
Why is LLVM Obfuscation Used?
Security: Opening up code to the public can lead to serious security vulnerabilities, especially in game servers. Therefore, obfuscation techniques make external analysis of the code more difficult.
License Protection: When duplication of custom systems developed for private servers needs to be prevented, LLVM Obfuscation is preferred.
Reverse Engineering Barrier: Game servers may be analyzed by attackers looking for vulnerabilities. Obfuscated code minimizes such threats.
How Does LLVM Obfuscation Work?
LLVM Obfuscation is applied at the LLVM IR (Intermediate Representation) level. Before the code is converted into machine language, manipulation occurs at the intermediate representation stage. The obfuscation techniques applied at this level are meaningful both in high-level and low-level contexts. The obfuscation techniques applied on LLVM IR include:
- Control Flow Flattening: Breaks and complicates the flow structure of the code, disrupting the original control flow.
- Instruction Substitution: Replaces certain instructions with others to hide the meaning of the code.
- Bogus Control Flow: Adds fake branches inside the code to mislead analysts.
LLVM Obfuscation in Metin2 Development Process
In C++ based systems used in Metin2 private servers, LLVM Obfuscation can protect game server source codes. Especially critical components like game server and auth server benefit significantly from these methods. For example, special algorithms used in PvP systems or database connection processes can be protected through LLVM obfuscation.
LLVM Obfuscation in Python GUI Applications
In the Metin2 development process, there might be Python GUI based management panels or script systems. If the PY files of such systems are readable, LLVM Obfuscation can help secure them. Although Python does not directly compile on LLVM by nature, obfuscation can be applied to executables created via tools like PyInstaller.
What Should We Pay Attention To While Applying Obfuscation?
Performance Impact: Some obfuscation methods can reduce performance. This must be carefully managed, especially in server-side systems.
Debugging Difficulty: Debugging obfuscated code can become harder. Therefore, obfuscation should only be used in production environments.
Compilation Process: LLVM Obfuscation can extend the compilation time. This must be taken into account during development cycles.
LLVM Obfuscation Tools
There are some open-source tools available for LLVM Obfuscation. Some of them include:
-
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
: One of the most popular LLVM obfuscation tools, offering various obfuscation techniques.-
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
: Includes advanced obfuscation examples used in LLVM-based systems.Conclusion
LLVM Obfuscation is a critical security and privacy tool, especially in systems like Metin2 private servers. By preserving the meaning of the code while reducing its readability, it significantly hinders reverse engineering attempts by attackers. Developers can use this method correctly to enhance the security of their server systems.
