View Single Post
Old 04-26-2009, 07:42 PM   #1
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default Arbitrary bytecode execution

As I've been reading: http://www.thehelper.net/forums/showthread.php?t=125339

It is possible to "run" bytecode dynamically, almost sounds like a dream come true, however it is limited and apparently not working everywhere.

Basic idea is that as we all know, you can use a cast from integer to code to skip to arbitrary places in the bytecode, however, what's new to me is that you can apparently use this trick to move to the pseudo memory address of a jass array and whatever bytecode is hidden there will be executed:

Collapse JASS:

set bj_meleeTwinkedHeroes[1024] = 0x90909090
set bj_meleeTwinkedHeroes[1025] = 0x90909090 //and other bytecode giberish.
...

local code C = I2Code( code2I(function GetRandomDirectionDeg) + 0xC92D8 )

call TriggerAddAction(t, C)
call TriggerExecute(t)

//It will run whatever bytecode 90 90 90 90 means


So, does anyone know enough about jass byte code to answer this question:
What's on average the size a map's compiled bytecode takes? - This is very important to know for me...
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline  
Sponsored Links - Login to hide this ad!