Jump to content

How to Hack & Crack Unity Game Coding with LuaJIT/Lua5.3


9 posts in this topic

Recommended Posts

To save time Many game-developer are trying to make unity game with some third-part lua plugin such as Slua or Xlua In this developing mode the source code are not in Ida but in lua script compressed in unity bundle asset.I found that many hackers dont know much about how to crack such game.so i decided to make a tut for that in detail and share my own lua tool to help you read rua bytecode.you cant find such tool anywhere except here. 

Slua github:https://github.com/leinlin/slua

Xlua:https://github.com/Tencent/xLua

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Luajit wiki:http://wiki.luajit.org/Bytecode-2.0  ;explaining how the luajit Vm bytecode work is complicated so please study it on your own

Luajit dis-asm tool: https://armconverter.com/luatools/ or https://iosddl.net/2d385e1427003585/jit.rar
Usage:luajit -blg XXX

Luajit example:https://imgur.com/vKWVyrZ

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The lua dis-asm tool are only work on lua version 5.3.5 The lastest version is 5.4 i will keep updating and sharing it to public

Lua5.3.5 wiki:https://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html

Lua5.3.5 dis-asm tool:https://iosddl.net/82d5111f913c37bc/luac.exe

Lua5.3.5 example:https://imgur.com/JsjfWdm

Usage:
  -l       list bytecode
  -d       decompile bytecode
  -i       dump instruction
  -o name  output to file 'name' (default is "luac.out")
  -p       parse only
  -s       strip debug information
  -v       show version information
  --       stop handling options
  -        stop handling options and process stdin
  -iABC    make a iABC instruction
  -iABx    make a ABx  instruction
  -iAsBx   make a AsBx instruction
  -iAx     make a iAx instruction

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//inject code example

#include <Foundation/Foundation.h>
#include "Config.h"
#include <sys/socket.h> 
#import <AudioToolbox/AudioToolbox.h>
#include <sys/sysctl.h>
#import <AdSupport/ASIdentifierManager.h> 
#import "MediaPlayer/MPVolumeView.h"
#import "AudioToolbox/AudioToolbox.h"
#include <sys/stat.h>
#include <mach-o/dyld.h>
#include <mach-o/dyld.h>
#include <mach-o/ldsyms.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#include <vector>
# include <stdio.h>
# include <stdlib.h>

