H2I protection?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

kristian_0893
Newcomer
Posts: 1
Joined: November 22nd, 2009, 4:29 am

H2I protection?

Post by kristian_0893 »

what is H2I protection? and how do you remove it?
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: H2I protection?

Post by Ken »

H2I is a protection that formerly used the return bug, and now GetHandleId to get the ID for a handle (handle being most variable types) in the map, and using that to check if the map script has been altered.

The easiest way to disable this is to search the script for "handle" without quotation marks. You'll come up with either a call for the native GetHandleId, or a function similar to this, if you're on the old versions of WC3:

Code: Select all

function h2i takes handle h returns integer
return h
return 0
endfunction

If you find a function like above, find any place it's called from. A simple function for H2I protection, using the function above, would be like this:

Code: Select all

function crash_wc3 takes nothing returns nothing
call ExecuteFunc("crashy crash")
endfunction
function h2i_prot takes nothing returns nothing
local unit u = CreateUnit(Player(15),'hpea',0,0,0)
if(h2i(u)!=321654)then // random value, just as an example
call crash_wc3()
endif
call RemoveUnit(u)
set u = null
endfunction

If the map wasn't altered, h2i(u) would have the value 321654, thus not crashing WC3. Most changes to the script, however (like adding cheats) will change the value, and you'll crash once that function is executed. To remove the crash, just comment out the line "call crash_wc3()" by putting two forward slashes (//) before it.

Hopefully this helps you. If you need any clarification on stuff, just let me know.
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that