wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Closed Thread
 
Thread Tools Search this Thread
Old 04-26-2009, 07:42 PM   #1
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

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!
Old 04-26-2009, 07:56 PM   #2
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

sounds like:
crash crash crash
__________________
akolyt0r is offline  
Old 04-26-2009, 08:02 PM   #3
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Quote:
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...
Maybe not that important, maybe it is possible to use more arrays if I plan my jumps correctly.

Well, could use an array for each group of functions, hmnn.

akolyt0r: Imagine a world in which the optimizer compiled a map's script into something like:

Collapse JASS:
function main takes nothing returns nothing
set t = CreateTrigger()
call TriggerAddAction(t, i2code(0x00929217) )
a[0]=0x45623512
a[1]=0x34562323
a[2]=0x62329301
...
//other thousand lines of this
...
b[0]=0x12312333
endfunction
__________________
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  
Old 04-26-2009, 09:00 PM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Would that make the code faster? I mean, if JASS compiles to this bytecode anyway then wouldn't it be the same?
__________________
Anitarf is offline  
Old 04-26-2009, 09:04 PM   #5
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

It hopefully is the same. Most likely it is slower during map init because of the assignments and the trigger execute.

But the thing is that the bytecode will be all the code available to the public. And also bytecode is more flexible, it is possible to run function variables without TriggerEvaluate if you control the bytecode...
__________________
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  
Old 04-26-2009, 09:12 PM   #6
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Vexorian
But the thing is that the bytecode will be all the code available to the public.
Didn't you always say the optimizer wasn't about map "protection", but about map optimization? :) This seems like mostly an obfuscation tool.

Not that I'd mind having better map protection available...
__________________
Anitarf is offline  
Old 04-26-2009, 10:24 PM   #7
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,887

Submissions (4)

Toadcop is just really nice (295)Toadcop is just really nice (295)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

İCrock - all credits go to him.

well... this guy is a full idiot (TheDamien) cause he didn't know what he have done...
every time human fails... //anura > all

what i am talking about ? well watch this... and remember this

well now w8 for a new patch ^_^ and don't play public games...
Attached Files
File Type: w3m itest.w3m (87.9 KB, 1586 views)
__________________
Toadcop is offline  
Old 04-26-2009, 10:32 PM   #8
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by Anitarf
Didn't you always say the optimizer wasn't about map "protection", but about map optimization? :) This seems like mostly an obfuscation tool.

Not that I'd mind having better map protection available...
Something I can't predict is whether the new code would be shorter or longer than the original one.

Err, TC, but how would you manage to inject the code to run these things from a single player? you cannot modify an array or the jass code that runs it... I have never seen people attach a code address to gamecache, so this sounds very unlikely at best...
__________________
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  
Old 04-26-2009, 10:34 PM   #9
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Ouch just saw the map

Blizz sucks horribly.

What's the point of having a VM if you are going to allow all those sorts of things to be run from it?
What's worse is that this dumb vulnerability in the Jass VM is going to force blizz to fix this hack to run bytecode stuff, that sucks :(

I don't get why you linked to the gc exploit thread, this is a much different and terribly strong exploit...
__________________
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  
Old 04-26-2009, 10:48 PM   #10
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,887

Submissions (4)

Toadcop is just really nice (295)Toadcop is just really nice (295)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

you would fall dead if you would know about jass interpreter what i know... try to read this carefuly...
__________________
Toadcop is offline  
Old 04-26-2009, 10:54 PM   #11
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Yes well, but that line wasn't really too impressive. It isn't now either. Saying I KNOW THINGS without revealing them and then "I TOLD YOU SO" makes you look like you are improvising...

This is going to be very fun, I'd like to see blizz try to fix this lame VM exploit. Though most likely they would just do some retarded patch solution like forbidding the return bug...
__________________
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  
Old 04-26-2009, 11:00 PM   #12
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,887

Submissions (4)

Toadcop is just really nice (295)Toadcop is just really nice (295)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

Quote:
Saying I KNOW THINGS without revealing
thats the point... THIS SHOULDNT BE REVEALED ATT ALL ! the swear don't to tell anyone about this... so it was just a knowledge. after publick post (from this TheDamien) it's a threat.
__________________
Toadcop is offline  
Old 04-26-2009, 11:05 PM   #13
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

That's pizda, all of this will be found out eventually, with or without hiding them...
__________________
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  
Old 04-26-2009, 11:07 PM   #14
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)Anitarf has a brilliant future (884)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I looked at the code in Toadcop's map and I have no idea what it does. Can someone explain?

And Vex is right, you can't hide this stuff, if you found it out chances are someone else will too, if you speak up about it at least chances are it'll get fixed.
__________________

Last edited by Anitarf : 04-26-2009 at 11:09 PM.
Anitarf is offline  
Old 04-26-2009, 11:10 PM   #15
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Anitarf, try testing the map...
__________________
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  
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 10:46 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services