HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

By value structs...

07-11-2008, 02:38 AM#1
Vexorian
I think I love how exploitable jasshelper is:

Expand giberish:


sample?

Collapse JASS:
library sandbox initializer init requires ARGB


    private function init takes nothing returns nothing
     local ARGB y= ARGB.create(0,2,3,4)
     local ARGB x= 0xFF010203

         call BJDebugMsg(I2S(x.alpha)+" "+I2S(x.red)+" "+I2S(x.green)+" "+I2S(x.blue) )
         set x= y
         call BJDebugMsg(I2S(x.alpha)+" "+I2S(x.red)+" "+I2S(x.green)+" "+I2S(x.blue) )
         set y=0x72468912
         call BJDebugMsg(I2S(y.alpha)+" "+I2S(y.red)+" "+I2S(y.green)+" "+I2S(y.blue) )
         call BJDebugMsg(I2S(x.alpha)+" "+I2S(x.red)+" "+I2S(x.green)+" "+I2S(x.blue) )
    
    endfunction
endlibrary

Looking for ways to optimize the getters, specially if it is possible to make them inline-friendly. Must make setters... Edit: now that I think of it, setters are impossible.

Edit: If anyone has the right RGB values for teamcolor stuff I'll appreciate it.
07-11-2008, 02:53 AM#2
Here-b-Trollz
I'm fairly certain it's just 255, 128 and 0 shuffled up a bunch.

Also, did you declare a method operator = or something? I just don't understand:

local ARGB = 0xFF010203

Isn't that like.... a HUGE number?
07-11-2008, 02:58 AM#3
Vexorian
Quote:
I'm fairly certain it's just 255, 128 and 0 shuffled up a bunch.
huh?

Quote:
Also, did you declare a method operator = or something? I just don't understand:
something. It is actually a negative number.
07-11-2008, 03:10 AM#4
Here-b-Trollz
RGB teamcolors are, if I recall correctly, something like:

Red = (255,0,0)
Blue = (0,0,255)
Teal = (0,128,128)
Purple = (255,0,255)
Yellow = (128,128,0)
Orange = (255,128,0)
Green = (0,255,0)
Pink = (255,128,128)
Gray = (128,128,128)
Lightblue = (128,128,255)
Darkgreen = (0,128,0)
Brown = (something)
Black = (0,0,0)
07-11-2008, 03:36 AM#5
Vexorian
I don't think the real values were prime colors?
07-11-2008, 03:40 AM#6
Ammorth
no, they have some slight variation. The one I like the most was on the helper. Ill see if I can go find it.

Code:
 Red: |CFFFF0303 |R (255,3,3)
Blue: |CFF0042FF |R (0,66,255)
Teal: |CFF1CB619 |R (28,230,185)
Purple: |CFF540081 |R (80,0,129)
Yellow: |CFFFFFF01 |R (255,255,1)
Orange: |CFFFE8A0E |R (254,138,14)
Green: |CFF20C000 |R (32,192,0)
Pink: |CFFE55BB0 |R (229,91,176) 
Grey: |CFF959697 |R (149,150,151)
Light Blue: |CFF7EBFF1 |R (126,191,241)
Dark Green: |CFF106246 |R (16,98,70)
Brown: |CFF4E2A04 |R (74,42,4) 
07-11-2008, 09:48 AM#7
Anitarf
So, umm, that works? I mean, it's obviously going to go above the max array index... with no struct members, you can do that?

But why implement it as a struct anyway, couldn't you just make it a library of regular functions?
07-11-2008, 01:22 PM#8
Vexorian
cause c.red is prettier than ColorInteger_GetRed(c)
07-11-2008, 06:13 PM#9
Toadcop
u r my hero <3

JassHelper > all.