Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Kal Online
You last visited: Today at 08:30

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

Advertisement



Target Mob HP Pattern

Discussion on Target Mob HP Pattern within the Kal Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 17
Received Thanks: 4
Target Mob HP Pattern

Hey guys,

i am currently looking for the memory pattern for the current HP of the targeted mob after i pressed TAB inside of the game. I already found the PlayerHP and Coordinates patterns in old sources and got that to work.

Unfortunately i was not able to get the target mob current hp yet because of XTrap. Does anyone by any chance have the pattern somewhere and might post it for me?

Thanks very much for your help!

Kind regards!
LastKingOfHell is offline  
Old 07/14/2019, 00:01   #2
 
HighGamer.'s Avatar
 
elite*gold: 0
Join Date: May 2014
Posts: 1,599
Received Thanks: 719
I know the best person to ask

Add on Discord:
awwy#5877

tell him HighGamer.com sent you lol he is a master at memory patterns in kalonline he knows all of them he will tell you.

If you run the Experimental bot i released in the release section it generates a dinput8.log file with the current offsets

Code:
Detected KGameSysAddChattingMessage = 6DF2A0
Detected SetTargetById = 70BD30
Detected SetTargetAuto = 70BDE0
Detected FindCharacterInfo = 428460
Detected Send_Skill = 42E2A0
Detected Send_Item = 4321A0
Detected WritePacket = 64D480
Detected InitReactBattle m_byStart Address = 9EBE89
Detected InitReactBattle bLock Address = 9EBEB0
Detected InitReactBattle nTickCount Address = 9EBEAC
Detected MainBaseAddress = 901184
Detected PlayerXOffset = 46E0
Detected PlayerYOffset = 46E8
Detected PlayerZOffset = 46E4
Detected MonsterArray 0x8E81B8 = 9011B8
Detected IsMonsterAddressOffset = 46D8
Detected MonsterMinHPOffset = 475C
Detected MonsterMaxHPOffset = 4760
Detected MonsterXCoordinateOffset = 46E0
Detected MonsterYCoordinateOffset = 46E8
InventoryItemsArray = 9EA418
Detected myPlayerCurrentHealthXorKey1 = 9EA560
Detected myPlayerCurrentHealthXorKey2 = 901218
Detected myPlayerCurrentHealthMax = 9EA284
You will need to get the index of Current Targetted monster yourself it always changes the address of the current monster if you add to it 0x475C that will be the current health

The current targetted monster addresses are found in the MonsterArray address if you look in memory view you will see a bunch of monster addresses there.. you'll find the first 3 by doing 0xC offset and the rest are seperated by 0x20 offset.

Code:
int GetMonsterIdByIndex(int index)
{
	int id = 0;
	__try {
		int pMonsterArray = *(unsigned int *)MonsterArray;
		if (pMonsterArray) {
		        if(index < 3) {
				int firstMob = *(unsigned int*)(pMonsterArray + (index * 4));
				if (firstMob) {
					id = *(unsigned int *)(firstMob + 0xC);
				}
			} else {
				unsigned int firstMob = *(unsigned int*)(pMonsterArray + (0 * 4));
				
				if (firstMob) {
					id = *(unsigned int *)(firstMob + (0x0C) + ((index-3) * 0x20));
				}
			}
		}
	}
	__except (EXCEPTION_EXECUTE_HANDLER)
	{
		id = 0;
	}
	return id;
}
Code:
int GetMonsterMinHP(int byMonsterId)
{
	__try {
		int newid = FindCharacterInfo(byMonsterId, 0);
		if (newid > 0) {
			return *(DWORD *)(newid + MonsterMinHPOffset);
		}
	}
	__except (EXCEPTION_EXECUTE_HANDLER)
	{
		return 0;
	}
	return 0;
}

int GetMonsterMaxHP(int byMonsterId)
{
	__try {
		int newid = FindCharacterInfo(byMonsterId, 0);
		if (newid > 0) {
			return *(DWORD *)(newid + MonsterMaxHPOffset);
		}
	}
	__except (EXCEPTION_EXECUTE_HANDLER)
	{
		return 0;
	}
	return 0;
}

int GetMonsterXCoordinate(int byMonsterId)
{
	__try {
		int newid = FindCharacterInfo(byMonsterId, 0);
		if (newid > 0) {
			return *(DWORD *)(newid + MonsterXCoordinateOffset);
		}
	}
	__except (EXCEPTION_EXECUTE_HANDLER)
	{
		return 0;
	}
	return 0;
}

int GetMonsterYCoordinate(int byMonsterId)
{
	__try {
		int newid = FindCharacterInfo(byMonsterId, 0);
		if (newid > 0) {
			return *(DWORD *)(newid + MonsterYCoordinateOffset);
		}
	}
	__except (EXCEPTION_EXECUTE_HANDLER)
	{
		return 0;
	}
	return 0;
}

void SetMonsterXYCoordinateMyPlayer(int byMonsterId)
{
	__try {
		int newid = FindCharacterInfo(byMonsterId, 0);
		if (newid > 0) {
			*(float *)(newid + ScreenMonsterXCoordinateOffset) = GetPlayerScreenCoordinateX();
			*(float *)(newid + ScreenMonsterYCoordinateOffset) = GetPlayerScreenCoordinateY();
			*(DWORD *)(newid + MonsterXCoordinateOffset) = GetPlayerCoordinateX();
			*(DWORD *)(newid + MonsterYCoordinateOffset) = GetPlayerCoordinateY();
		}
	} __except (EXCEPTION_EXECUTE_HANDLER) {}
}
Code:
	MonsterArray = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\xa1\x00\x00\x00\x00\x89\x45\xec\x8b\x4d\xec\x8b\x11\x89\x55\xe8\xc7\x45\xf8\x00\x00\x00\x00", "x????xxxxxxxxxxxxxxxxxx", 1, true);
	if (MonsterArray) {
#ifdef DEBUGMODE
		Log("Detected MonsterArray 0x8E81B8 = %X\n", MonsterArray);
#endif
	}

	IsMonsterAddressOffset = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\xC7\x81\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x8B\x95\xD4\xFE\xFF\xFF\xC7\x82\x00\x00\x00\x00\x00\x00\x00\x00\x8B\x85\xD4\xFE\xFF\xFF\xC7\x80\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x8D\xD4\xFE\xFF\xFF\xC7\x81\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x95\xD4\xFE\xFF\xFF", "xx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxx", 2, true);
	if (IsMonsterAddressOffset) {
#ifdef DEBUGMODE
		Log("Detected IsMonsterAddressOffset = %X\n", IsMonsterAddressOffset);
#endif
	}

	MonsterMinHPOffset = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\xC7\x81\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x8B\x95\xD4\xFE\xFF\xFF\xC7\x82\x00\x00\x00\x00\x00\x00\x00\x00\x8B\x85\xD4\xFE\xFF\xFF\xC7\x80\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x8D\xD4\xFE\xFF\xFF\xC7\x81\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x95\xD4\xFE\xFF\xFF", "xx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxx", 34, true);
	if (MonsterMinHPOffset) {
#ifdef DEBUGMODE
		Log("Detected MonsterMinHPOffset = %X\n", MonsterMinHPOffset);
#endif
	}

	MonsterMaxHPOffset = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\xC7\x81\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x8B\x95\xD4\xFE\xFF\xFF\xC7\x82\x00\x00\x00\x00\x00\x00\x00\x00\x8B\x85\xD4\xFE\xFF\xFF\xC7\x80\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x8D\xD4\xFE\xFF\xFF\xC7\x81\x00\x00\x00\x00\x64\x00\x00\x00\x8B\x95\xD4\xFE\xFF\xFF", "xx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxxxx????xxxxxxxxxx", 50, true);
	if (MonsterMaxHPOffset) {
#ifdef DEBUGMODE
		Log("Detected MonsterMaxHPOffset = %X\n", MonsterMaxHPOffset);
#endif
	}

	MonsterXCoordinateOffset = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\x81\xC2\x00\x00\x00\x00\x89\x0A\x89\x4A\x04\x89\x4A\x08\x33\xC0", "xx????xxxxxxxxxx", 2, true);
	if (MonsterXCoordinateOffset) {
		MonsterYCoordinateOffset = MonsterXCoordinateOffset + 8;
#ifdef DEBUGMODE
		Log("Detected MonsterXCoordinateOffset = %X\n", MonsterXCoordinateOffset);
		Log("Detected MonsterYCoordinateOffset = %X\n", MonsterYCoordinateOffset);
#endif
	}


	ScreenMonsterXCoordinateOffset = PointerFindPattern(0x400000, 0x400000, (PBYTE)"\x81\xC1\x00\x00\x00\x00\x89\x01\x89\x41\x04\x89\x41\x08\x33\xD2", "xx????xxxxxxxxxx", 2, true);
	if (MonsterXCoordinateOffset) {
		ScreenMonsterYCoordinateOffset = ScreenMonsterXCoordinateOffset + 8;
#ifdef DEBUGMODE
		Log("Detected ScreenMonsterXCoordinateOffset = %X\n", ScreenMonsterXCoordinateOffset);
		Log("Detected ScreenMonsterYCoordinateOffset = %X\n", ScreenMonsterYCoordinateOffset);
#endif
	}
