Looking for a pop-up message in-game from the Jass code

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

emilo0212
Newcomer
Posts: 14
Joined: February 16th, 2020, 11:53 pm

Looking for a pop-up message in-game from the Jass code

Post by emilo0212 »

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: Select all

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.
User avatar
Vegas
Shopping Maul USA Creator
Posts: 1729
Joined: January 18th, 2007, 11:07 am
Title: No Comment
Location: Calgary Canada

Re: Looking for a pop-up message in-game from the Jass code

Post by Vegas »

In the *.wts files there is this text:

Code: Select all

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.
emilo0212
Newcomer
Posts: 14
Joined: February 16th, 2020, 11:53 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by emilo0212 »

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

Re: Looking for a pop-up message in-game from the Jass code

Post by emilo0212 »

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?
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by owner123 »

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.
emilo0212
Newcomer
Posts: 14
Joined: February 16th, 2020, 11:53 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by emilo0212 »

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: Select all

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: Select all

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
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by owner123 »

Here's some fun stuff. You were on the right track.

The method you identified calls this

Code: Select all

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

Calls this function with args:
KY=9
hY=-1
QY=-1
FY=null

Code: Select all

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: Select all

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: Select all

function OY takes integer aY,integer nY,integer EY,string tY returns nothing

aY = 9
nY = (player id)
EY = -1
tY = null

Code: Select all

elseif aY==9 then
set mY=Yw

Now mY = Yw
Previously:

Code: Select all

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: Select all

call SaveStr(cw,nY,Aw[nY],mY)


This probably is responsible for game crash:

Code: Select all

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: Select all

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: Select all

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: Select all

call TriggerRegisterTimerEvent(Qj,1.,false)
call TriggerAddAction(Qj,this)

And so it "starts" the game by activating gr at 1.0 seconds.
User avatar
Vegas
Shopping Maul USA Creator
Posts: 1729
Joined: January 18th, 2007, 11:07 am
Title: No Comment
Location: Calgary Canada

Re: Looking for a pop-up message in-game from the Jass code

Post by Vegas »

Yeah I was just about to say that.... :lol:
emilo0212
Newcomer
Posts: 14
Joined: February 16th, 2020, 11:53 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by emilo0212 »

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: Select all

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: Select all

call SetPlayerState( Player( 0 ), PLAYER_STATE_RESOURCE_GOLD, 9999999999999)
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: Looking for a pop-up message in-game from the Jass code

Post by owner123 »

This is where I believe the anticheat is and what you can do to disable it:

Code: Select all

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: Select all

function by takes nothing returns boolean
return true
endfunction


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