Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial] How to Detour the Kal Mainserver

Status
Not open for further replies.
Joined
Mar 10, 2010
Messages
909
Reaction score
237
just do it like . DETOURS:

Code:
#pragma comment(lib,"Detours/detours.lib")
#undef UNICODE
#include "Detours/detours.h"

#pragma pack(1)
 
Junior Spellweaver
Joined
Nov 1, 2009
Messages
198
Reaction score
5
@spatti88 ,i already downloaded this files , do i have to edit VC++ Directories ( Include Directories& Library Directories ) as MadKnight said?
i installed Detours - Microsoft Research or it's usless now? , and where should i put extracted Detours.rar files
 
Newbie Spellweaver
Joined
Aug 24, 2013
Messages
27
Reaction score
7
Someone knows why i can't compile the Detours 3.0?

I've got VS 2012..

Everytime i try to compile i get "NMAKE: fatal error U1077

I've made everything that was explained in this thread
 
Newbie Spellweaver
Joined
Sep 16, 2009
Messages
62
Reaction score
5
hello, I ask anybody if can give us a full skill (although one) to show how exacly it should look like, for example: sword dance (heard its easiest one) with full source code (*.h, *.cpp files) not only a part of it. I need it only to create own skills for my server (I will never make it for ppls just for fun). Only one skill to copy and paste. I tried serveral times to create a skill but always got animation without damage, server crash or simply cooldown without any reacion.
 
Skilled Illusionist
Joined
Mar 20, 2009
Messages
374
Reaction score
378
int itemnum = ((int*) itempointer)[13];

So just search for the question marks : )
int itemid = ((int*) itempointer)[?];
int itemprefix = ((int*) itempointer)[?];
int itemattributyouwant = ((int*) itempointer)[?];

Another Method to find those Attributes is to watch on the Console Writes:
Example:

Console__Write(
"Excess of Item Num : PID(%d), Index(%d), IID(%d), Num(%d), AddNum(%d)",
*(_DWORD *)(this + 32),
*(_DWORD *)(*(_DWORD *)(this + 40) + 64),
*(_DWORD *)(this + 36),
*(_DWORD *)(this + 52),
a2);

So now we know what Item PID, Index, IID, Num is.
As you can see Item Num is declare as *(_DWORD *)(this + 52), but this is simliar to
int itemnum = ((int*) itempointer)[13];, because +52 indicates 52 x 1 Byte shift and we make
13 x 4 Byte poop : )
So Item PID would be 32/4 = 8 (8 x 4 byte shifts [8])


i wanna get the used item index.

*(_DWORD *)(*(_DWORD *)(this + 40) + 64)
as far as i know that means the "this" pointer got at +40 another pointer witch i have to shift 64 bytes to get the item index

but how i do that ?

((int*) itempointer)[10][16];//10x4 bytes and 16x4 bytes
this isnt working.
 
Modeler / C++ Coder
Developer
Joined
Feb 6, 2008
Messages
561
Reaction score
483
i wanna get the used item index.

*(_DWORD *)(*(_DWORD *)(this + 40) + 64)
as far as i know that means the "this" pointer got at +40 another pointer witch i have to shift 64 bytes to get the item index

but how i do that ?

((int*) itempointer)[10][16];//10x4 bytes and 16x4 bytes
this isnt working.
you where searching for this :) ((int*)itemptr[10])[16] <--
 
Newbie Spellweaver
Joined
Oct 20, 2007
Messages
28
Reaction score
2
i did all right step by step but i get any error if i want to release my .dll
he tell me:

1>dllmain.cpp(5): fatal error C1083: Data (Include) can't be open: "cstdio": No such file or directory

what i did wrong :S? anyone can help me ^^?
 
Junior Spellweaver
Joined
Jun 5, 2011
Messages
180
Reaction score
205
There can be a lot of reasons:
1. You're using CPlayer::Damage :D
2. You're using only WriteInSight to display and mistaked targetid with playerid.

It's hard to say more, because you didn't give enough info.
 
Newbie Spellweaver
Joined
Sep 16, 2009
Messages
62
Reaction score
5
int __fastcall Knight_SwordDance(void* PlayerPointer, char* PacketPointer, char* PositionPointer)
{

const int nSkillID = 43;
const int nSkillGrade = 1;

int result;
int TargetId;
char Type;
void* PlayerID = 0;
void* TargetID = 0;
void* MonsterID = 0;
int nDmg = 0;

Server::CIOServer::ReadPacket(PacketPointer, PositionPointer, "bd", &Type, &TargetId);
void *MonsterPointer = Server::CMonster::FindMonster(TargetId);
Monster *monster = new Monster(MonsterPointer);
KPlayer *player = new KPlayer(PlayerPointer);
result = (int) MonsterPointer;


if(MonsterPointer)
{

nDmg = 99;

(*(void (__cdecl **)(void*, int, int, int))(*(DWORD*)MonsterPointer+0x58))(MonsterPointer, 7, 0, nDmg);

PlayerID = Server::CBase::Id(PlayerPointer);
Server::CChar::WriteInSight(PlayerPointer, 0x3f, "bddbbwwb", nSkillID, PlayerID, PlayerID, 1, nSkillGrade, nDmg, 0, 1);


}

return result;
}

I only want create simple skill 4fun
 
Junior Spellweaver
Joined
Jun 5, 2011
Messages
180
Reaction score
205
1. You shouldn't use things that you don't understand and when it's not necessary.
2. This is not true function call to deal damage. Analyze existing skill function to get it.

Use it as a base:


Look at MadKnight's posts, he posted shield offense pseudo code with renamed variables etc.
 
Newbie Spellweaver
Joined
Sep 16, 2009
Messages
62
Reaction score
5
Yes you are right but with your Main it doesnt show red errors - cant find skill ID. Thanks :) sry for bothering
Can You reupload please?
 
Last edited:
Elite Diviner
Joined
Feb 8, 2012
Messages
439
Reaction score
867
Some people have problems to get into the Reverse Engineering and maybe i am not the best Teacher : ) ..
but i saw some Youtube Vids today, wich should be usefull for beginners.
I recommend to watch these 3 Vids:





 
Experienced Elementalist
Joined
Oct 9, 2012
Messages
282
Reaction score
77
some1 can give me a example for realtime pimp please?^^
 
Status
Not open for further replies.
Back
Top