Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to make the camera unzoomable?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Thu Sep 26, 2019 11:33 pm    Post subject: Reply with quote

If you are making a game, just understand that 'unhackable' is not a thing for anything that is client sided. Regardless of what measures you go through to prevent hacking, it can be bypassed.

Adding 'const' to the variable will just tell the compiler to mark it as read-only in memory. That can be bypassed just by changing the memory access of the page it resides in.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Sat Sep 28, 2019 12:04 am    Post subject: Reply with quote

No matter what you do, the camera can be moved. You are giving it a fixed position, that position can be modified. Anything running on the clients machine is going to be able to be modified. Even if you send the positional data of the camera to the client from a server, it's still running on the client machine and can be edited.

Min/Max values won't change that either, you can just change those as well.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Sat Sep 28, 2019 11:10 pm    Post subject: Reply with quote

GhostMane wrote:
Ya but what if the camera though cant change thosr values as it was just coded to be those values, aka cant handle any other zoom level.

I understand in assembly u can still change the values but it wouldnt do anything as the camera is programmed for any other 2 values.


This is the same thing as a static value. Even if you tell it specifically where to be or where to look at, it's editable.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 78

Joined: 06 Jul 2014
Posts: 2639

PostPosted: Sun Sep 29, 2019 9:39 am    Post subject: Reply with quote

CE can change those limits. e.g.:
Code:
int foo(int zoom) {
  if (zoom > 100)
    zoom = 100;
  return zoom;
}
This could get compiled to the following code:
Code:
mov eax,64
cmp ecx,eax
cmovle eax,ecx
ret

The simplest thing you can do is change 0x64 to something else. It's easy to remove that check altogether by replacing that with:
Code:
mov eax,ecx
ret
which effectively decompiles to:
Code:
int foo(int zoom) {
  return zoom;
}

Point being that a suitably knowledgeable user can make stuff running on their computer do whatever they want it to do.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Sun Sep 29, 2019 11:49 am    Post subject: Reply with quote

GhostMane wrote:

ok, but if the function and engine is physically programmed to only be at those limits, nothing else, even changing it wont do anything as it wouldnt understand the new edited values, correct?


When you compile the program/engine down to a binary file (exe), it has that hard-coded value of what to use for the position / zoom / etc. The game is still reading that value from its own memory to know where to place the camera, where to have it look, and how far to zoom it in/out in the scene. All these values are still in memory. If they are hardcoded, the memory page will generally be read-only, but, that does not protect it from being written to ever. You can change the memory protection of the page and alter the value.

As ParkourPenguin showed as well even if it's a hard coded value directly written into the opcode of a function vs. being a memory value, the opcodes can also be edited to manipulate the values.

GhostMane wrote:

just because you can change it doesnt mean it is possible to react to the change and it aint programmed for those values.


It doesn't matter what you program it to use. If the values are handled on the client to tell it where to be in the scene and what to do, the client is vulnerable to being edited.

GhostMane wrote:

like if i programmed a function to only accept the value = 1 and do something based on the value 1, then if u changed the value to be 2, it would crash as only accepts 1 and doesnt know how to handle other values


Again not true. If you hard-code a check to ensure 1 is used, that check can be removed/nop'd out. If the game is using a clamped value space for math against that value of 1, it can be rewritten entirely by the hacker/modder to use any value they want and ignore all of your code entirely.

The stuff you code then compile is not the end-all-be-all of the program. It compiles down to machine level code that is still able to be altered, both in memory and in raw form of the binary. If someone wanted to make your camera zoom level permanently a different value, they can by editing the exe directly and not just via memory editing.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Sun Sep 29, 2019 10:59 pm    Post subject: Reply with quote

GhostMane wrote:

But i think your mis understanding.


Not at all, I completely understand what you are asking and have explained already why you're not going to make this uneditable. It would seem you do not understand how things work regarding assembly, compiling and running on a persons machine vs. running on a remote server.


GhostMane wrote:

Even if you change the values it should have no effect as the function for the camera level only works for 1 value. Changing it in assembly whoop de do it doesnt change camera as the engine literally only works for that one value.

Just because you can change a value in assembly doesnt change the way the function is programmed


Again, the way it's programmed does not matter. Your program isn't magically secure for any alterations by clicking compile/export. That's not how things work. If your program is running on my computer, I have full access to it's memory and assembly to alter how it runs/works.


GhostMane wrote:

Changing this value in assembly would crash it as it isnt programmed to handle anything else!


I assume you didn't read what I said in my last post. It does not matter what the program is coded to handle. It does not matter what the code is at all. I can just rewrite the entire function, in assembly, at runtime, and inject/code cave it and ignore your code altogether.

If you want to refuse to understand that this is how things work, that's fine. Code your game the way you want, assume it's safe/protected, and it'll get hacked just like we've explained here already.

You came here asking for our help regarding this and are now arguing with us on what is/isn't possible. If you know that it's impossible, why did you bother making this thread and asking for help?

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Mon Sep 30, 2019 12:11 pm    Post subject: Reply with quote

GhostMane wrote:
So to protect a camera zoom level would be to handle it server side?


Given that it is something used for visuals/rendering, it wont matter if the server is controlling the value. It'll still be editable on the client.

Server-side variables only protect on things that are 100% handled by the server and are nothing more then visual information ot the client. Such as handling the players health, gold, items, etc. If the server maintains the players gold entirely, for example, then any edits made to the players gold on the client will do nothing but visually show them having more than they do. But it wont be spendable/usable etc. since the server handles any usage of it.

For something like visuals of where a camera is looking, that is going to be editable no matter what since it is being processed on the players machine even if the value is sent from the server. The client is being told, by the server, where the camera is located in the current scene, where it's looking at, etc. which is all going to be editable.

Cheats like free-cams, zoom hacks, and so on exist because of it. Even being able to re-render the scene in a separate render surface (useful for things like rear-view mirrors) are possible.

Unless your game is basically sending fully rendered scenes to the player already, it's not something you're going to be able to protect.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Mon Sep 30, 2019 11:48 pm    Post subject: Reply with quote

What I meant is that the server is going to basically be running the client as well and you'd just be streaming the output back to the client. Their input would be streamed to the server etc. Obviously not an ideal setup for a game.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Wed Oct 02, 2019 12:50 pm    Post subject: Reply with quote

My example assumes the client is not managing anything. You are literally just streaming the video feed of the rendered client from the server to the client. Meaning the client has 0 control over anything. It is just viewing the result from the server altogether.

This isn't an ideal setup anyway, the amount of server hardware/power you'd need to render every single players game instance would make it unfeasible. It was just an example of basically the only way you'll protect the camera from being editable.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
checkemdubs
!BEWARE! Deletes post on answer
Reputation: 1

Joined: 06 Oct 2018
Posts: 3

PostPosted: Wed Oct 02, 2019 10:20 pm    Post subject: Reply with quote

atom0s wrote:
My example assumes the client is not managing anything. You are literally just streaming the video feed of the rendered client from the server to the client. Meaning the client has 0 control over anything. It is just viewing the result from the server altogether.

This isn't an ideal setup anyway, the amount of server hardware/power you'd need to render every single players game instance would make it unfeasible. It was just an example of basically the only way you'll protect the camera from being editable.


If I have event listeners in the host client that are not static memory locations and always a new memory location when it fires and deleted from memory after it fired, i guess if they respond to a variable change from server client to host client and do a effect on USER, can that be hacked in any way?

So still video stream of server client taking input from host client but host client has event listeners that react to server client output? Like if I have a device to “feel” the environment from video stream, can what I said be hacked to have different feelings for X feeling? I guess not, as you cant predict a new event listeners memory location and once fire deleted for memory garbage recycle so you cant predict where to place a codecave in order to redirect feeling to other feeling not created yet event listener!
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 155

Joined: 25 Jan 2006
Posts: 7986
Location: 127.0.0.1

PostPosted: Thu Oct 03, 2019 10:17 am    Post subject: Reply with quote

And another person that just deletes their posts.. locking this.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites