Blizzhackers

Return of the Jedi

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Wed Jun 19, 2013 9:05 am


All times are UTC [ DST ]





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: How would one get all life bars of the units in the game?
PostPosted: Sun Jun 03, 2012 3:25 pm 
 
User
User

Joined: Sun Jun 03, 2012 3:09 pm
I been wanting to write a scrip (mainly to see if it could be done) that would gather all life bars of a selected unit on the screens (unit life) and compare distants from the mouse to the position of that unit to the mouse (if unit it on screen to the player view) so that the unit it self could be pick naturaly looking (by having the mouse go to that unit and click) and blink/Move back to safty only a short distant (so no attack command would be needed).

I understand how to do most of the logic, but not so much on getting life values from memory. I'm not a true hacker, so reading memory it self seem very strange to me. I been looking around at the other post, but I guess I am still a bit lost on what I would need to be calling to do such of thing and how safe would that be? What I mean by safe is that no data would be writen, or shouldn't have to be writen, as each keystrokes and mouse movements would be simulated.

Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Mon Jun 04, 2012 8:09 pm 
 
User
User

Joined: Wed Apr 04, 2012 6:07 am
Didn't really understand your first paragraph; just the second. There's something called a Unit Struct.

Unit struct starts at 0x1DE7EC0

Structure reversed by Qazzy:
https://github.com/MrNukealizer/SCII-Ex ... /unit_s.cs

Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Wed Jun 06, 2012 9:23 am 
 
User
User

Joined: Sun Jun 03, 2012 3:09 pm
I see thanks. Lots of information here. I'll have to check up on how the code works. Not a lot of notes on what each function/method it seems.

Should put me onto the right path still. Thanks again.

Mainly just wanted to make a auto blink scrip to see if it could be done. I know it can be, but wanted to see if I could do it on my own.

Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Wed Jun 06, 2012 9:43 am 
 
User
User

Joined: Wed Apr 04, 2012 6:07 am
I've never made auto blink because I didn't wanna code the math. I can make it at anytime though because my friend made a SC2 map strictly for auto blink. I can just copy what he did there into a hack. You'll need this to send orders:

void Unit_SendOrder( COrder* inOrder )
{
     int UnitSendOrder   = 0x009F24B0;
    _asm
           {
             mov ecx, inOrder
             call UnitSendOrder
           }
}

Also for auto blink, you'll have to figure out how to get the ability ID. I know there is a function in the Galaxy api that allows you to return a ability id. I forgot which one. Maybe someone can post the function name. I think it's GetCatalogEntry.


Last edited by cwatididthar on Thu Jun 07, 2012 5:21 pm, edited 2 times in total.
Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Wed Jun 06, 2012 12:59 pm 
 
User
User

Joined: Sun Jun 03, 2012 3:09 pm
If you don't minde, I would love to see the code. As for the math, it wouldn't be to hard I don't think. Simply taking y/x of the unit (I think I have the offsets for that using the code above that you linked).


Question, wouldn't the above not work because it would be injecting code?

Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Wed Jun 06, 2012 5:15 pm 
 
Moderator Gold
Moderator Gold
User avatar

Joined: Thu Aug 16, 2007 8:36 pm
I've never made auto blink because I didn't wanna code the math.


You just grab both units position, then calculate the angle between them, reverse the angle and calculate the point on track.

Top
 Profile  
 Post subject: Re: How would one get all life bars of the units in the game
PostPosted: Wed Jun 06, 2012 5:39 pm 
 
User
User

Joined: Wed Apr 04, 2012 6:07 am
If you don't minde, I would love to see the code. As for the math, it wouldn't be to hard I don't think. Simply taking y/x of the unit (I think I have the offsets for that using the code above that you linked).


Question, wouldn't the above not work because it would be injecting code?


Oh, forgot you said you don't wanna inject. That isn't modifying memory though. davidhustler posted the math in words.

Image

It's long, but I think you get it. david, isn't to get ability ids the correct function is GetCatalogEntry?

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron