Hacking JavaScript Games – Accessing private javascript variables at runtime via debugging


Hacking JavaScript Games – Accessing private javascript variables at runtime via debugging
Taigamemienphi.vn – Chuyên trang tải game miễn phí – Kho Game tổng hợp số 1 Việt Nam
JavaScript private variables cannot be accessed from the console, which makes hacking the game hard and automating it from the console hard. The game I’m using is an open source PacMan JavaScript game which is entirely called from an anonymous function. I show the debugging technique I use for making bots possible.

You can support me on Patreon (watch my videos ad free and receive extra content)

Hire me for consultancy and buy my online books and training at:

Xem thêm: Hack Game

Nguồn: Tải Game Miễn Phí


  1. Hey there, nice video!
    I'm trying to hack this instantgame on Facebook called Ludo King.
    I have found several Function calls, but the values just don't seem to get updated on the variables. No matter what value I give the variables, they always don't change.

    Also, the game's code isn't as readable as the one in the video, they seem to be like obfuscated in some manner. Could you please have a look at it when you have the time?

  2. I understand you're exposing them after setting a breakpoint, but can't you just click on the line in the js file, edit what you want, press ctrl+s to save and it does the same thing?

  3. How can I window the below code?

    this.validateInputs = function () {

    u(function () {
    if (c.toPage && c.fromPage) {
    if ('0' != c.fromPage.toString().charAt(0) && '0' != c.toPage.toString().charAt(0)) return c.firstPage = c.convertPageToIndex(c.fromPage, !0),
    c.lastPage = c.convertPageToIndex(c.toPage, !1),
    c.validateError = !1,
    c.firstPage && c.lastPage ? c.validateFromToPages() : c.displayError = a.instant('GT_BOOK_PRINT_INVALID_PAGE_RANGE');
    c.displayError = a.instant('GT_BOOK_PRINT_INVALID_PAGE_RANGE')
    } else c.displayError = '',
    c.validateError = !0
    }, 1000)

  4. Great video, I'm working on a game where there are several "classes" within a function, which are named things like ea, Qq for example, but some variables begin with this. , for example this.health, but even in console I can't access this value, do you have any idea how I might get around this? It's confusing the hell out of me

  5. It's so easy, it's pathetic. So much for global variables are evil. Every JS developer should watch this.

  6. Hey, first of all thanks for this video. I'm new to browser games and had no idea where to start. I do have a question though, I'm trying to automate a little minigame without interfering with the timer. But to automate it I have to use a python library and thus I need to extract the javascript object, or at least some of the values, in order to use them in python. Do you know if / how this possible? Thanks!

  7. Would it be possible to turn this into a script or a chrome extension? So that someone could use this without having to manually open the debugger and set a breakpoint

  8. Hi there, First of all thanks for this great tutorial. I tried this thing but the game I am trying it on doesn't update my window (global) variable with the new values. Since its a ludo game, I think it creates a new object at every turn so the old one is left untouched. Please let me know what you think, Thanks.

  9. The debugger is a really powerful thing. Hacking games is one of the simples things, that can come into your mind. It allows you to take control into your hands and do whatever you want. Very good explanation and demo.
    P.S. I didn't know, that you can access them from the console while on breakpoint, so I always did that via local variables. Thanks

Comments are closed.