Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 21:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Get list of mobs around player for waithack!

Discussion on Get list of mobs around player for waithack! within the Metin2 forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2021
Posts: 4
Received Thanks: 0
Get list of mobs around player for waithack!

Hello epvpers i want to know how to get the mob list around player in order to sendattackpacket them.
Code:
void SendAttackPacket(const uint8_t mode, const uint32_t vid)
		{
			
			
				typedef bool(__thiscall* tSendAttackPacket)(int, const uint8_t, const uint32_t);
				const auto fSendAttackPacket = reinterpret_cast<tSendAttackPacket>(SendBattle);

				if (fSendAttackPacket)
					fSendAttackPacket(*reinterpret_cast<uintptr_t*>(NetPointer), mode, vid);
			
		}
that's the sendattackpacket function
Localguest is offline  
Old 02/26/2021, 10:22   #2
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
As far as I remember, there is a vector or a map class-member of entities. If you found the memory address of this member, you are basically done.
MrCrisp is offline  
Thanks
1 User
Old 02/26/2021, 10:26   #3
 
elite*gold: 0
Join Date: Feb 2021
Posts: 4
Received Thanks: 0
Quote:
Originally Posted by MrCrisp View Post
As far as I remember, there is a vector or a map class-member of entities. If you found the memory address of this member, you are basically done.
TCharacterInstanceMap m_kAliveInstMap this one maybe?

and if i find the address i replace the targetvid with this?
Localguest is offline  
Old 02/26/2021, 10:39   #4
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Yes, this looks like the right one. But it not only contains monsters I believe.
The basic idea you would follow is to iterate over the map and only apply the SendAttackPacket to the instances that are of type monster. Keep in mind that you also might have to teleport yourself to the monster first, send the packet, and teleport back, since the server checks the attack range.
MrCrisp is offline  
Old 02/26/2021, 17:37   #5
 
elite*gold: 0
Join Date: Dec 2020
Posts: 47
Received Thanks: 25
Quote:
Originally Posted by Localguest View Post
TCharacterInstanceMap m_kAliveInstMap this one maybe?

and if i find the address i replace the targetvid with this?
no, its a map of DWORD, void* where void* ist actually a CInstanceBase if you have the source. You have to iterate over ever element in the map, get the dword and pass it to sendattackpacket. additionally, dont forget that you need to send the state packet if you want to attack mobs further away. you can use the CInstanceBase* to get the position of the monster, get the mob type (npc, player, mob, ..), isAlive and so on
ones-and-zer0es.mpeg is offline  
Thanks
2 Users
Old 02/26/2021, 17:59   #6
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Quote:
Originally Posted by ones-and-zer0es.mpeg View Post
no, its a map of DWORD, void* where void* ist actually a CInstanceBase if you have the source. You have to iterate over ever element in the map, get the dword and pass it to sendattackpacket. additionally, dont forget that you need to send the state packet if you want to attack mobs further away. you can use the CInstanceBase* to get the position of the monster, get the mob type (npc, player, mob, ..), isAlive and so on
That's the whole guide, described perfectly!
MrCrisp is offline  
Thanks
1 User
Old 02/26/2021, 18:08   #7
 
elite*gold: 0
Join Date: Jun 2009
Posts: 70
Received Thanks: 149
There are 3 ways of doing (as far as i know):
1 - Like said before, get the adrress of TCharacterInstanceMap m_kAliveInstMap which is a map of CINstanceBase and then get the offset of the position, keep in mind, you either need to code a map iterator that will handle the version of std::map used in the binary or pray for your compiler std::map to be compatible with the binary one.

2- Hook recive function, find the packet that recive each character and save the positions alongside their vids, keep in mind to use this, you also need convert global positions to local positions.

3- Hook Recive function, find the packet that recive each character and save only the vids, find the address of a function that given a vid returns the position (You can use the C equivalent to GetPixelPosition) and you will be left with a list of vids.


In my opinion, the 3rd option is the best, you don't have to deal with compiler diferences or reverse/code a map iterator.
martinx1 is offline  
Thanks
1 User
Old 02/26/2021, 18:09   #8
 
elite*gold: 0
Join Date: Feb 2021
Posts: 4
Received Thanks: 0
Quote:
Originally Posted by ones-and-zer0es.mpeg View Post
no, its a map of DWORD, void* where void* ist actually a CInstanceBase if you have the source. You have to iterate over ever element in the map, get the dword and pass it to sendattackpacket. additionally, dont forget that you need to send the state packet if you want to attack mobs further away. you can use the CInstanceBase* to get the position of the monster, get the mob type (npc, player, mob, ..), isAlive and so on
Sorry, i am dumb af and can't properly understand what i need to do, what CInstanceBase i need because i saw like 4 - 5 and when i find the right one i pass it in the function and it will work right?
Localguest is offline  
Old 02/26/2021, 18:38   #9
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Quote:
Originally Posted by Localguest View Post
Sorry, i am dumb af and can't properly understand what i need to do, what CInstanceBase i need because i saw like 4 - 5 and when i find the right one i pass it in the function and it will work right?
Maybe you should first start with some basics? It doesn't seem like you have enough knowledge to code that. He already explained it well enough.
MrCrisp is offline  
Old 02/26/2021, 18:46   #10
 
elite*gold: 0
Join Date: Feb 2021
Posts: 4
Received Thanks: 0
Wink

i only asked how to get the function not rocket science this
Quote:
Originally Posted by MrCrisp View Post
Maybe you should first start with some basics? It doesn't seem like you have enough knowledge to code that. He already explained it well enough.
doesnt help at all
Localguest is offline  
Old 02/26/2021, 21:38   #11
 
MrCrisp's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 747
Received Thanks: 184
Quote:
Originally Posted by Localguest View Post
i only asked how to get the function not rocket science this
doesnt help at all
But if you don't understand what one's-and-zeroes explained, you lack some knowledge. Therefore, you should start with simple things. I doubt that you know how to retrieve all elements in that map without knowing how to access that member at all.
Programming isn't about smashing code and not knowing what the code does and hope for it to work. In particular in reverse engineering (that's not even the case anymore since the source code got leaked a while now. One can just look everything up) you need to know how to access member variables, call or hook functions, know the correct calling conventions etc.
I read some questions here on the forums about how to get either the VIDs, or on how to send attack packets and so on. They all just don't know what they are doing and hope that someone gives them a code snippet. Learning how a program works and what is going under the hood would dismiss all the questions asked here on the forum. But people just want it the easy way.
MrCrisp is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
Send attack to multiple targets around player (WAITHACK)
09/27/2021 - Metin2 - 6 Replies
Hi, i want to do a waithack for p-servers but i dont know what to search for it, i dont know if i need the player pointer to take the attack range and mob pointer to kill them if they are in the range of player. I made a send attack to target and it works but i need this one too, if someone could help with some ideas Here's the send attack to target code: bool status = false; bool SendAtackPacket(int vId) { if (status == true)
[LIST] WarRock Privat Server List! [LIST]
07/27/2013 - WarRock - 46 Replies
http://archiv.so/images/2013/03/01/bQaXx.png Hallo elitepvpers Community! Da es in letzter Zeit viele unnötige Threads, mit Fragen zu guten Privat Servern gab, möchte ich es Neulingen (Newbies) etwas erleichern! Und das ganze soll durch diese Liste an mir bekannten WarRock P-Servern geschehen. Sollten euch noch weitere Server bekannt sein, schreibt den Thread-Link & Namen als Kommentar, damit ich diesen Server eventueller Weise auch noch rein editieren kann.
mobs around player
09/18/2011 - SRO Coding Corner - 4 Replies
how to capture packet for this event in silkroad? i dont think there is single opcode for this



All times are GMT +1. The time now is 21:59.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.