Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 12Sky2
You last visited: Today at 13:31

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

Advertisement



[Help] Finding current target in monster array

Discussion on [Help] Finding current target in monster array within the 12Sky2 forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2010
Posts: 623
Received Thanks: 175
[Help] Finding current target in monster array

Hey,

I have been trying to work out the skill attack packets in Waren Story the last couple of days. I have finally figured out the entire packet, but I need to update the current target ID in order to make it work.

I looked at where the game calls the function to attack and traced up a little bit and found this:

Code:
004F5748  |.  D95C24 44     

FSTP DWORD PTR SS:[ESP+44]
004F574C  |.  8B4424 48     

MOV EAX,DWORD PTR SS:[ESP

+48]
004F5750  |.  D980 2C152F02 

FLD DWORD PTR DS:[EAX

+22F152C]
004F5756  |.  8D4C24 28     

LEA ECX,DWORD PTR SS:[ESP

+28]
004F575A  |.  D84424 44     

FADD DWORD PTR SS:[ESP+44]
004F575E  |.  8D80 94022F02 

[B]LEA EAX,DWORD PTR DS:[EAX

+22F0294][/B]
0x22F0294 is the first Monster struct in the Array for mobs, somewhere in here when I put a breakpoint I get the address 0x6349C10, this address is about 100bytes away from the "Target" address witch is simply an address that reads 0xFFFFFFFF when no target(invalid target) and 1 when a valid target is selected(also has the current targets HP here).

If I put a breakpoint on the instruction in bold above, I instantly get the address of the current mob I have targeted.

Now given the information I have found above, anybody have any ideas how I can do this myself in C++, take the current target and find its placement in the monster array so that I can grab its ID and update my attack packets with them.

Any help would be greatly appreciated as always.
iktov2 is offline  
Old 04/16/2013, 13:16   #2
 
elite*gold: 0
Join Date: Nov 2010
Posts: 268
Received Thanks: 99
You could do a code cave, and just move eax into a variable that you created. That would probably work, then just add the +100 or whatever and you should have your address.
Rumil12 is offline  
Old 04/17/2013, 22:28   #3
 
elite*gold: 0
Join Date: Jul 2010
Posts: 623
Received Thanks: 175
Ah well, at this point in the code the game is only accessing it after the hit is completed. So the only way I would retrieve the ID of the target from this is by hitting the target first.

I need to match the Current Target to its position in the Monster array and grab its Unique ID before I hit it, so I can send its ID in the hit packet to make an auto-attacker(auto attack skills) using packets.

Basically what I am trying to figure out is the C++ equivalent of what is happening the ASM code above. I know its doing a loop through the Monster array here, what I can't figure out is what its comparing from the current target info to the monster array to find witch monster in the array is actually targeted. If you get my meaning.
iktov2 is offline  
Old 04/17/2013, 23:16   #4
 
elite*gold: 0
Join Date: Nov 2010
Posts: 268
Received Thanks: 99
Quote:
Originally Posted by iktov2 View Post
Ah well, at this point in the code the game is only accessing it after the hit is completed. So the only way I would retrieve the ID of the target from this is by hitting the target first.

I need to match the Current Target to its position in the Monster array and grab its Unique ID before I hit it, so I can send its ID in the hit packet to make an auto-attacker(auto attack skills) using packets.

Basically what I am trying to figure out is the C++ equivalent of what is happening the ASM code above. I know its doing a loop through the Monster array here, what I can't figure out is what its comparing from the current target info to the monster array to find witch monster in the array is actually targeted. If you get my meaning.
Could you post more of the code before and after? If this code is only executed after a mob is hit, then I think it would be fair to say that the target info was grabbed before this, and so is simply pointing back to the location in the mob array for the id at this point given that this code is only loading pointers. So I assume what you would then want to do is make your own pointer point to the same thing, correct?
Rumil12 is offline  
Old 04/18/2013, 00:42   #5
 
elite*gold: 0
Join Date: Jul 2010
Posts: 623
Received Thanks: 175
Quote:
Originally Posted by Rumil12 View Post
Could you post more of the code before and after? If this code is only executed after a mob is hit, then I think it would be fair to say that the target info was grabbed before this, and so is simply pointing back to the location in the mob array for the id at this point given that this code is only loading pointers. So I assume what you would then want to do is make your own pointer point to the same thing, correct?
I found another instance in the game client where it accesses the mob array for drawing the information for the Current Target Frame. In this instance I could do as you suggested with a code cave, but **** I would really like to figure out what the game is using to compare data with the current target and the mob array to decide witch entry in the mob array is the current target.

Something like:

Code:
for(int i = 0; i < 50; i++) //assuming 50 mobs in array
{
       int ID = mobarray[i].MobID;
       Target[ID]
}
I did something like the above with my loot filter for 12sky2 because the dropped item struct does not contain an entry for Rarity, so you had to compare the item on the ground to the ItemList to determine its Rarity. Just not certain how to do it in this case.
iktov2 is offline  
Old 04/18/2013, 01:29   #6
 