Code:
BOOL bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
	for (; *szMask; ++szMask, ++pData, ++bMask)
	{
		if (*szMask == 'x' && *pData != *bMask)
			return 0;
	}
	return (*szMask) == NULL;
}

DWORD PointerFindPattern(DWORD dwStartAddress, DWORD dwSize, BYTE *bMask, char * szMask, int codeOffset, BOOL extract)
{
	for (DWORD i = 0; i < dwSize; i++)
	{
		__try
		{
			if (bCompare((BYTE*)(dwStartAddress + i), bMask, szMask))
			{
				if (extract)
					return *(DWORD*)(dwStartAddress + i + codeOffset);
				else
					return  (DWORD)(dwStartAddress + i + codeOffset);
			}
		}
		__except (EXCEPTION_EXECUTE_HANDLER) {}
	}
	return NULL;
}
HighGamer. is offline  
Old 07/15/2019, 11:07   #3
 
elite*gold: 0
Join Date: Feb 2010
Posts: 17
Received Thanks: 4
Thank you very much for your help! It appears that that is a little bit too hard for me. I got my Mob HP Detection to work via Color Identification.

Kind regards
LastKingOfHell is offline  
Old 07/15/2019, 22:34   #4
 
HighGamer.'s Avatar
 
elite*gold: 0
Join Date: May 2014
Posts: 1,599
Received Thanks: 719
ya i would talk to

awwy#5877
on discord

pixel color getters isn't that great i would do this with memory editing you already got it done half way just keep at it.
HighGamer. is offline  
Reply


Similar Threads Similar Threads
[HOW TO] Mob proto.xml Mob Names - Mob Proto.txt Help me
03/25/2015 - Metin2 Private Server - 2 Replies
Hi Metin2 Dev Mob proto.xml How to Mob Names.txt - Mob Proto.txt Converts ? Help Me :( How Mob Names.txt - Mob Proto.txt ? help me :( <Mob vnum="34012" name="¾Æ±â ÆÒ´õ" locale_name="¾Æ±â ÆÒ´õ" type="1" rank="5" battle_type="0" level="1" size="0" gold_min="0" gold_max="0" exp="10" max_hp="120" regen_cycle="3" regen_percent="1" def="4" ai_flag="0" setRaceFlag="0" setImmuneFlag="43" st="0" dx="0" ht="0" iq="0" damage_min="0" damage_max="0" attack_speed="100" move_speed="100"...
WoW Hide My Target - Hide your target!
10/24/2010 - WoW Exploits, Hacks, Tools & Macros - 46 Replies
Voerst: Hier geht es um einen kleinen Hack, um euer Target zu verstecken. Andere werden euer aktuelles Target nicht mehr sehen. Dieser kleine Hack ist aus Langeweile entstanden, wenn ihr ihn also unnütz findet, steht es euch frei diesen Thread ohne jeglichen noch sinnloseren Kommentar zu verlassen, danke! Wie funktioniert der Hack? Code der verändert wrid in WoW: 00518E07 - 5 Bytes (0x90, 0x90, 0x90, 0x90, 0x90) 00524311 - 5 Bytes (0x90, 0x90, 0x90, 0x90, 0x90) 00528306 - 5 Bytes...
[Help] Invalid Target/Cannot find Target(ZSZC)
05/29/2010 - SRO Private Server - 4 Replies
Some write they have Problems with ZSZC SRO-DB, by mobs for example "Ishade/Penon/Ujigi(lvl50-56)", in the Textbox right side down a message: "Invalid Target" or " Cannot Find Target", All have this Problem, a good message, i have the solution! You need Use SRO-DB Bot V0.8 and NOT V0.9a! +++Use this and you will have Fun by Botting+++



All times are GMT +2. The time now is 08:30.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.