Jump to content

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


9 posts in this topic

Recommended Posts

Updated (edited)

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
Posted

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 :) 

Posted

i successfully mod my first lua game from this tutorial.  Thank you very much. My god.

  • Like 1
  • Thanks 1
Posted
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

    • Mech Arena - Shooting Game v3.270.10 +3 Jailed Cheats
      Modded/Hacked App: Mech Arena - Shooting Game By Plarium Global Ltd
      Bundle ID: com.plarium.mechlegion
      iTunes Store Link: https://apps.apple.com/us/app/mech-arena-shooting-game/id1377591228?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:
      - Never Stop Shooting - Use with RPGs for best result.
      - Enemy Always Visible
      - 65K Ammo - Shoot until you have 65K ammo then disable this.


      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
        • Haha
        • Thanks
        • Winner
        • Like
      • 75 replies
    • Mech Arena - Shooting Game v3.270.10 +3 Cheats
      Modded/Hacked App: Mech Arena: Robot Showdown By Plarium Global Ltd
      Bundle ID: com.plarium.mechlegion
      iTunes Store Link: https://apps.apple.com/us/app/mech-arena-robot-showdown/id1377591228?uo=4


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


      Hack Features:
      - Never Stop Shooting - Use with RPGs for best result.
      - Speed Up Game [While in battle: Settings > Music Toggle] - do it once, or the game glitches.
      - Enemy Always Visible


      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.
      STEP 2: Copy the file over to your iDevice using any of the file managers mentioned above or skip this step if you're downloading from your iDevice.
      STEP 3: Using Filza or iFile, browse to where you saved the downloaded .deb file and tap on it.
      STEP 4: Once you tap on the file, you will need to press on 'Install' or 'Installer' from the options on your screen.
      STEP 5: Let Filza / iFile finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 6: 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 7: 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, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - @Zahir


      Cheat Video/Screenshots:

       
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 516 replies
    • Hero Survival IO 2 V1.0.3 [ +8 Jailed ] Currency Max
      Modded/Hacked App: Hero Survival IO 2 By VIET NAM SKYNET JOINT STOCK COMPANY
      Bundle ID: com.game.hero.survival.survivor
      iTunes Store Link: https://apps.apple.com/us/app/hero-survival-io-2/id6480162404?uo=4
       

      Hack Features

      - No ADS [ Rewards Free ]

      - Gems Unlimited [ Achievements Rewards ]

      - Gold Unlimited [ In Battle Pick Box ]

      - ATK

      - HP

      - Def

      - Skill EXP [ Pick One Exp Quickly Get All Skill ]

      - iGG Speed [ Max 0-5 Faster Play Save Time ]
        • Thanks
        • Like
      • 6 replies
    • Hero Survival IO 2 V1.0.3 [ +8 Cheats ] Currency Max
      Modded/Hacked App: Hero Survival IO 2 By VIET NAM SKYNET JOINT STOCK COMPANY
      Bundle ID: com.game.hero.survival.survivor
      iTunes Store Link: https://apps.apple.com/us/app/hero-survival-io-2/id6480162404?uo=4


      Hack Features:
      - No ADS [ Rewards Free ]

      - Gems Unlimited [ Achievements Rewards ]

      - Gold Unlimited [ In Battle Pick Box ]

      - ATK

      - HP

      - Def

      - Skill EXP [ Pick One Exp Quickly Get All Skill ]

      - iGG Speed [ Max 0-5 Faster Play Save Time ]
        • Agree
        • Thanks
        • Winner
        • Like
      • 8 replies
    • Tetris® Block Party v0.26.0 [ +2 Cheats ] Coins Unlimited
      Modded/Hacked App: Tetris® Block Party By Playstudios, Inc.
      Bundle ID: com.playstudios.tetrisblockparty
      iTunes Store Link: https://apps.apple.com/ph/app/tetris-block-party/id6569243702?uo=4
       

      🤩 Hack Features

      - Coin Increaser [ Block Placed ]
      - Merge Any Block Anywhere

      Don't Abuse The Hack In Case Banned Not Tested
      • 7 replies
    • Tetris® Block Party v0.26.0 [ +2 Jailed ] Coins Unlimited
      Modded/Hacked App: Tetris® Block Party By Playstudios, Inc.
      Bundle ID: com.playstudios.tetrisblockparty
      iTunes Store Link: https://apps.apple.com/ph/app/tetris-block-party/id6569243702?uo=4
       

      🤩 Hack Features

      - Coin Increaser [ Block Placed ]
      - Merge Any Block Anywhere

      Don't Abuse The Hack In Case Banned Not Tested
        • Thanks
        • Like
      • 2 replies
    • Space Survivor Alien Attack v1.4.0 [ +14 Jailed ] Currency Max
      Modded/Hacked App: Space Survivor: Alien Attack By Nhu Ut Vo
      Bundle ID: com.baa.galaxysurvivor
      iTunes Store Link: https://apps.apple.com/us/app/space-survivor-alien-attack/id6444752483?uo=4

      Hack Features:

      - Gems 

      - Gold

      - Energy

      - Chest Keys

      - Talent Stone

      - ADS Ticket

      - Skill Token

      - Reinforcement Book

      - Upgrade Elements

      - Survivor Pass Active

      - Survivor Pass [ Rewards Unlocked ]

      - ATK Range

      - Hero Status [ HP DMG ] Just Equip & Unequip


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Thanks
        • Winner
        • Like
      • 5 replies
    • Space Survivor Alien Attack v1.4.0 [ +14 Cheats ] Currency Max
      Modded/Hacked App: Space Survivor: Alien Attack By Nhu Ut Vo
      Bundle ID: com.baa.galaxysurvivor
      iTunes Store Link: https://apps.apple.com/us/app/space-survivor-alien-attack/id6444752483?uo=4

      Hack Features:
      - Gems 

      - Gold

      - Energy

      - Chest Keys

      - Talent Stone

      - ADS Ticket

      - Skill Token

      - Reinforcement Book

      - Upgrade Elements

      - Survivor Pass Active

      - Survivor Pass [ Rewards Unlocked ]

      - ATK Range

      - Hero Status [ HP DMG ] Just Equip & Unequip


      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
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 10 replies
    • Modern Command Mayhem v0.99.94 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Modern Command Mayhem By Blast Bit Enterprises AB
      Bundle ID: net.blastbit.mcm
      iTunes Store Link: https://apps.apple.com/us/app/modern-command-mayhem/id6479870909?uo=4


      Hack Features:
      - Platinum

      - Gold

      - Energy

      - Keys +2

      - Tech

      - Bricks

      - Battle Coupons

      - Command Point

      - Blueprint

      - Materials

      - DMG


      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/
        • Agree
        • Thanks
        • Winner
        • Like
      • 31 replies
    • Modern Command Mayhem v0.99.94 [ +11 Jailed ] Currency Max
      Modded/Hacked App: Modern Command Mayhem By Blast Bit Enterprises AB
      Bundle ID: net.blastbit.mcm
      iTunes Store Link: https://apps.apple.com/us/app/modern-command-mayhem/id6479870909?uo=4

       

      Hack Features:

      - Platinum

      - Gold

      - Energy

      - Keys +2

      - Tech

      - Bricks

      - Battle Coupons

      - Command Point

      - Blueprint

      - Materials

      - DMG


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Winner
        • Like
      • 14 replies
    • ASTRA: Knights of Veda v2.4.2 +2 Cheats
      Modded/Hacked App: ASTRA: Knights of Veda By HYBE IM Co.,Ltd.
      Bundle ID: com.hybeim.astra
      iTunes Store Link: https://apps.apple.com/us/app/astra-knights-of-veda/id6449925651?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


      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
      • 237 replies
    • Yukon: Family Adventure v1.53.2 [ +4++ Cheats ] Everything Unlimited
      Modded/Hacked App: Yukon: Family Adventure By Enixan Europe Limited
      Bundle ID: com.enixan.yukon.family.adventure
      iTunes Store Link: https://apps.apple.com/us/app/yukon-family-adventure/id6455041311?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Items

      - EXP
        • Thanks
        • Winner
      • 4 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