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 May 22, 2013 11:12 pm


All times are UTC [ DST ]





Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: [Documentation] Script API dump
PostPosted: Sun Dec 19, 2010 6:10 pm 
 
User
User
User avatar

Joined: Sun Dec 19, 2010 5:47 pm
Jiano wrote:
Hi,
SC hacking newbie here. :)
Can someone enlighten me with what script functions do? Are they just like regular in-game functions so that if you call them from a remote thread with the appropriate arguments, the game does a specific task(move units somewhere, get player color, get player alliance, etc. like the function names suggest)? If not, then how would I actually use them? Any thread or link you can point me to?
Thanks!


StarCraft II comes with a scripting engine called 'Galaxy'. Those pointers represent the native part of those functions. It's suggested not to call them directly but rather look up how certain information can be extracted out of the game.
You can move units using it, but it would affect only your end, thus causing the game to desync. You will have to send real game actions (Packets) in order to do so. Flaming_Cows has posted a thread regarding ingame packets. Try your luck there.

_________________
www.blackninjashirts.com

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Mon Dec 20, 2010 4:48 pm 
 
User
User

Joined: Sat Dec 18, 2010 6:46 am
Now things seem to make sense. :) I guess I'll have to look more into packets then, but yeah, thanks for pointing me to the right direction! :)

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Mon Dec 20, 2010 6:14 pm 
 
User Gold
User Gold
User avatar

Joined: Mon Dec 17, 2007 1:51 pm
Jiano wrote:
Now things seem to make sense. :) I guess I'll have to look more into packets then, but yeah, thanks for pointing me to the right direction! :)

feel free to support him by buying one of his shirts

_________________
My site: http://www.thecuriousmonkey.com/

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Mon Dec 20, 2010 6:32 pm 
 
Administrator Gold
Administrator Gold
User avatar

Joined: Fri Jul 27, 2001 1:00 am
CuriousMonkey wrote:
Jiano wrote:
Now things seem to make sense. :) I guess I'll have to look more into packets then, but yeah, thanks for pointing me to the right direction! :)

feel free to support him by buying one of his shirts

LOL, motherfucker, I swear to god.

_________________
Image

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Mon Dec 20, 2010 8:23 pm 
 
User
User
User avatar

Joined: Tue Mar 23, 2010 2:26 am
CuriousMonkey wrote:
Jiano wrote:
Now things seem to make sense. :) I guess I'll have to look more into packets then, but yeah, thanks for pointing me to the right direction! :)

feel free to support him by buying one of his shirts


I loled

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Mon Jan 03, 2011 12:56 am 
 
User
User

Joined: Tue Oct 27, 2009 9:04 pm
a simple example:

sadly it desyncs you if you are ingame with other people.
Works fine to grind AI Games.

Maybe someone can need it.

const DWORD dwAITimePause = 0xE51B00;

void AITimePause(bool mode)
   {
   int toggle = (int)mode;
   __asm
      {
      MOV ECX,toggle
      call [dwAITimePause]
      }
   }

Top
 Profile  
 Post subject: new script
PostPosted: Fri Jan 14, 2011 8:00 pm 
 
User
User

Joined: Sat Jan 08, 2011 12:55 pm
---
Improvized upon rolle3k's script to define the sub-functions as well.
Works fine with 1.2.0, and won't rename already defined functions. Could be more optimal but who cares, right?
8)

#include <idc.idc>

static main( )
{
  auto dwGalaxyTable, dwIndex, dwFunction, sName;
  Message( "Galaxy.IDC by rolle3k~ and friends\r\n" );
  dwGalaxyTable = FindBinary( INF_BASEADDR, SEARCH_DOWN, "56 57 33 FF BE ? ? ? ?" );
  if ( dwGalaxyTable == BADADDR ) {
    Message( "GALAXY: Couldn't locate table\r\n" );
    return;
  }
  dwGalaxyTable = Dword( dwGalaxyTable + 5 );
  Message( "GALAXY: Found table @ 0x%08X\r\n", dwGalaxyTable );
  for( dwIndex = 0; getGalaxyFunction( dwGalaxyTable, dwIndex ) != -1; dwIndex++ )
  {
    dwFunction = getGalaxyFunction( dwGalaxyTable, dwIndex );
    sName = getGalaxyName( dwGalaxyTable, dwIndex );
    processGalaxyFunction( dwFunction, sName );
  }
  Message( "GALAXY: Done!\r\n" );
}

static getGalaxyFunction( dwTable, dwIndex )
{
  return Dword( dwTable + ( dwIndex * 0x18 ) );
}

static getGalaxyName( dwTable, dwIndex )
{
  return GetString( Dword( dwTable + ( dwIndex * 0x18 ) + 4 ), -1, ASCSTR_C );
}

