Weird protection how to?

eXirrah

New Member
Reaction score
51
I recently checked a map's script and noticed that there are some weird symbols.
The map works properly with them event if the JassCraft say they
are errors. The thing is that you cannot edit the script of the map and I want
that kind of protection in my maps.

It looks like this:
JASS:
function uC takes real UC returns nothing
    local real wC
    local real st=TimerGetElapsed(pC)
    if st<=0 then
        set pC=CreateTimer()
        call TimerStart(pC,$F4240,false,null) // <--- $F4240
    endif
    if(UC>0)then
        loop
            set wC=UC-TimerGetElapsed(pC)+st
            exitwhen wC<=0
                if(wC>bj_POLLED_WAIT_SKIP_THRESHOLD)then
                    call TriggerSleepAction(.1*wC)
                else
                    call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
                endif
        endloop
    endif
endfunction


What is that kind of protection and how can I use it in my map?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Use Vex's Map Optimizer. It will mess up all the code like the one you posted.
Click Me!

off topic :
This is alternate PolledWait.

JASS:
library AnotherPolledWait initializer Init

    globals
        private timer gametime = CreateTimer()
    endglobals

    function PolledWait2 takes real duration returns nothing
        local real timeRemaining
        local real st = TimerGetElapsed(gametime)
    
        if duration > 0. then
            loop
                set timeRemaining = duration - TimerGetElapsed(gametime) + st
            exitwhen timeRemaining <= 0
                if timeRemaining > 2.00 then
                    call TriggerSleepAction(0.1 * timeRemaining)
                else
                    call TriggerSleepAction(0.0)
                endif
            endloop
        endif
    endfunction
    
    private function Init takes nothing returns nothing
        call TimerStart(gametime,99999.,false,null)
    endfunction
endlibrary
 

Azlier

Old World Ghost
Reaction score
461
That's a hex number. Both 0xblah and $blah are supported, apparently.
 

eXirrah

New Member
Reaction score
51
This is just an example function. There is this kind of variables all over the script
that have '$' symbol in there names.

When I try to add this symbol to a script in my map warcraft III crashes.

I just can't find what kind of protection is this. I never seen anything like it and
that's why I want to use it.
 

Azlier

Old World Ghost
Reaction score
461
I don't know of an optimizer that replaces constant integers with hex numbers for you.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
So, ask Vex, yeah.
As I know, his map optimizer converts hex into numbers.
 

eXirrah

New Member
Reaction score
51
Anyone knows which options should I use to do that?

EDIT: I used the vex optimizer and it did replaced some of the variables in my map with
hex values but if I edit the map scrip the map still works properly.

The map I played when you edit the script and it really doesn't matter what you edit
crashes warcraft III. I wanted to know how to do that and seems like it doesn't have
anything to do with the hex numbers.
I'll just have to check it out again if I missed something.

Anyway thanks guys + rep.

EDIT2 : Seems like I need to spread some rep points to rep you azlier. But I will not forget to when I can.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
use vexorian optimer it makes the code look all foobly loobly and stuff.
 

Azlier

Old World Ghost
Reaction score
461
'Twas just an example. Don't forget that L doesn't work, either.
 

eXirrah

New Member
Reaction score
51
I know that vex optimizer obscures the code but it is still readable and editable. I was searching for protection that makes the script of the map
not editable. I tested it, when I edit the script of this map wc3 crashes.

This function is an example taken directly from the map I was talking about
and it works fine in wc3. $F4240 seems to be valid.

JASS:

function uC takes real UC returns nothing
    local real wC
    local real st=TimerGetElapsed(pC)
    if st<=0 then
        set pC=CreateTimer()
        call TimerStart(pC,$F4240,false,null) // <--- $F4240
    endif
    if(UC>0)then
        loop
            set wC=UC-TimerGetElapsed(pC)+st
            exitwhen wC<=0
                if(wC>bj_POLLED_WAIT_SKIP_THRESHOLD)then
                    call TriggerSleepAction(.1*wC)
                else
                    call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
                endif
        endloop
    endif
endfunction


Here is the map at epicwar.com.
I didn't find any rule that forbids me to paste links to protected maps here
but if there is any problem with the link I will remove it.
 

Azlier

Old World Ghost
Reaction score
461
Hey, maybe it uses MapLock.

Despite the fact that a 1.24b working MapLock has yet to be released publicly.
 

the Immortal

I know, I know...
Reaction score
51
Kinda irrelevant to your question but doesn't LotK provide an unprotected version of the map, as well?
 

eXirrah

New Member
Reaction score
51
Well I tried to protect it with vex optimizer and used all of the options but
I can still edit the script file and the map runs.
 

Azlier

Old World Ghost
Reaction score
461
Homebrew MapLocks are the most stealthy simply because they don't match any standard implementation. Muahahahahah.

>Well I tried to protect it with vex optimizer and used all of the options but

People do not realize that the optimizer is not for protection. It is for optimization, but has the side effect of protection against the noobiest of map stealers.
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
$100 == 0x100
$b21fe == 0xb21fe
Understand now?

Its just another way to create hex numbers.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top