[REQUEST] Moonstone Island

Ask about cheats/tables for single player games here
User avatar
neofoxx
Noobzor
Noobzor
Posts: 7
Joined: Sun Feb 12, 2023 7:59 am
Reputation: 2

Re: [PAID REQUEST] Moonstone Island

Post by neofoxx »

Small video to see how to find right process in cheat engine and how to edit stamina.
Video

cici88
What is cheating?
What is cheating?
Posts: 3
Joined: Tue May 02, 2023 7:27 pm
Reputation: 0

Re: [REQUEST] Moonstone Island

Post by cici88 »

Sadly, this is all been wiped out with today's patch :(

User avatar
gradius12
Expert Cheater
Expert Cheater
Posts: 612
Joined: Mon Apr 02, 2018 2:07 am
Reputation: 45

Re: [REQUEST] Moonstone Island

Post by gradius12 »

cici88 wrote:
Wed Sep 27, 2023 10:14 pm
Sadly, this is all been wiped out with today's patch :(
it still works just tried it

cici88
What is cheating?
What is cheating?
Posts: 3
Joined: Tue May 02, 2023 7:27 pm
Reputation: 0

Re: [REQUEST] Moonstone Island

Post by cici88 »

gradius12 wrote:
Fri Sep 29, 2023 3:22 pm
cici88 wrote:
Wed Sep 27, 2023 10:14 pm
Sadly, this is all been wiped out with today's patch :(
it still works just tried it
I tried too, but doesn't work for me anymore. The second scan is blank, before it worked just fine
Nope, it works, I don't know why but now it work again o.o I'm really confused...ahahah

Jessen
Expert Cheater
Expert Cheater
Posts: 220
Joined: Sat Mar 04, 2017 10:03 am
Reputation: 33

Re: [REQUEST] Moonstone Island

Post by Jessen »

Can someone figure out how to freeze time so that we can take as long as we want on things?

lordsouf
Noobzor
Noobzor
Posts: 5
Joined: Tue Dec 01, 2020 7:09 pm
Reputation: 1

Re: [REQUEST] Moonstone Island

Post by lordsouf »

i still can't figure out how to freeze time any help please ?

tripledj21
What is cheating?
What is cheating?
Posts: 4
Joined: Mon Jan 23, 2023 4:54 pm
Reputation: 0

Re: [REQUEST] Moonstone Island

Post by tripledj21 »

I have pretty much got all my cheats to work except figuring out the time and how to keep my companions in a fight...by that i mean...I modify their health to never drop but for some reason it does, they disappear, but still continue to be attacked by the enemy. I can skip my turn but not attack in return. lol. The stamina/energy cheat is pretty much all I need but would be handy to freeze time occasionally. Anyone figure it out?

hudell
Noobzor
Noobzor
Posts: 5
Joined: Sun May 16, 2021 4:42 am
Reputation: 3

Re: [REQUEST] Moonstone Island

Post by hudell »

I debugged the game code here and found out that the time is stored internally in what seems to be a float variable; The formula to convert the internal value into the game time is this:

var time = (10 * Math.floor(internal_value * 10)) % 1440
var hours = Math.floor(time / 60)
var minutes = time % 60

but I'm still not sure how to search for this internal value using this.

leegao
Noobzor
Noobzor
Posts: 10
Joined: Wed Oct 04, 2023 9:04 pm
Reputation: 4

Re: [REQUEST] Moonstone Island

Post by leegao »

Hey folks,

I've been playing around with trying to RE this game a bit deeper. It turns out that it's pretty easy to do. It looks like the game was packaged up using NW.js. This means that there's a package.nw file in the game directory (a zip file, if you `file` it). Now according to [Link], you can actually extract this file into a folder also named `package.nw`, and the game will happily take it and continue to run out of that folder.

Now, `package.nw` contains all of the code/configuration for this game, which is then rendered through Chrome/NW as a WebGL game. Just going through this directory should help you figure out how to change item stats or trace through the code. However, if you're willing to use the Chrome devtools, you can actually change the game to start in debug mode, and give you a Chrome dev console to play around with the game internals.

To do this, change package.nw/package.json's chromium-args and remove the --disable-devtools argument. After this, launch the game, and press F12 to open the dev console.

It looks like this game is produced using the Construct 3 engine (I see a c3runtime.js), and the core game logic is obfuscated/minified in that file. There's some generic handlers in main.js, and there are a lot of json configs in the Data/ directory.

hudell
Noobzor
Noobzor
Posts: 5
Joined: Sun May 16, 2021 4:42 am
Reputation: 3

Re: [REQUEST] Moonstone Island

Post by hudell »

Yup, that's exactly what I did yesterday to find the time logic; The JS code you get is all from the construct3 engine, the actual game code is all data that is processed by the c3 code. It's all there but it's still kinda annoying trying to find anything useful, at least without some better knowledge of how construct3 works.

Jessen
Expert Cheater
Expert Cheater
Posts: 220
Joined: Sat Mar 04, 2017 10:03 am
Reputation: 33

Re: [REQUEST] Moonstone Island

Post by Jessen »

leegao wrote:
Wed Oct 04, 2023 9:40 pm
Hey folks,

I've been playing around with trying to RE this game a bit deeper. It turns out that it's pretty easy to do. It looks like the game was packaged up using NW.js. This means that there's a package.nw file in the game directory (a zip file, if you `file` it). Now according to [Link], you can actually extract this file into a folder also named `package.nw`, and the game will happily take it and continue to run out of that folder.

Now, `package.nw` contains all of the code/configuration for this game, which is then rendered through Chrome/NW as a WebGL game. Just going through this directory should help you figure out how to change item stats or trace through the code. However, if you're willing to use the Chrome devtools, you can actually change the game to start in debug mode, and give you a Chrome dev console to play around with the game internals.

To do this, change package.nw/package.json's chromium-args and remove the --disable-devtools argument. After this, launch the game, and press F12 to open the dev console.

It looks like this game is produced using the Construct 3 engine (I see a c3runtime.js), and the core game logic is obfuscated/minified in that file. There's some generic handlers in main.js, and there are a lot of json configs in the Data/ directory.
any chance we can get anything from the dev console? like how to add stuff or change spirits we have?

hudell
Noobzor
Noobzor
Posts: 5
Joined: Sun May 16, 2021 4:42 am
Reputation: 3

Re: [REQUEST] Moonstone Island

Post by hudell »

After another couple hours looking at the dev console, I figured out how the time is stored:
It's one single variable with the number of minutes since 2:10 am on day 1;

So to get the current value of the variable, you do:

years = current year - 1
months = years * 4 + (current month - 1)
days = months * 28 + (current day - 1)
hours = days * 24 + current hour
minutes = hours * 60 + current minute

So if you're on Summer 13 of the first year, at 06:20 it's:
(((0 * 4 + 1) * 28 + 12) * 24 + 6) * 60 + 20 = 57980

then you subtract 130 (from that 2:10 am of day 1) = 57850

if the clock shows 06:20, then the internal value will be between 57850 and 57860;
Wait for the clock to change, add 10 to both values and search again.

Jessen
Expert Cheater
Expert Cheater
Posts: 220
Joined: Sat Mar 04, 2017 10:03 am
Reputation: 33

Re: [REQUEST] Moonstone Island

Post by Jessen »

hudell wrote:
Thu Oct 05, 2023 12:40 am
After another couple hours looking at the dev console, I figured out how the time is stored:
It's one single variable with the number of minutes since 2:10 am on day 1;

So to get the current value of the variable, you do:

years = current year - 1
months = years * 4 + (current month - 1)
days = months * 28 + (current day - 1)
hours = days * 24 + current hour
minutes = hours * 60 + current minute

So if you're on Summer 13 of the first year, at 06:20 it's:
(((0 * 4 + 1) * 28 + 12) * 24 + 6) * 60 + 20 = 57980

then you subtract 130 (from that 2:10 am of day 1) = 57850

if the clock shows 06:20, then the internal value will be between 57850 and 57860;
Wait for the clock to change, add 10 to both values and search again.
that is... quite complex, and not sure I managed to do it right. i'm currently looking at year 1, fall, 24th. its a lot harder to figure it out myself I think.

hudell
Noobzor
Noobzor
Posts: 5
Joined: Sun May 16, 2021 4:42 am
Reputation: 3

Re: [REQUEST] Moonstone Island

Post by hudell »

Here's an alternative way of getting slower time:

Follow the instructions from leegao above to get access to the game files, then open the package.nw folder, then the scripts folder inside of it. There will be a file named c3runtime.js
Make a backup copy of this file somewhere else, then open it with notepad;
The code in that file is made auto generated so it's very hard to read anything, but you can press Ctrl+F to search for the following string:

Code: Select all

e.ExpObject("slowTime")?.1875:.375
There will be only one match. That .375 is how much the internal variable is increased at a time. If you change it to .1875, days will last twice as long. If you change it to .0375, days will last 10x longer.
Make sure you don't change anything else in that file or the game will not work.

(If you break the game, don't worry, just restore the backup copy of the file or go to steam and use the "verify file integrity" option)

leegao
Noobzor
Noobzor
Posts: 10
Joined: Wed Oct 04, 2023 9:04 pm
Reputation: 4

Re: [REQUEST] Moonstone Island

Post by leegao »

And to pin your stamina, do the same thing with c3runtime.js

Search for this string (it may have changed in an update)

Code: Select all

a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>and(and(Math.round(b.ExpInstVar()*(c.ExpObject()/(d.ExpObject()-16))),"/"),e.ExpInstVar())}
and replace it with

Code: Select all

a=> {
    const b = a._GetNode(0)
      , c = a._GetNode(1)
      , d = a._GetNode(2)
      , e = a._GetNode(3);
    return ()=> {
        for (let i of runtime$jscomp$1._instancesByUid.values()) {
            if (i._objectType._jsPropName == "Moon") {
                i._instVarValues[15] = i._instVarValues[14]; // 15 = current stamina, 14 = max? stamina
                break;
            }
        }
        return and(and(Math.round(b.ExpInstVar() * (c.ExpObject() / (d.ExpObject() - 16))), "/"), e.ExpInstVar());
    };
}
If you'd rather do this directly in the dev console, then here's what you can do:

1. Open the dev console
2. Go to sources
3. In the Threads tab (on the right side), click on the "Runtime" thread and suspend it's execution (pause button)
4. Go to console, and type in the following code
5. Continue

Code: Select all

        for (let i of runtime$jscomp$1._instancesByUid.values()) {
            if (i._objectType._jsPropName == "Moon") {
                i._instVarValues[15] = i._instVarValues[14]; // 15 = current stamina, 14 = max? stamina
                break;
            }
        }
You could also add/change the first (or nth) item of your inventory with this loop (I haven't actually tested this)

Code: Select all

        for (let i of runtime$jscomp$1._instancesByUid.values()) {
            if (i._objectType._jsPropName == "InventoryContainer" && i._instVarValues[0] == 0) { // First item in the inventory
                i._instVarValues[1] = "moonstone"; // _instVarValues[1] is the item type
                i._instVarValues[2] = 100 // _instVarValues[2] is the item count
                break;
            }
        }

As a tangent, some observations:

1. Construct 3 is a transpiler - games are built using Javascript, which is then transpiled into a stack interpreter DSL, it's why it's kind of hard to RE what this game is doing (that plus the strange matrix json format they use for configurations...)

2. The reason that integer values need to be 2x-ed in cheat engine makes sense - V8 probably uses some sort of tagged integer representation that shifts integers (adds an extra 0 for the LSB) which effectively 2xes the value. For non-integer values (or ones that overflows), V8 will instead sub the value with a pointer and then shift+incr to tag this as a boxed number. Stamina is hard to scan when it's not full because, for whatever reason, the game decides to multiply the stamina by some fraction instead of just -2, as a result, the value is often non-integer. For e.g., when I had 256 stamina, the internal instance of the player stats shows something like 255.9..., and because it's non-integer, it doesn't work with the 2x trick :(

Trying to reverse engineer the stack interpreter would be fun, but also maddening. I think this + the time hack should be enough for most things.

Post Reply