static processGalaxyFunction( dwFunction, sName )
{
  auto sCall, dwCall, dwEnd, sInstruction;
  dwEnd = FindFuncEnd( dwFunction );
  Message( "GALAXY: Processing 0x%08X -> %s\r\n", dwFunction, sName );
  if ( dwFunction == BADADDR || dwEnd == BADADDR ) {
    Message( "-> Bailing out: Bad start or end address\r\n" );
    return;
  }
  MakeName( dwFunction, "Galaxy_" + sName );
  while ( 1 ) {
    sInstruction = GetMnem( dwFunction );
    if ( sInstruction == "call" || sInstruction == "jmp" ) {
      if ( GetOpType( dwFunction, 0 ) > 1 && GetOpType( dwFunction, 0 ) < 8 ) {
        sCall = GetOpnd( dwFunction, 0 );
        if ( substr( sCall, 0, 4 ) != "sub_" && substr( sCall, 0, 4 ) != "loc_" ) {
          Message( "-> Subcall already has a name (%s)\r\n", sCall );
          return;
        }
        sCall = substr( sCall, 4, strlen( sCall ) );
        dwCall = xtol( sCall );
        if ( dwCall > 0 && dwCall != 0xFFFFFFFF ) {
          Message( "-> Found subcall: 0x%08X -> %s\r\n", dwCall, "impl" + sName );
          MakeName( dwCall, "impl" + sName );
        }
      }
      return;
    }
    dwFunction = NextHead( dwFunction, dwEnd );
    if ( dwFunction == BADADDR || dwFunction > dwEnd ) {
      Message( "-> Couldn't locate subcall\r\n" );
      return;
    }
  }
}

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Thu Mar 31, 2011 6:24 pm 
 
User
User

Joined: Thu Mar 31, 2011 6:20 pm
Sorry to bump an old thread but... if you call these offsets directly will you desync the game? What if you are controlling something that you should have permissions to call (like moving your own units?). I'm assuming galaxy api move calls another in game function for move, which then results in the unit actually moving.

If that is the case, do you mostly use these offsets as a "starting point?" I don't see why you would *have* to use packets? Why not just call the in game function for move unit (x,y)?

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Tue Mar 20, 2012 5:23 pm 
 
User
User

Joined: Sat Feb 01, 2003 1:44 am
Location: Ohio
Anyone have an updated script for the latest version?

_________________
Mar 14 2003 12:42:40 Windforce (Unique Hydra Bow)
Mar 18 2003 10:16:10 Windforce (Unique Hydra Bow)
I only have 249 MF btw, my 901 MF sorc hasn't found shit (and both sorcs are now dead, damn bot banning) :(

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Thu Apr 05, 2012 2:26 am 
 
User
User

Joined: Wed Apr 04, 2012 6:07 am
Anyone have an updated script for the latest version?


The scripts still work.

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Thu Jul 26, 2012 5:37 pm 
 
User
User

Joined: Wed Feb 22, 2012 2:49 pm
I think I messed up, lol. : D

Top
 Profile  
 Post subject: Re: [Documentation] Script API dump
PostPosted: Tue Feb 12, 2013 4:55 am 
 
User
User

Joined: Fri Aug 19, 2011 1:05 am
I started having some problems with this script as of patch 1.5.4 (probably 1.5.0, but I didn't use it till 1.5.4), so I made a couple tweaks so it works again. I can't guarantee it will work nearly as long as the old version though.

#include <idc.idc>

static main( )
{
  auto dwGalaxyTable, dwIndex, dwFunction, sName;
  Message( "Galaxy.IDC by rolle3k~ and friends\r\n" );
  dwGalaxyTable = FindBinary( INF_BASEADDR, SEARCH_DOWN, "56 57 33 FF BE ? ? ? ?" );
  if ( dwGalaxyTable == BADADDR ) {
    Message( "GALAXY: Couldn't locate table\r\n" );
    return;
  }
  dwGalaxyTable = Dword( dwGalaxyTable + 5 );
  Message( "GALAXY: Found table @ 0x%08X\r\n", dwGalaxyTable );

  dwIndex = 0;
  dwFunction = getGalaxyFunction( dwGalaxyTable, dwIndex );
  for( dwIndex = 0; ; dwIndex++ )
  {
    dwFunction = getGalaxyFunction( dwGalaxyTable, dwIndex );
    if ( dwFunction == -1 ) {
      break;
    }
    sName = getGalaxyName( dwGalaxyTable, dwIndex );
    if ( strlen ( sName ) == 0) {
      break;
    }
    processGalaxyFunction( dwFunction, sName );
   
  }
  Message( "GALAXY: Done!\r\n" );
}

static getGalaxyFunction( dwTable, dwIndex )
{
  return Dword( dwTable + ( dwIndex * 0x18 ) );
}

static getGalaxyName( dwTable, dwIndex )
{
  return GetString( Dword( dwTable + ( dwIndex * 0x18 ) + 4 ), -1, ASCSTR_C );
}

static processGalaxyFunction( dwFunction, sName )
{
  auto sCall, dwCall, dwEnd, sInstruction;
  dwEnd = FindFuncEnd( dwFunction );
  Message( "GALAXY: Processing 0x%08X -> %s\r\n", dwFunction, sName );
  if ( dwFunction == BADADDR || dwEnd == BADADDR ) {
    Message( "-> Bailing out: Bad start or end address\r\n" );
    return;
  }
  MakeName( dwFunction, "Galaxy_" + sName );
  while ( 1 ) {
    sInstruction = GetMnem( dwFunction );
    if ( sInstruction == "call" || sInstruction == "jmp" ) {
      if ( GetOpType( dwFunction, 0 ) > 1 && GetOpType( dwFunction, 0 ) < 8 ) {
        sCall = GetOpnd( dwFunction, 0 );
        dwCall = LocByName( sCall );
        if ( dwCall > 0 && dwCall != 0xFFFFFFFF ) {
          Message( "-> Found subcall: 0x%08X -> %s\r\n", dwCall, "impl" + sName );
          MakeName( dwCall, "impl" + sName );
        }
      }
      return;
    }
    dwFunction = NextHead( dwFunction, dwEnd );
    if ( dwFunction == BADADDR || dwFunction > dwEnd ) {
      Message( "-> Couldn't locate subcall\r\n" );
      return;
    }
  }
}

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2

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