wc3edit.net

United Warcraft 3 map hacking!
It is currently March 19th, 2024, 7:17 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: February 22nd, 2020, 4:25 pm 
Offline
Newcomer

Joined: February 16th, 2020, 11:53 pm
Posts: 14
Hey there, I managed to figure out how to edit/add stats with the help of nuzamacuxa, so I really appreciate that!

But with the newer versions there seems to be some warning of these editings/modifications of stats. Whenever I create a game with my own modified version of the map, it warns the user with the following message: ""This map has been modified with cheats, please make sure to use the official version""

Is there any way to remove this message using the Jass code or in any other way?

Map source: https://www.hiveworkshop.com/pastebin/5 ... f88a20526/

This is my modification in the code:
Code:
call SetPlayerState( Player( 0 ), PLAYER_STATE_RESOURCE_GOLD, 1000000000 )


Thanks in advance!


[EDIT]
Another issue occurs when editing the map:

The game doesn't start, it gets stuck at 1 seconds. I tried the original version of the map without editing it and it works fine, so there must be something that detects stat-change and disables the timer = no income = no gameplay. Would you have any idea where this could be happening in the code?


Last edited by emilo0212 on February 22nd, 2020, 8:34 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: February 22nd, 2020, 7:43 pm 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1989
Location: Calgary Canada
Title: No Comment
In the *.wts files there is this text:

Code:
STRING 4337
// Abilities: A03B (Overcharging), Ubertip (Tooltip - Normal - Extended)
{
This map has been modified with cheats. Please make sure you're playing an official version of Line Tower Wars: Reforged.
}


You can delete this text, but may still get a blank message making people wonder what's going on.

EDIT: Or just change the text to something else.


Top
 Profile  
 
PostPosted: February 22nd, 2020, 8:17 pm 
Offline
Newcomer

Joined: February 16th, 2020, 11:53 pm
Posts: 14
Thank you! That worked!


Top
 Profile  
 
PostPosted: February 22nd, 2020, 8:33 pm 
Offline
Newcomer

Joined: February 16th, 2020, 11:53 pm
Posts: 14
Actually seems like there are 2 issues that occur when trying to modify the map.

1) The message appear, which you just helped me fix
2) The game doesn't start, it gets stuck at 1 seconds. I tried the original version of the map without editing it and it works fine, so there must be something that detects stat-change and disables the timer = no income = no gameplay. Would you have any idea where this could be happening in the code?


Top
 Profile  
 
PostPosted: February 22nd, 2020, 8:45 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
I would assume that the same function that prints the line announcing it was cheated also freezes the game.

So what you want to do is identify where it prints that text out. It's going to be easy to find. You can search on TRIGSTR_4337. There's probably a JASS function that first displays that text, then uses a game-crashing function. Find the code that calls the function to do all of this (it's some kind of anti-cheat detection trigger) and disable it. If you want to be extra sure, note down what kind of event caused it to happen and then search for more of those events.

The fact that they added anti-cheat text makes it very much easier to remove than normal.
Let us know if you need more assistance on this.


Top
 Profile  
 
PostPosted: February 23rd, 2020, 1:40 am 
Offline
Newcomer

Joined: February 16th, 2020, 11:53 pm
Posts: 14
Hey there owner123, thanks for your answer!

I was looking through the Jass file and couldn't find anything related to the 4337 string.

I did manage to find this piece of code here:
Code:
if Tr then
call BlzFrameSetText(I,"|cffffcc00Income: "+I2S(R2I(TimerGetRemaining(dw))+1)+"s|r")
else
call BlzFrameSetText(I,"|cffffcc00Game Start: "+I2S(R2I(TimerGetRemaining(Xr))+1)+"s|r")
endif


The second call has the string "Game Start" which matches with the text in-game, here's a picture:
https://imgur.com/ZegYW5h

but neither replacing or removing the second call with the "Game Start" string doesn't do anything, it still gets stuck.

Was also wondering about this function here, but I'm not sure:
Code:
function by takes nothing returns boolean
local integer Fy=0
loop
exitwhen Fy>Gw
if GetPlayerState(Player(Fy),PLAYER_STATE_RESOURCE_GOLD)>hw or GetPlayerState(Player(Fy),PLAYER_STATE_RESOURCE_LUMBER)>Qw then
call bY(9,-1,-1,null)
return false
endif
set Fy=Fy+1
endloop
return true
endfunction


Top
 Profile  
 
PostPosted: February 23rd, 2020, 4:02 am 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
Here's some fun stuff. You were on the right track.

The method you identified calls this

Code:
call bY(9,-1,-1,null)

Calls this function with args:
KY=9
hY=-1
QY=-1
FY=null
Code:
function bY takes integer KY,integer hY,integer QY,string FY returns nothing
set hY=1
loop
exitwhen hY>iw
call OY(KY,GetPlayerId(Pw[hY]),QY,FY)
set hY=hY+1
endloop
endfunction

This line:
Code:
call OY(KY,GetPlayerId(Pw[hY]),QY,FY)

Calls OY with: 9, GetPlayerId(Pw[1 to index], -1, null)
Strange that they take in hY as an argument and then immediately overwrite it. The original programmer of this game must have written some weird code for it to optimize like this (the argument is useless).
Code:
function OY takes integer aY,integer nY,integer EY,string tY returns nothing

aY = 9
nY = (player id)
EY = -1
tY = null
Code:
elseif aY==9 then
set mY=Yw

Now mY = Yw
Previously:
Code:
set Yw=BlzGetAbilityExtendedTooltip($41303342,0)

That hex = A03B
Extracted abilities file.
And then: the tooltip of it is: TRIGSTR_4337
Yep it's the anticheat all right.
Code:
call SaveStr(cw,nY,Aw[nY],mY)


This probably is responsible for game crash:
Code:
if by() then
set Tr=true
set iM=dw
set GM=Fw
call TimerStart(iM,GM,true,null)
set iM=jo
set GM=Wo
call TimerStart(iM,GM,false,null)
else
set gr=false
endif

I believe that function by returns false if it finds that you're cheating.
Therefore setting gr to false crashes the game.
I see two other places in the code where gr is set to false. These are likely other anticheat sections. Search for these and disable them:
Code:
set gr=false


Tell me if this works.

That way they hid the string away by putting in a tooltip and then retrieving the tooltip as a string is incredibly cool and I don't think I've ever seen it before. I'm almost very impressed, it had me confused for a time. But like all security by obscurity, it's only a matter of time before it's defeated. In a way it's almost funny, the maker knew including a message when it detected cheating would make it way easier to find so they obfuscated the message rather than just not including it.

bonus:
gr set to true here
Code:
set gr=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"TRIGSTR_3808")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"TRIGSTR_4354")
else

these trigstrs are:
|cffffcc00Player stats will be recorded during this game.
And 4354 is strangely, a blank string. And 3808 has an unterminated color code... lots of weird stuff here.

Anyways appears gr is some sort of boolean to keep track of the game state. gr=true means game is active, gr=false means inactive.
this piece of code happens in trigger Qj. The creator attempted to obfuscate this trigger by saving it in code before calling it using the following:
Code:
call TriggerRegisterTimerEvent(Qj,1.,false)
call TriggerAddAction(Qj,this)

And so it "starts" the game by activating gr at 1.0 seconds.


Top
 Profile  
 
PostPosted: February 23rd, 2020, 5:55 am 
Offline
Shopping Maul USA Creator
User avatar

Joined: January 18th, 2007, 11:07 am
Posts: 1989
Location: Calgary Canada
Title: No Comment
Yeah I was just about to say that.... :lol:


Top
 Profile  
 
PostPosted: February 23rd, 2020, 5:33 pm 
Offline
Newcomer

Joined: February 16th, 2020, 11:53 pm
Posts: 14
Hey there owner123, thanks for your answer and explanation on this, really appreciate it!

I tried your suggestion of enabling all the gr booleans by setting them to true, but that sadly didn't do much, same issue was happening.
Then I looked into the TriggerRegisterTimerEvent and tried doing different things like setting the false value to true and removing it entirely etc, but none of that helped, I might have misunderstood your explanation on what these triggerregistertimerevents do.

I kind of managed to get through the stuck part by removing this check:
Code:
loop
exitwhen vy>Gw
if GetPlayerState(Player(vy),PLAYER_STATE_RESOURCE_GOLD)>hw or GetPlayerState(Player(vy),PLAYER_STATE_RESOURCE_LUMBER)>Qw then
call bY(9,-1,-1,null)
return false
endif
set vy=vy+1
endloop


but doing that it'll give me negative income and increment that negative income with the values that the creeps I select gives, so it essentially reversed from positive to negative income. Maybe this could be a solution if I figure out how to convert that negative income to positive.

Or another solution could be to constantly give me the maximum amount of income so the negative income at the end just doesn't matter, but for that I would need to find where the income section is and add a line that gives me the maximum amount of gold or is there somewhere that I can make an infinite loop?

I would assume this is the line that I'm adding if that solution were to happen:
Code:
call SetPlayerState( Player( 0 ), PLAYER_STATE_RESOURCE_GOLD, 9999999999999)


Top
 Profile  
 
PostPosted: February 23rd, 2020, 6:25 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
This is where I believe the anticheat is and what you can do to disable it:

Code:
function by takes nothing returns boolean
local integer Fy=0
loop
exitwhen Fy>Gw
if GetPlayerState(Player(Fy),PLAYER_STATE_RESOURCE_GOLD)>hw or GetPlayerState(Player(Fy),PLAYER_STATE_RESOURCE_LUMBER)>Qw then
call bY(9,-1,-1,null)
return false
endif
set Fy=Fy+1
endloop
return true
endfunction

Change to:
Code:
function by takes nothing returns boolean
return true
endfunction


If that doesn't work, can you post your edited map?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)