elite*gold: 0
Join Date: Nov 2010
Posts: 268
Received Thanks: 99
It is possible that when the mob is targeted, a flag is set inside the Mob array.

Look around in that new instance you were talking about for a cmp to 1 or 0.
Rumil12 is offline  
Thanks
1 User
Old 04/18/2013, 01:57   #7
 
elite*gold: 0
Join Date: Feb 2013
Posts: 195
Received Thanks: 15
when I need to find target adresses I search what the mouse sees in text eg. (leave mouse over item in gear slot search that name value in CE move to next peice of gear see if the name value in CE changes to the new name value if it does browse mem region of that adress) hope that helps.
softuserz is offline  
Thanks
1 User
Old 04/19/2013, 01:44   #8
 
elite*gold: 0
Join Date: Nov 2010
Posts: 268
Received Thanks: 99
Idol why I didn't think of this earlier, but are you able to find the element that id should be at in the array? As in array[x], where x is the element.
Rumil12 is offline  
Old 04/19/2013, 01:46   #9
 
elite*gold: 0
Join Date: Jul 2010
Posts: 623
Received Thanks: 175
Well anyways, there is a static address in the game client that holds the ID of the current target. So now if I want to find the current targets position in the array just compare that to the ID of the mob in the array and I have it. Thanks again to Wazzup for that info.
iktov2 is offline  
Old 04/19/2013, 04:42   #10
 
elite*gold: 0
Join Date: Feb 2013
Posts: 195
Received Thanks: 15
its all chineese to me -_-
softuserz is offline  
Old 04/19/2013, 06:05   #11
 
elite*gold: 0
Join Date: Jul 2010
Posts: 623
Received Thanks: 175
Quote:
Originally Posted by softuserz View Post
its all chineese to me -_-
Believe me, most of it is to me as well. When I look a lot of the client bots for FPS and such and more complex application code I just about pass out trying to make sense of a lot of it. When I start looking at more complex **** I start to think I never even scratched the surface in anything I ever did and get flustered ha ha.

Anyways, your idea with the 0, 1 flag in the mob structure was right rumil and that method worked as well.

Code:
int ID = 0;
for(int i = 0; i < 50; i++)
{
    if(mobs[i].Flag == 1)
    {
       ID = mobs[i].ID;
    }
}
Once I looked at my mob struct again in re-class I saw that value down at the bottom of the struct just before the name, mob type ID. Added it to my struct and a for loop through the array returned the correct ID of the mob I had targeted. But after Wazzup told me there was a static adress for the current mobs ID its a lot more efficient to just use that.
iktov2 is offline  
Old 04/19/2013, 06:13   #12
 
elite*gold: 0
Join Date: Nov 2010
Posts: 268
Received Thanks: 99
Haha yep sure would be . Good to know I knew what i was talking about though lol
Rumil12 is offline  
Reply


Similar Threads Similar Threads
adding auto-select / target to current Sro client
01/09/2013 - Silkroad Online - 5 Replies
Hi, Just re-downloaded silkroad a few days ago, and saw the new system, so I wanted to add the auto select key (in / trhough the action window) but it wasn't possible tried 1005 1 자동선택 UIIT_CTL_ AUTOSELECT_TT icon\action\icon_cha_autoget.ddj 1 5 1005 1 자동선택 UIIT_CTL_ AUTOSELECT_TT icon\action\icon_cha_autoget.ddj 1 1 4 1005 1 자동선택 UIIT_CTL_ AUTOSELECT_TT icon\action\icon_cha_autoget.ddj 1 1 5 1005 1 자동선택 UIIT_CTL_ AUTOSELECT_TT icon\action\icon_cha_autoget.ddj 1 1 6
[Request help]Finding target HP
09/13/2010 - Shaiya - 12 Replies
Hi, i'd need a 'little' help from experienced people. I would like to know, how to find a pointer for the mobs Max and current HP. I saw the video from lilprohacker, i can do it in CE. However, i'd need any working method in VB . I have even tried to modify the game.exe with olly (jump to code caves from the address, where it reads max/current HP, and MOV EAX and EDI to a memory address), but now the game just crashes when i select a target. Could anyone help me a bit, please? Thank...
having problems finding a monster app
10/07/2009 - Dekaron - 3 Replies
I think it was Levitithan who posted an application that showed in excell all the mosters, their drops , exp , and their id number. I am looking for that application again but cant seem to find it. I forget what it is called so that is what is causing the problem. I want to find the id number to some mobs. Anyone know?
help finding target distance please!
09/10/2008 - Perfect World - 0 Replies
I've been trying to find target distance for a while now with little to no result! The most i could find is camera distance to the target. Please help me find the offset for target distance.
finding monster
05/06/2007 - Conquer Online 2 - 8 Replies
it is really hard to find the blue mouse when u have to find it 20times......is there a way to use any tools to locate the location of blue mouse, and is there a way to CATCH the mouse 100prc successfully



All times are GMT +1. The time now is 13:31.


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