Darn's KalOnline C++ Library

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    (293692665344 >> 8) Darn is offline
    MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    My KalOnline C++ Library

    hey Folks,
    today i wanna share my Library with all of you.

    how to use it?
    Download the .rar of the lib.
    unpack it where you wanna store it. @Visual studio open up your project
    go to Project properties and link the include/Lib directory at "C++ directorys" to the Include/Lib folder you'
    ve just downloaded

    after that link the .lib file in your project by using:
    #pragma comment(lib, "LunaLib.lib")

    and include the header you wanna use for example:
    #include <KPlayer.h>
    #include <KServer.h>

    example what you could do with thease:
    Code:
    	void __fastcall LevelUp(int* Playerptr, int* edx){
    			UNREFERENCED_PARAMETER(edx);
    			auto_ptr<KServer> Server;
    			auto_ptr<KPlayer> Player(new KPlayer(Playerptr));
    
    			if (LevelEnabled){
    				Player->Levelup(LevelInc, LevelStatInc, LevelSkillInc);
    			}
    			else{ Player->Levelup(1, 5, 1); }
    
    
    			if (LevelNoticeEnabled && Player->GetLevel() >= LevelNoticeStartLevel){
    				if (!LevelNoticeType.compare("Lord_Red")){ Server->SetScreenInfo(ScreenInfoType::Red, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
    				else if (!LevelNoticeType.compare("Lord_Blue")){ Server->SetScreenInfo(ScreenInfoType::Blue, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
    				else if (!LevelNoticeType.compare("Lord_Orange")){ Server->SetScreenInfo(ScreenInfoType::Orange, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
    				else if (!LevelNoticeType.compare("Notice")){ Server->Notice(RGB(LevelNoticeColorR, LevelNoticeColorG, LevelNoticeColorB), Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
    			}
    
    			if (LevelBuffEnabled){ Player->InsertBuff(LevelBuffID, LevelBuffTime, LevelBuffInc); }
    
    		}
    wanna summon a monster?
    Code:
    #include  <KSummon.h>
    auto_ptr<KSummon> Summon;
    
    Summon->Monster(Index, X, Y, Map, Amount);
    Move to a player:
    Code:
    if (command->beginWith("/moveto") && this->player->GetAdmin() >= ComMoveto){
    		this->SetForward(false);
    		int targetm = (0);
    		int targetx = (0);
    		int targety = (0);
    
    		string _TargetName = this->command->GetStrValue(1);
    		const char* TargetName = this->server->string_to_char(_TargetName);
    
    		if(TargetName){
    			int *TargetPointer = (int*)Server::CPlayer::FindPlayerbyName(TargetName);
    			auto_ptr<KPlayer> _target(new KPlayer(TargetPointer));
    			if(_target->isGood()){
    				targetm = (_target->GetMap());
    				targetx = (_target->GetX());
    				targety = (_target->GetY());
    				this->player->Teleport(false, targetm, targetx, targety);
    				this->player->InfoMessage(TextColor::GREEN_YELLOW, "Moved to %s", _target->GetName());
    			}
    			else{
    				this->player->InfoMessage(TextColor::RED, "The selected player is offline or doesn't exist.");
    			}
    		}
    	}
    and there is alot more.

    DownloadLink

    Source
    Last edited by Darn; 23-12-17 at 08:27 PM. Reason: Download Link Update, Source Added


  2. #2
    (293692665344 >> 8) Darn is offline
    MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Darn's KalOnline C++ Library

    More Examples:

    Project properties Linker -> Input -> Module Definition File -> gdi32.def for Server.....version.def for Engine exports.
    Code:
    #include <KTools.h>
    #include <LunaCore.h>
    
    BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
    {
    	std::auto_ptr<LunaCore> Core(new LunaCore());
    	std::auto_ptr<IMemory> Memory(new IMemory());
    
            //Server Exports
    	Core->Init(ul_reason_for_call, EXPORTS_TYPE::_SERVER);
            
            //Engine Exports
            //Core->Init(ul_reason_for_call, EXPORTS_TYPE::_CLIENT);
    
            //Detour
    	Core->Register(&(PVOID&)Server::CIOServer::Start, Hooks::CIOServer::Start);
    	Core->Register(&(PVOID&)Server::CPlayer::ChatCommand, Hooks::CPlayer::ChatCommand);
    	Core->Register(&(PVOID&)Server::CItem::Use, Hooks::CItem::Use);
    
           //Intercept
    	Core->RegisterIntercept(IMemory::_I_CALL, (void*)0x000000, Hooks::CMonster::XXXX, 6);
    
            //speed hack message
    	Memory->Fill(0x00494A0E, IMemory::_I_NOP, 5);
    	Memory->Fill(0x00494A90, IMemory::_I_NOP, 5);
    
    	//egggrade no limit
    	Memory->Fill(0x0042F215, IMemory::_I_NOP, 5);
    
    	return Core->Run();
    }
    Main server Replace GDI32.dll with your dll name
    Engine Replace Version.dll 2 times

  3. #3
    Account Upgraded | Title Enabled! GallantS is offline
    MemberRank
    May 2015 Join Date
    448Posts

    Re: Darn's KalOnline C++ Library

    thanks alot :) , helped me too much
    u had released some months ago i guess , a boss timer or something like that , i've been searching for it , on google but no results found

  4. #4
    (293692665344 >> 8) Darn is offline
    MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Darn's KalOnline C++ Library

    Quote Originally Posted by GallantS View Post
    thanks alot :) , helped me too much
    u had released some months ago i guess , a boss timer or something like that , i've been searching for it , on google but no results found
    Tooked me less than 10sec. To find this link on google...
    https://forum.ragezone.com/f315/boss...-timer-969825/

  5. #5
    Account Upgraded | Title Enabled! GallantS is offline
    MemberRank
    May 2015 Join Date
    448Posts

    Re: Darn's KalOnline C++ Library

    honestly , i kept writing (Kalonline Boss ragezone) , (kalonline timer ragezone) and both were sending me to normal kalonline ragezone
    thanks alot <3 ;)

  6. #6

    Re: Darn's KalOnline C++ Library

    https://www.google.de/webhp?sourceid...oss+timer+darn :D second link haha
    Next time you search for something, try to include the name of the author and most infos you got..

  7. #7
    Account Upgraded | Title Enabled! GallantS is offline
    MemberRank
    May 2015 Join Date
    448Posts

    Re: Darn's KalOnline C++ Library

    Quote Originally Posted by strik3r2k5 View Post
    https://www.google.de/webhp?sourceid...oss+timer+darn :D second link haha
    Next time you search for something, try to include the name of the author and most infos you got..
    honestly , i didn't remember the name of the thread so xD

  8. #8
    Apprentice GuiLin is offline
    MemberRank
    Nov 2017 Join Date
    9Posts

    Re: Darn's KalOnline C++ Library

    @Darn you can upload this 2 <KConfig.h>++<KConfig.cpp> file?

  9. #9
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    93Posts

    Re: Darn's KalOnline C++ Library

    Dead link

  10. #10
    kalonline.ovh R3volutioN is offline
    MemberRank
    Sep 2008 Join Date
    kalonline.ovhLocation
    229Posts

    Re: Darn's KalOnline C++ Library

    Last edited by Valkyrie; 20-12-17 at 07:02 AM. Reason: Cleanup

  11. #11
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    93Posts

    Re: Darn's KalOnline C++ Library

    What am I doing wrong?

    Code:
    #pragma comment(lib, "detours.lib")#pragma comment(lib, "LunaLib.lib")#undef UNICODE#include <cstdio>#include <windows.h>#include <detours.h> #include <process.h>#pragma pack(1)#include <KServer.h>//Our hooked Server Start functionvoid __stdcall Hooked_Start(int start){    Server::CIOServer::Start(start); //Call normal Server start, if we wont do this, the server dont start    Server::Console::WriteBlue("Hello World");    // Call Print Function after Server Start we should see an Hello World in Blue on Console                        }BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ){    switch (ul_reason_for_call)    {    case DLL_PROCESS_ATTACH:        {            DetourTransactionBegin();            DetourUpdateThread(GetCurrentThread());            DetourAttach(&(PVOID&)Start, Hooked_Start);            //Insert our function into Mainserver            DetourTransactionCommit();            break;        }    case DLL_PROCESS_DETACH:        {            DetourTransactionBegin();            DetourUpdateThread(GetCurrentThread());            DetourDetach(&(PVOID&)Start, Hooked_Start);            //Detach our function            DetourTransactionCommit();            break;        }    }    return TRUE;}
    Error:

    'Start' undeclared identifier

    The problem is here
    DetourAttach(&(PVOID&)Start, Hooked_Start);


    edit: figured it out as soon as i posted this....
    Last edited by Itutorial; 21-12-17 at 05:26 AM.

  12. #12
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    93Posts

    Re: Darn's KalOnline C++ Library

    Why cant I do this?

    Code:
    // dllmain.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
    #include <Windows.h>
    #include <vector>
    #include <io.h>
    #include <fcntl.h>
    #include <fstream>
    #include <iostream>
    #include <string>
    
    
    #pragma comment(lib, "LunaLib.lib")
    #include <KServer.h>
    #include <KPlayer.h>
    #include <KItem.h>
    #include <LunaCore.h>
    
    
    #pragma pack(1)
    
    
    
    
    struct SItem {
        int Index;
        int Str;
        int Hp;
        int Int;
        int Wis;
        int Agi;
        int Pwr;
        int Explo;
        int PerEva;
        int PerDef;
        int DmgRed;
        int Acc;
        int Eva;
        int Spd;
        int Seconds;
    };
    
    
    std::vector<SItem> SItemVec;
    
    
    void __fastcall hook_Use(int* itemptr, int* playerptr){
    
    
        auto_ptr<KServer> Server;
        auto_ptr<KPlayer> Player(new KPlayer(playerptr));
        auto_ptr<KItem> Item(new KItem(itemptr));
    
    
        if(Player->GetUID()){
    
    
        std::ifstream spawnitem;
        spawnitem.open("BuffItems.txt");
        std::string strTemp;
        std::string line;
        if(spawnitem.is_open())
        {
            while (std::getline(spawnitem,line,'(').good())
            {
                    SItem buffItem;
                    spawnitem >> strTemp >> buffItem.Index >> strTemp >> buffItem.Str >> strTemp >> buffItem.Hp >> strTemp >> buffItem.Int >> strTemp >> buffItem.Wis 
                    >> strTemp >> buffItem.Agi >> strTemp >> buffItem.Pwr >> strTemp >> buffItem.Explo >> strTemp >> buffItem.PerEva >> strTemp >> buffItem.PerDef >> strTemp >> buffItem.DmgRed >> 
                    strTemp >> buffItem.Acc >> strTemp >> buffItem.Eva >> strTemp >> buffItem.Spd >> strTemp >> buffItem.Seconds;
                    SItemVec.push_back(buffItem);
            }
        }
        spawnitem.close();
    
    
        for(std::vector<SItem>::iterator it = SItemVec.begin(); it != SItemVec.end(); ++it) 
        {
    
    
            if(Item->GetIndex() == it->Index) {
                int strInt1 = 60;
                int hpInt1 = 61;
                int intInt1 = 62;
                int wisInt1 = 63;
                int agiInt1 = 64;
                int pwrInt1 = 51;
                int exploInt1 = 54;
                int perdefInt1 = 58;
                int perevaInt1 = 57;
                int dmgredInt1 = 52;
                int accInt1 = 56;
                int evaInt1 = 57;
                int spdInt1 = 12;
    
    
                int strInt2 = 0;
                int hpInt2 = 0;
                int intInt2 = 0;
                int wisInt2 = 0;
                int agiInt2 = 0;
                int pwrInt2 = 0;
                int exploInt2 = 0;
                int perdefInt2 = 0;
                int perevaInt2 = 0;
                int dmgredInt2 = 0;
                int accInt2 = 0;
                int evaInt2 = 0;
                int spdInt2 = 60;
    
    
                int BUFF1 = Server::CChar::CreateBuff(strInt1, it->Seconds, it->Str, strInt2);
                int BUFF2 = Server::CChar::CreateBuff(hpInt1, it->Seconds, it->Str, hpInt2);
                int BUFF3 = Server::CChar::CreateBuff(intInt1, it->Seconds, it->Str, intInt2);
                int BUFF4 = Server::CChar::CreateBuff(wisInt1, it->Seconds, it->Str, wisInt2);
                int BUFF5 = Server::CChar::CreateBuff(agiInt1, it->Seconds, it->Str, agiInt2);
                int BUFF6 = Server::CChar::CreateBuff(pwrInt1, it->Seconds, it->Str, pwrInt2);
                int BUFF7 = Server::CChar::CreateBuff(exploInt1, it->Seconds, it->Str, exploInt2);
                int BUFF8 = Server::CChar::CreateBuff(perdefInt1, it->Seconds, it->Str, perdefInt2);
                int BUFF9 = Server::CChar::CreateBuff(perevaInt1, it->Seconds, it->Str, perevaInt2);
                int BUFF10 = Server::CChar::CreateBuff(dmgredInt1, it->Seconds, it->Str, dmgredInt2);
                int BUFF11 = Server::CChar::CreateBuff(accInt1, it->Seconds, it->Str, accInt2);
                int BUFF12 = Server::CChar::CreateBuff(evaInt1, it->Seconds, it->Str, evaInt2);
                int BUFF13 = Server::CChar::CreateBuff(spdInt1, it->Seconds, it->Str, spdInt2);
    
    
                Server::CPlayer::AddBuff(playerptr, BUFF1);
                Server::CPlayer::AddBuff(playerptr, BUFF2);
                Server::CPlayer::AddBuff(playerptr, BUFF3);
                Server::CPlayer::AddBuff(playerptr, BUFF4);
                Server::CPlayer::AddBuff(playerptr, BUFF5);
                Server::CPlayer::AddBuff(playerptr, BUFF6);
                Server::CPlayer::AddBuff(playerptr, BUFF7);
                Server::CPlayer::AddBuff(playerptr, BUFF8);
                Server::CPlayer::AddBuff(playerptr, BUFF9);
                Server::CPlayer::AddBuff(playerptr, BUFF10);
                Server::CPlayer::AddBuff(playerptr, BUFF11);
                Server::CPlayer::AddBuff(playerptr, BUFF12);
                Server::CPlayer::AddBuff(playerptr, BUFF13);
            }
        }
        }
    }
    
    
    BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
    {
        std::auto_ptr<LunaCore> Core(new LunaCore());
        std::auto_ptr<IMemory> Memory(new IMemory());
    
    
            //Server Exports
            Core->Init(ul_reason_for_call, EXPORTS_TYPE::_SERVER);
            
            //Engine Exports
            //Core->Init(ul_reason_for_call, EXPORTS_TYPE::_CLIENT);
    
    
        //Detour
        Core->Register(&(PVOID&)Server::CItem::Use, hook_Use);
    
    
        //Intercept
        Core->RegisterIntercept(IMemory::_I_CALL, (void*)0x0042CFB0, hook_Use, 2);
    
    
        //speed hack message
        Memory->Fill(0x00494A0E, IMemory::_I_NOP, 5);
        Memory->Fill(0x00494A90, IMemory::_I_NOP, 5);
    
    
        //egggrade no limit
        Memory->Fill(0x0042F215, IMemory::_I_NOP, 5);
    
    
        return Core->Run();
    }
    Here is my error.
    fatal error C1007: unrecognized flag '-sdlMode' in 'p2'
    Doesn't tell me shit.

  13. #13
    (293692665344 >> 8) Darn is offline
    MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Darn's KalOnline C++ Library

    Source added
    DownloadLink

  14. #14
    Account Upgraded | Title Enabled! UlyssesUlric is offline
    MemberRank
    Mar 2014 Join Date
    my own businessLocation
    234Posts

    Re: Darn's KalOnline C++ Library

    I do not know how to thank you Clicking Likes button is not enough

  15. #15

    Re: Darn's KalOnline C++ Library

    Found something old, might be useful for some people..
    Save as whatever.idc and load it with IDA. It will add some Function names...
    https://pastebin.com/YtLn8ZKn



Page 1 of 2 12 LastLast

Advertisement