//modified lua script with winhex
unsigned char data[3410] = {
  0x2D, 0x2D, 0x20, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 0xB3, 0xE8, 0xAE, 0xA1, 0xE7, 0xAE, 0x97, 0x0D, 
  0x0A, 0x66, 0x75, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x63, 0x61, 0x6C, 0x63, 0x75, 0x6C, 
  0x61, 0x74, 0x65, 0x44, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x28, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 
  0x5F, 0x74, 0x79, 0x70, 0x65, 0x2C, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x2C, 0x20, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2C, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x29, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x2D, 0x2D, 
  0x5B, 0x5B, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 
  0x20, 0x30, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x64, 0x61, 
  0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x2E, 0x38, 0x0D, 
  0x0A, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x5F, 0x74, 
  0x79, 0x70, 0x65, 0x20, 0x3D, 0x3D, 0x20, 0x42, 0x41, 0x54, 0x54, 0x4C, 0x45, 0x5F, 0x41, 0x54, 
  0x54, 0x41, 0x43, 0x4B, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x5F, 0x50, 0x48, 0x59, 0x53, 0x49, 0x43, 
  0x41, 0x4C, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
  0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x70, 0x68, 0x79, 0x73, 
  0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 0x20, 0x2F, 0x20, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 
  0x61, 0x6C, 0x5F, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 
  0x6C, 0x73, 0x65, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x65, 
  0x66, 0x65, 0x6E, 0x73, 0x65, 0x20, 0x2F, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 
  0x6F, 0x6D, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x0D, 
  0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 
  0x69, 0x66, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3E, 
  0x20, 0x30, 0x2E, 0x38, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 
  0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 
  0x20, 0x30, 0x2E, 0x38, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 
  0x0A, 0x20, 0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x61, 0x74, 
  0x74, 0x61, 0x63, 0x6B, 0x20, 0x2A, 0x20, 0x28, 0x31, 0x20, 0x2D, 0x20, 0x64, 0x61, 0x6D, 0x61, 
  0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x29, 0x0D, 0x0A, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 
  0x72, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5D, 0x5D, 0x0D, 
  0x0A, 0x09, 0x0D, 0x0A, 0x09, 0x2D, 0x2D, 0x20, 0xE6, 0x94, 0xBB, 0xE5, 0x87, 0xBB, 0xE5, 0x8A, 
  0x9B, 0xE5, 0x80, 0xBC, 0xE4, 0xBF, 0xAE, 0xE5, 0xA4, 0x8D, 0xEF, 0xBC, 0x8C, 0xE9, 0x98, 0xB2, 
  0xE6, 0xAD, 0xA2, 0xE5, 0x87, 0xBA, 0xE7, 0x8E, 0xB0, 0x30, 0x2F, 0x30, 0xE7, 0x9A, 0x84, 0xE6, 
  0x83, 0x85, 0xE5, 0x86, 0xB5, 0x0D, 0x0A, 0x09, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x20, 0x3D, 
  0x20, 0x6D, 0x61, 0x74, 0x68, 0x2E, 0x6D, 0x61, 0x78, 0x28, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 
  0x2C, 0x20, 0x31, 0x29, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 
  0x6C, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 
  0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE5, 0x87, 0x8F, 0xE5, 0x85, 0x8D, 0xE4, 0xBC, 0xA4, 
  0xE5, 0xAE, 0xB3, 0x20, 0x20, 0x20, 0x28, 0xE8, 0xAE, 0xA1, 0xE7, 0xAE, 0x97, 0xE4, 0xBC, 0xA4, 
  0xE5, 0xAE, 0xB3, 0xE5, 0x90, 0x8E, 0xEF, 0xBC, 0x8C, 0xE5, 0x8F, 0x97, 0xE4, 0xBC, 0xA4, 0xE6, 
  0x96, 0xB9, 0x29, 0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x72, 0x65, 0x64, 0x75, 
  0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 
  0x20, 0x31, 0x30, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE5, 0x87, 0x8F, 0xE5, 0x85, 0x8D, 0xE4, 0xBC, 
  0xA4, 0xE5, 0xAE, 0xB3, 0xE7, 0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x20, 0x28, 0xE8, 
  0xAE, 0xA1, 0xE7, 0xAE, 0x97, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 0xB3, 0xE5, 0x90, 0x8E, 0xEF, 0xBC, 
  0x8C, 0xE5, 0x8F, 0x97, 0xE4, 0xBC, 0xA4, 0xE6, 0x96, 0xB9, 0x29, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 
  0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 
  0xB3, 0xE5, 0x80, 0xBC, 0xE5, 0xA2, 0x9E, 0xE5, 0x87, 0x8F, 0x20, 0x28, 0xE8, 0xAE, 0xA1, 0xE7, 
  0xAE, 0x97, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 0xB3, 0xE5, 0x90, 0x8E, 0xEF, 0xBC, 0x8C, 0xE6, 0x94, 
  0xBB, 0xE5, 0x87, 0xBB, 0xE6, 0x96, 0xB9, 0x29, 0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 
  0x20, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 
  0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x31, 0x30, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE4, 0xBC, 0xA4, 
  0xE5, 0xAE, 0xB3, 0xE7, 0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0xE5, 0xA2, 0x9E, 0xE5, 
  0x87, 0x8F, 0x20, 0x28, 0xE8, 0xAE, 0xA1, 0xE7, 0xAE, 0x97, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 0xB3, 
  0xE5, 0x90, 0x8E, 0xEF, 0xBC, 0x8C, 0xE6, 0x94, 0xBB, 0xE5, 0x87, 0xBB, 0xE6, 0x96, 0xB9, 0x29, 
  0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 
  0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 0x20, 
  0xE6, 0x8A, 0xA4, 0xE7, 0x94, 0xB2, 0xE7, 0xA9, 0xBF, 0xE9, 0x80, 0x8F, 0x0D, 0x0A, 0x09, 0x6C, 
  0x6F, 0x63, 0x61, 0x6C, 0x20, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 
  0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE6, 0xB3, 0x95, 0xE6, 0x9C, 0xAF, 0xE7, 
  0xA9, 0xBF, 0xE9, 0x80, 0x8F, 0x0D, 0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x70, 0x68, 
  0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x5F, 0x72, 0x61, 
  0x74, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 0x20, 0xE6, 0x8A, 0xA4, 0xE7, 0x94, 0xB2, 
  0xE7, 0xA9, 0xBF, 0xE9, 0x80, 0x8F, 0xE7, 0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 
  0x0A, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x69, 0x6E, 
  0x67, 0x6F, 0x72, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x2D, 0x2D, 
  0x20, 0xE6, 0xB3, 0x95, 0xE6, 0x9C, 0xAF, 0xE7, 0xA9, 0xBF, 0xE9, 0x80, 0x8F, 0xE7, 0x99, 0xBE, 
  0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x2D, 0x2D, 0x20, 0xE6, 0x94, 
  0xBB, 0xE5, 0x87, 0xBB, 0xE6, 0x96, 0xB9, 0xE7, 0x9A, 0x84, 0xE6, 0x83, 0x85, 0xE5, 0x86, 0xB5, 
  0x0D, 0x0A, 0x09, 0x69, 0x66, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 
  0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x70, 0x68, 0x79, 0x73, 0x69, 
  0x63, 0x61, 0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 
  0x5F, 0x64, 0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 0x5F, 0x69, 0x67, 0x6E, 0x6F, 0x72, 0x65, 0x5F, 
  0x76, 0x61, 0x6C, 0x75, 0x65, 0x0D, 0x0A, 0x09, 0x09, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x69, 
  0x6E, 0x67, 0x6F, 0x72, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 
  0x6F, 0x6D, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 
  0x5F, 0x69, 0x67, 0x6E, 0x6F, 0x72, 0x65, 0x5F, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x0D, 0x0A, 0x09, 
  0x09, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 
  0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 
  0x6F, 0x6D, 0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 0x65, 0x66, 0x65, 
  0x6E, 0x73, 0x65, 0x5F, 0x69, 0x67, 0x6E, 0x6F, 0x72, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 
  0x2D, 0x2D, 0x20, 0xE6, 0x8A, 0xA4, 0xE7, 0x94, 0xB2, 0xE7, 0xA9, 0xBF, 0xE9, 0x80, 0x8F, 0xE7, 
  0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 0x0A, 0x09, 0x09, 0x6D, 0x61, 0x67, 0x69, 
  0x63, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 
  0x5F, 0x64, 0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 0x5F, 0x69, 0x67, 0x6E, 0x6F, 0x72, 0x65, 0x5F, 
  0x72, 0x61, 0x74, 0x65, 0x20, 0x2D, 0x2D, 0x20, 0xE6, 0xB3, 0x95, 0xE6, 0x9C, 0xAF, 0xE7, 0xA9, 
  0xBF, 0xE9, 0x80, 0x8F, 0xE7, 0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 0x0A, 0x09, 
  0x09, 0x0D, 0x0A, 0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x5F, 0x74, 
  0x79, 0x70, 0x65, 0x20, 0x3D, 0x3D, 0x20, 0x42, 0x41, 0x54, 0x54, 0x4C, 0x45, 0x5F, 0x41, 0x54, 
  0x54, 0x41, 0x43, 0x4B, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x5F, 0x50, 0x48, 0x59, 0x53, 0x49, 0x43, 
  0x41, 0x4C, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x09, 0x09, 0x63, 0x68, 0x61, 0x6E, 
  0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 
  0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x0D, 0x0A, 0x09, 0x09, 
  0x09, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 
  0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 
  0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 
  0x5F, 0x72, 0x61, 0x74, 0x65, 0x0D, 0x0A, 0x09, 0x09, 0x65, 0x6C, 0x73, 0x65, 0x0D, 0x0A, 0x09, 
  0x09, 0x09, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 
  0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x2E, 0x6D, 0x61, 0x67, 
  0x69, 0x63, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x0D, 
  0x0A, 0x09, 0x09, 0x09, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 
  0x72, 0x6F, 0x6D, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 
  0x5F, 0x72, 0x61, 0x74, 0x65, 0x0D, 0x0A, 0x09, 0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 
  0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x69, 0x66, 0x20, 0x61, 0x74, 
  0x74, 0x61, 0x63, 0x6B, 0x5F, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3D, 0x3D, 0x20, 0x42, 0x41, 0x54, 
  0x54, 0x4C, 0x45, 0x5F, 0x41, 0x54, 0x54, 0x41, 0x43, 0x4B, 0x5F, 0x54, 0x59, 0x50, 0x45, 0x5F, 
  0x50, 0x48, 0x59, 0x53, 0x49, 0x43, 0x41, 0x4C, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 
  0x09, 0x09, 0x09, 0x0D, 0x0A, 0x09, 0x20, 0x20, 0x20, 0x20, 0x2D, 0x2D, 0x20, 0xE5, 0x87, 0x8F, 
  0xE5, 0x85, 0x8D, 0x62, 0x75, 0x66, 0x66, 0xE6, 0x83, 0x85, 0xE5, 0x86, 0xB5, 0x0D, 0x0A, 0x09, 
  0x09, 0x2D, 0x2D, 0x20, 0xE7, 0x99, 0xBE, 0xE5, 0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 0x0A, 0x09, 
  0x09, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 
  0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 
  0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 
  0x61, 0x6C, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x0D, 0x0A, 
  0x0D, 0x0A, 0x09, 0x09, 0x2D, 0x2D, 0x20, 0x0D, 0x0A, 0x09, 0x09, 0x69, 0x66, 0x20, 0x64, 0x61, 
  0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6E, 0x6F, 0x74, 
  0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x3A, 0x69, 0x73, 0x4A, 0x69, 
  0x6E, 0x5A, 0x68, 0x61, 0x6E, 0x28, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x09, 
  0x09, 0x2D, 0x2D, 0x20, 0xE8, 0xBF, 0x9C, 0xE7, 0xA8, 0x8B, 0x20, 0x20, 0x0D, 0x0A, 0x09, 0x09, 
  0x09, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 
  0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2A, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x73, 
  0x68, 0x6F, 0x6F, 0x74, 0x65, 0x72, 0x5F, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2F, 0x20, 0x31, 0x30, 
  0x30, 0x0D, 0x0A, 0x09, 0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x69, 0x66, 
  0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x72, 0x65, 
  0x64, 0x75, 0x63, 0x65, 0x5F, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 0x61, 
  0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x3D, 0x20, 0x30, 0x20, 0x74, 
  0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x09, 0x09, 0x2D, 0x2D, 0x20, 0xE7, 0x89, 0xA9, 0xE7, 0x90, 
  0x86, 0xE5, 0x85, 0x8D, 0xE7, 0x96, 0xAB, 0x0D, 0x0A, 0x09, 0x09, 0x09, 0x64, 0x61, 0x6D, 0x61, 
  0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3A, 0x61, 0x64, 0x64, 0x53, 0x68, 0x6F, 0x77, 
  0x57, 0x6F, 0x72, 0x64, 0x28, 0x33, 0x2C, 0x20, 0x34, 0x37, 0x30, 0x30, 0x30, 0x33, 0x29, 0x0D, 
  0x0A, 0x09, 0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x2D, 0x2D, 0x20, 0xE6, 
  0x95, 0xB0, 0xE5, 0x80, 0xBC, 0x0D, 0x0A, 0x09, 0x09, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 
  0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x70, 0x68, 0x79, 
  0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x76, 0x61, 0x6C, 
  0x75, 0x65, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x2D, 0x2D, 0x20, 0xE7, 0xA9, 0xBF, 0xE9, 0x80, 
  0x8F, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x20, 0x3D, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x20, 0x2A, 0x20, 0x61, 0x74, 0x74, 
  0x61, 0x63, 0x6B, 0x20, 0x2F, 0x20, 0x28, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x20, 0x2B, 0x20, 
  0x6D, 0x61, 0x74, 0x68, 0x2E, 0x6D, 0x61, 0x78, 0x28, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 
  0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x64, 
  0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 0x20, 0x2A, 0x20, 0x28, 0x31, 0x30, 0x30, 0x20, 0x2D, 0x20, 
  0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x5F, 
  0x72, 0x61, 0x74, 0x65, 0x20, 0x29, 0x20, 0x2F, 0x20, 0x31, 0x30, 0x30, 0x20, 0x2D, 0x20, 0x70, 
  0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6C, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x2C, 0x30, 
  0x29, 0x29, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6C, 0x73, 0x65, 0x0D, 0x0A, 0x09, 0x09, 
  0x20, 0x2D, 0x2D, 0x20, 0xE5, 0x87, 0x8F, 0xE5, 0x85, 0x8D, 0x62, 0x75, 0x66, 0x66, 0xE6, 0x83, 
  0x85, 0xE5, 0x86, 0xB5, 0x0D, 0x0A, 0x09, 0x09, 0x20, 0x2D, 0x2D, 0x20, 0xE7, 0x99, 0xBE, 0xE5, 
  0x88, 0x86, 0xE6, 0xAF, 0x94, 0x0D, 0x0A, 0x09, 0x09, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 
  0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 
  0x65, 0x5F, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 
  0x61, 0x74, 0x65, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x69, 0x66, 0x20, 0x64, 0x61, 0x6D, 0x61, 
  0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6F, 0x6D, 0x3A, 0x69, 0x73, 0x4A, 0x69, 0x6E, 0x5A, 
  0x68, 0x61, 0x6E, 0x28, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x09, 0x09, 0x2D, 
  0x2D, 0x20, 0xE8, 0xBF, 0x9C, 0xE7, 0xA8, 0x8B, 0x20, 0x20, 0x0D, 0x0A, 0x09, 0x09, 0x09, 0x72, 
  0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 
  0x65, 0x20, 0x3D, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2A, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 
  0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x73, 0x68, 0x6F, 
  0x6F, 0x74, 0x65, 0x72, 0x5F, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2F, 0x20, 0x31, 0x30, 0x30, 0x0D, 0x0A, 0x09, 0x09, 
  0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x09, 0x2D, 0x2D, 0x20, 0xE6, 0x95, 0xB0, 0xE5, 
  0x80, 0xBC, 0x0D, 0x0A, 0x09, 0x09, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 
  0x65, 0x74, 0x2E, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 
  0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x0D, 0x0A, 0x0D, 0x0A, 
  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 
  0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x20, 0x2A, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 
  0x20, 0x2F, 0x20, 0x28, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x20, 0x2B, 0x20, 0x6D, 0x61, 0x74, 
  0x68, 0x2E, 0x6D, 0x61, 0x78, 0x28, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 
  0x65, 0x74, 0x2E, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x64, 0x65, 0x66, 0x65, 0x6E, 0x73, 0x65, 
  0x20, 0x2A, 0x20, 0x28, 0x31, 0x30, 0x30, 0x20, 0x2D, 0x20, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 
  0x69, 0x6E, 0x67, 0x6F, 0x72, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x29, 0x20, 0x2F, 0x20, 0x31, 
  0x30, 0x30, 0x20, 0x2D, 0x20, 0x6D, 0x61, 0x67, 0x69, 0x63, 0x5F, 0x69, 0x6E, 0x67, 0x6F, 0x72, 
  0x65, 0x2C, 0x30, 0x29, 0x29, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 
  0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x0D, 0x0A, 0x09, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 
  0x3D, 0x20, 0x28, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x2B, 0x20, 0x63, 0x68, 0x61, 0x6E, 
  0x67, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x29, 0x20, 0x2A, 0x20, 0x72, 0x65, 0x64, 
  0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 
  0x2F, 0x20, 0x31, 0x30, 0x30, 0x20, 0x2A, 0x20, 0x63, 0x68, 0x61, 0x6E, 0x67, 0x65, 0x5F, 0x64, 
  0x61, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2F, 0x20, 0x31, 0x30, 0x30, 
  0x20, 0x2D, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x5F, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 
  0x20, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x69, 0x66, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 
  0x3C, 0x20, 0x30, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x09, 0x64, 0x61, 0x6D, 0x61, 
  0x67, 0x65, 0x20, 0x3D, 0x20, 0x30, 0x20, 0x0D, 0x0A, 0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 0x09, 
  0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 0x3D, 0x20, 0x30, 
  0x0D, 0x0A, 0x09, 0x2D, 0x2D, 0x20, 0xE8, 0xBF, 0x94, 0xE5, 0x9B, 0x9E, 0xE5, 0x8A, 0xA0, 0xE4, 
  0xB8, 0xAA, 0xE4, 0xBC, 0xA4, 0xE5, 0xAE, 0xB3, 0xE7, 0xB1, 0xBB, 0xE5, 0x9E, 0x8B, 0x0D, 0x0A, 
  0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x4F, 0x62, 0x6A, 
  0x20, 0x3D, 0x20, 0x7B, 0x7D, 0x0D, 0x0A, 0x09, 0x69, 0x66, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2E, 0x74, 0x65, 0x61, 0x6D, 0x20, 0x3D, 0x3D, 0x20, 
  0x32, 0x20, 0x74, 0x68, 0x65, 0x6E, 0x0D, 0x0A, 0x09, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x20, 
  0x3D, 0x20, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x0D, 0x0A, 0x09, 0x65, 0x6E, 0x64, 0x0D, 0x0A, 
  0x09, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x4F, 0x62, 0x6A, 0x2E, 0x64, 0x61, 0x6D, 0x61, 0x67, 
  0x65, 0x20, 0x3D, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x0D, 0x0A, 0x09, 0x64, 0x61, 0x6D, 
  0x61, 0x67, 0x65, 0x4F, 0x62, 0x6A, 0x2E, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 
  0x65, 0x20, 0x3D, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6B, 0x5F, 0x74, 0x79, 0x70, 0x65, 0x20, 
  0x20, 0x2D, 0x2D, 0x20, 0xE7, 0x89, 0xA9, 0xE7, 0x90, 0x86, 0xEF, 0xBC, 0x8C, 0xE9, 0xAD, 0x94, 
  0xE6, 0xB3, 0x95, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x0D, 0x0A, 0x0D, 0x0A, 0x09, 0x72, 0x65, 0x74, 
  0x75, 0x72, 0x6E, 0x20, 0x64, 0x61, 0x6D, 0x61, 0x67, 0x65, 0x4F, 0x62, 0x6A, 0x0D, 0x0A, 0x65, 
  0x6E, 0x64
};

typedef int (*_luaL_loadbuffer)(void* L,
                     const char *buff,
                     size_t sz,
                     const char *name);
_luaL_loadbuffer luaL_loadbuffer;

typedef void* (*_luaL_newstate)();
_luaL_newstate luaL_newstate;


typedef int (*_lua_Writer) (void* L, const void* p, size_t sz, void* ud);
_lua_Writer lua_Writer;

typedef int (*_lua_dump) (void *L, _lua_Writer writer, void *data);
_lua_dump lua_dump;

int MemoryWriter(void* ls, const void* p, size_t sz, void* ud)
{
    writeToFile(p,sz);
    return 0;
}

typedef const char* (*_lua_tostring)(void *L, int index);
_lua_tostring lua_tostring;

int (*_loadbuffer)(void* L,
                     const char *buff,
                     size_t sz,
                     const char *name);

int i = 0; // used as dumped file name
//L = lua state
//buff = script bytecode
//sz = script size
//name = script name
int $loadbuffer(void* L,const char *buff,size_t sz,const char *name) //hook loading function to dump all script of game
{   
    /*dump lua script to documents folder
    std::string path(N2C(NSHomeDirectory()));  //get app home Directory N2C mean convert NString to C_string
    path = path + "/Documents/" + std::to_string(i); //name dumped script with number in order
    FILE* file = fopen(path.c_str(),"wb+"); //create file handle
    i++                                        
    fwrite(buff,sz,1,file);   //write buff to file
    fclose(file);
    */
    
    //inject 
    if(sz > 100 && memcmp((void*)buff,(void*)data,100) == 0)  //if buff is target lua then replace the original buff with ours
    {
       return _loadbuffer(L,(const char*)data,sizeof(data),name); //return modified script 
    }
  
    return _loadbuffer(L,buff,sz,name);  //if not target return original lua script

}


CNConstructor(SexyAss) 
{
  MSHookFunction( ((void*)CNAddr(0x0015D5A0 + 1))  , (void *)$loadbuffer, (void **)&_loadbuffer); // hook lua_loadbuffer

}  


      
 

 

 

 

Updated by caoyin
  • Like 9
  • Winner 3
  • Thanks 1
  • Haha 1
  • Agree 1
  • Informative 2

Amazing. If you’re familiar with methods of decrypting encrypted iOS lua app files or intercepting them unencrypted upon app runtime please consider adding that to this tutorial :) 

On 2/7/2022 at 11:26 AM, AlyssaX64 said:

Amazing. If you’re familiar with methods of decrypting encrypted iOS lua app files or intercepting them unencrypted upon app runtime please consider adding that to this tutorial :) 

i 2nd this

 

  • Laxus unpinned this topic
  • Our picks

    • Legend of Yeomra v1.4.5 +4 Jailed Cheats
      Modded/Hacked App: Legend of Yeomra By FunTrigger Corp.
      Bundle ID: com.funtrigger.underworld
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-yeomra/id6499010916?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Damage Multiplier
      - Defense Multiplier
      - Unlimited Currencies → Spend/Gain
      - Pass Unlocked


      Jailbreak required hack(s): 


      iOS Hack Download IPA Link:

      Hidden Content

      Download via the iOSGods App








      PC Installation Instructions:
      STEP 1: If necessary, uninstall the app if you have it installed on your iDevice. Some hacked IPAs will install as a duplicate app. Make sure to back it up so you don't lose your progress.
      STEP 2: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see this tutorial topic.
      STEP 3: Download Sideloadly and install it on your PC.
      STEP 4: Open/Run Sideloadly on your computer, connect your iOS Device, and wait until your device name shows up.
      STEP 5: Once your iDevice appears, drag the modded .IPA file you downloaded and drop it inside the Sideloadly application.
      STEP 6: You will now have to enter your iTunes/Apple ID email login, press "Start" & then you will be asked to enter your password. Go ahead and enter the required information.
      STEP 7: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 8: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles/VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 9: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. Jailbroken iDevices can also use Sideloadly/Filza/IPA Installer to normally install the IPA with AppSync. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue down below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Haha
        • Thanks
        • Like
      • 23 replies
    • Legend of Yeomra v1.4.5 +4 Cheats
      Modded/Hacked App: Legend of Yeomra By FunTrigger Corp.
      Bundle ID: com.funtrigger.underworld
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-yeomra/id6499010916?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Damage Multiplier
      - Defense Multiplier
      - Unlimited Currencies → Spend/Gain
      - Pass Unlocked


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


      iOS Hack Download Link:

      Hidden Content

      Download Hack








      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 33 replies
    • Window Garden - Lofi Idle Game v1.4.17 +1 Jailed Cheat
      Modded/Hacked App: Window Garden - Lofi Idle Game By Camille Santiago
      Bundle ID: com.cloverfi.windowgarden
      iTunes Store Link: https://apps.apple.com/us/app/window-garden-lofi-idle-game/id6473402739?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Unlimited Gold → Spend/Gain


      Jailbreak required hack(s): 


      iOS Hack Download IPA Link:

      Hidden Content

      Download via the iOSGods App








      PC Installation Instructions:
      STEP 1: If necessary, uninstall the app if you have it installed on your iDevice. Some hacked IPAs will install as a duplicate app. Make sure to back it up so you don't lose your progress.
      STEP 2: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see this tutorial topic.
      STEP 3: Download Sideloadly and install it on your PC.
      STEP 4: Open/Run Sideloadly on your computer, connect your iOS Device, and wait until your device name shows up.
      STEP 5: Once your iDevice appears, drag the modded .IPA file you downloaded and drop it inside the Sideloadly application.
      STEP 6: You will now have to enter your iTunes/Apple ID email login, press "Start" & then you will be asked to enter your password. Go ahead and enter the required information.
      STEP 7: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 8: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles/VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 9: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. Jailbroken iDevices can also use Sideloadly/Filza/IPA Installer to normally install the IPA with AppSync. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue down below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Like
      • 4 replies
    • Window Garden - Lofi Idle Game v1.4.17 +1 Cheat
      Modded/Hacked App: Window Garden - Lofi Idle Game By Camille Santiago
      Bundle ID: com.cloverfi.windowgarden
      iTunes Store Link: https://apps.apple.com/us/app/window-garden-lofi-idle-game/id6473402739?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Unlimited Gold → Spend/Gain


      Non-Jailbroken & No Jailbreak required hack(s): 


      iOS Hack Download Link:

      Hidden Content

      Download Hack








      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
      • 3 replies
    • Legend Of Ghost Slayer 2 v1.52 +2 Jailed Cheats
      Modded/Hacked App: Legend Of Ghost Slayer 2 By Nostellar Co.,Ltd.
      Bundle ID: com.nostellar.ghostslayer2
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-ghost-slayer-2/id6503597439?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Damage Multiplier
      - Loot Multiplier


      Jailbreak required hack(s): 


      iOS Hack Download IPA Link:

      Hidden Content

      Download via the iOSGods App








      PC Installation Instructions:
      STEP 1: If necessary, uninstall the app if you have it installed on your iDevice. Some hacked IPAs will install as a duplicate app. Make sure to back it up so you don't lose your progress.
      STEP 2: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see this tutorial topic.
      STEP 3: Download Sideloadly and install it on your PC.
      STEP 4: Open/Run Sideloadly on your computer, connect your iOS Device, and wait until your device name shows up.
      STEP 5: Once your iDevice appears, drag the modded .IPA file you downloaded and drop it inside the Sideloadly application.
      STEP 6: You will now have to enter your iTunes/Apple ID email login, press "Start" & then you will be asked to enter your password. Go ahead and enter the required information.
      STEP 7: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 8: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles/VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 9: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. Jailbroken iDevices can also use Sideloadly/Filza/IPA Installer to normally install the IPA with AppSync. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue down below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Informative
        • Agree
        • Winner
        • Like
      • 12 replies
    • Legend Of Ghost Slayer 2 v1.52 +2 Cheats
      Modded/Hacked App: Legend Of Ghost Slayer 2 By Nostellar Co.,Ltd.
      Bundle ID: com.nostellar.ghostslayer2
      iTunes Store Link: https://apps.apple.com/us/app/legend-of-ghost-slayer-2/id6503597439?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Damage Multiplier
      - Loot Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): 


      iOS Hack Download Link:

      Hidden Content

      Download Hack








      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Agree
        • Thanks
        • Winner
        • Like
      • 26 replies
    • Solo Leveling:Arise Cheats v1.1.96 +2
      Modded/Hacked App: Solo Leveling:Arise By Netmarble Corporation
      Bundle ID: com.netmarble.sololv
      iTunes Store Link: https://apps.apple.com/th/app/solo-leveling-arise/id1662742277?uo=4


      Hack Features:
      - Semi God Mode (Immune to Physical Damage)
      - Multiply Attack / One Hit Kill

       

      This cheat has been tested with iPhone X 16.7.5 palera1n rootless, no jailbreak bypass required. Download the deb, open with iGameGod and use install & inject with iGameGod option. Done

      Dopamine 1.0 and 2.0 might work as well, no guarantee. If you have issue try using Shadow Bypass JB, if not work then this cheat is not for you


      iOS Hack Download Link: https://iosgods.com/topic/181160-solo-levelingarise-cheats-v1024-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 528 replies
    • Demon Squad: Idle RPG Cheats v1.61 +2
      Modded/Hacked App: Demon Squad: Idle RPG By SuperPlanet corp.
      Bundle ID: com.superplanet.demonsquad
      iTunes Store Link: https://apps.apple.com/us/app/demon-squad-idle-rpg/id6504470907?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense


      iOS Hack Download Link: https://iosgods.com/topic/185576-demon-squad-idle-rpg-cheats-v139-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 67 replies
    • Delusion: Tactical Idle RPG Cheats v2.1.0 +3
      Modded/Hacked App: Delusion: Tactical Idle RPG By SuperPlanet corp.
      Bundle ID: com.superplanet.delusion
      iTunes Store Link: https://apps.apple.com/us/app/delusion-tactical-idle-rpg/id6496342351?uo=4


      Hack Features:
      - Multiply Attack
      - God Mode
      - Freeze Currencies

      NOTE: Do not abuse or buy ViP just for this cheats


      iOS Hack Download Link: https://iosgods.com/topic/183614-delusion-tactical-idle-rpg-cheats-v1027-3/
        • Thanks
        • Winner
        • Like
      • 54 replies
    • BitLife - Life Simulator Cheats v3.16.3 +2
      Modded/Hacked App: BitLife - Life Simulator by Candywriter, LLC
      Bundle ID: com.wtfapps.apollo16
      iTunes Store Link: https://apps.apple.com/us/app/bitlife-life-simulator/id1374403536?uo=4&at=1010lce4


      Hack Features:
      - Infinite Cash
      - Free Bitizen Purchase (Press Cancle) - Work for All Versions


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/84167-arm64-bitlife-life-simulator-v1412-jailed-cheats-2/


      Hack Download Link: https://iosgods.com/topic/84223-arm64-bitlife-life-simulator-cheats-all-versions-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,284 replies
    • Smurfs' Village Cheats v2.70.2 +1
      Modded/Hacked App: Smurfs' Village By Flashman Studios LLC
      Bundle ID: com.capcommobile.smurfs
      iTunes Store Link: https://itunes.apple.com/us/app/smurfs-village/id399648212?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Gold (Spend some)
      - Infinite SmurfBerries (Spend some)


      Hack Download Link: https://iosgods.com/topic/75948-arm64-smurfs-village-cheats-v1680-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 425 replies
    • Arcana Tactics v4.9.0 Jailed Cheats +3
      Modded/Hacked App: Arcana Tactics By Com2uS Holdings Corporation
      Bundle ID: com.gamevil.arcanatactics.ios.apple.global.normal
      iTunes Store Link: https://apps.apple.com/us/app/arcana-tactics/id1521412306?uo=4

      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Auto Win


      iOS Hack Download IPA Link: https://iosgods.com/topic/185737-arcana-tactics-v480-jailed-cheats-3/
        • Agree
        • Thanks
        • Like
      • 24 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines