Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Spent like 20 minutes writing this after somebody requested it be done. There are a ton of values stored that I imagine would prove useful in cheating in this game, but I have not had the time to dig into them. Feel free to poke around and try to change other aspects of game play with this!
- //The max value for any of these is 255!
- var MONEY = 255;
- var BLUEFOOD = 255;
- var FOOD = 255;
- //
- //
- var keyPath = "/idbfs/053f673d27a09817656a5a6f48f6e143/PlayerPrefs";
- var req = indexedDB.open("/idbfs", 21);
- req.onerror = function (event) {
- console.log("[!] Unable to open DB!");
- };
- req.onsuccess = function (event) {
- console.log("[*] Opened DB!");
- var db = event.target.result;
- var transaction = db.transaction(["FILE_DATA"], "readwrite");
- var kObjStore = transaction.objectStore("FILE_DATA");
- kObjStore.openCursor().onsuccess = function (event) {
- var cursor = event.target.result;
- if (cursor) {
- if (cursor.key == keyPath) {
- console.log("[*] Found key!");
- var reqData = kObjStore.get(keyPath);
- reqData.onerror = function (event) {
- console.log("[!] Unable to read data from key! (\"" + keyPath + "\")");
- };
- reqData.onsuccess = function (event) {
- console.log("[*] Read data from key!");
- var data = event.target.result;
- console.log(data);
- var u8arr = new Uint8Array([85,
- 110,
- 105,
- 116,
- 121,
- 80,
- 114,
- 102,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 16,
- 0,
- 8,
- 98,
- 108,
- 117,
- 101,
- 115,
- 101,
- 101,
- 100,
- 254,
- BLUEFOOD,
- 0,
- 0,
- 0,
- 5,
- 99,
- 111,
- 105,
- 110,
- 115,
- 254,
- 99,
- 0,
- 0,
- 0,
- 6,
- 99,
- 111,
- 108,
- 111,
- 117,
- 114,
- 254,
- 1,
- 0,
- 0,
- 0,
- 9,
- MONEY,
- 111,
- 109,
- 112,
- 108,
- 101,
- 116,
- 101,
- 100,
- 15,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 102,
- 8,
- 101,
- 110,
- 101,
- 114,
- 103,
- 121,
- 120,
- 112,
- 253,
- 0,
- 0,
- 0,
- 0,
- 5,
- 102,
- 108,
- 121,
- 120,
- 112,
- 253,
- 0,
- 0,
- 0,
- 0,
- 3,
- 104,
- 97,
- 116,
- 254,
- 0,
- 0,
- 0,
- 0,
- 5,
- 109,
- 117,
- 115,
- 105,
- 99,
- 254,
- 0,
- 0,
- 0,
- 0,
- 5,
- 114,
- 117,
- 110,
- 120,
- 112,
- 253,
- 0,
- 0,
- 0,
- 0,
- 4,
- 115,
- 101,
- 101,
- 100,
- 254,
- FOOD,
- 0,
- 0,
- 0,
- 6,
- 115,
- 119,
- 105,
- 109,
- 120,
- 112,
- 253,
- 0,
- 0,
- 0,
- 0,
- 18,
- 117,
- 110,
- 105,
- 116,
- 121,
- 46,
- 99,
- 108,
- 111,
- 117,
- 100,
- 95,
- 117,
- 115,
- 101,
- 114,
- 105,
- 100,
- 32,
- 100,
- 51,
- 48,
- 54,
- 56,
- 48,
- 54,
- 48,
- 55,
- 53,
- 102,
- 53,
- 99,
- 98,
- 51,
- 55,
- 50,
- 97,
- 50,
- 49,
- 56,
- 97,
- 48,
- 102,
- 57,
- 56,
- 99,
- 49,
- 54,
- 100,
- 99,
- 55,
- 33,
- 117,
- 110,
- 105,
- 116,
- 121,
- 46,
- 112,
- 108,
- 97,
- 121,
- 101,
- 114,
- 95,
- 115,
- 101,
- 115,
- 115,
- 105,
- 111,
- 110,
- 95,
- 101,
- 108,
- 97,
- 112,
- 115,
- 101,
- 100,
- 95,
- 116,
- 105,
- 109,
- 101,
- 1,
- 48,
- 22,
- 117,
- 110,
- 105,
- 116,
- 121,
- 46,
- 112,
- 108,
- 97,
- 121,
- 101,
- 114,
- 95,
- 115,
- 101,
- 115,
- 115,
- 105,
- 111,
- 110,
- 105,
- 100,
- 19,
- 53,
- 56,
- 54,
- 56,
- 56,
- 50,
- 49,
- 57,
- 49,
- 56,
- 51,
- 52,
- 56,
- 52,
- 55,
- 53,
- 53,
- 56,
- 55]);
- data.contents = u8arr;
- //change data here
- var reqUpdate = kObjStore.put(data, keyPath);
- reqUpdate.onerror = function (event) {
- console.log("[!] Unable to write to DB!");
- };
- reqUpdate.onsuccess = function (event) {
- console.log("[*] DB write Successful!");
- console.log(data);
- };
- };
- }
- cursor.continue();
- } else {}
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement