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

    • Tower Defense - King Of Legend [All versions] | +4 Cheats
      Modded/Hacked App: Tower Defense - King Of Legend By Pham Quang
      Bundle ID: com.towerdefense.kingoflegend
      iTunes Store Link: https://apps.apple.com/us/app/tower-defense-king-of-legend/id1559832738?uo=4


      🤩 Hack Features

      - Firerate Max
      - Range Max
      - OHK
      - High kill reward

       
      • 1 reply
    • Tower Defense - King Of Legend [v2.2.3] | +4 Cheats
      Modded/Hacked App: Tower Defense - King Of Legend By Pham Quang
      Bundle ID: com.towerdefense.kingoflegend
      iTunes Store Link: https://apps.apple.com/us/app/tower-defense-king-of-legend/id1559832738?uo=4

      🤩 Hack Features

      - Firerate Max
      - Range Max
      - OHK
      - High kill reward

      • 0 replies
    • Summoners War Cheats v8.6.7 +7
      Hacked App: Summoners War By Com2uS Corp.
      iTunes Link: https://itunes.apple.com/us/app/summoners-war/id852912420?mt=8&uo=4&at=1010lce4
      Bundle ID: com.com2us.smon.normal.freefull.apple.kr.ios.universal

      Hack Features:
      - Damage Multiplier 
      - Godmode
      - Monster Count Unlink
      - Max Accuracy
      - No Skill Cooldown
      - First Turn
      - Build buildings without having required level
      - Antiban
      • 6,841 replies
    • Evertale v2.0.98 - [ Enemies Don't Attack & More ]
      Modded/Hacked App: Evertale By ZigZaGame Inc.
      Bundle ID: com.zigzagame.evertale
      iTunes Store Link: https://itunes.apple.com/us/app/evertale/id1263365153
       

      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Enemies Don't Attack
      - Spirit Increase
      - High Silver Reward After Battle
      - Guarantee Capture
      - 999 Team Cost 
      • 533 replies
    • Evertale v2.0.98 - [ Enemies Don't Attack & More ]
      Modded/Hacked App: Evertale By ZigZaGame Inc.
      Bundle ID: com.zigzagame.evertale
      iTunes Store Link: https://itunes.apple.com/us/app/evertale/id1263365153

      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features:
      - One Hit Kill - Linked With Enemies
      - Enemies Don't Attack
      - Spirit Increase
      - High Silver Reward After Battle
      - Guarantee Capture
      - 999 Team Cost 
      • 1,098 replies
    • MADFUT 25 v1.1.3 +7 Jailed Cheats [ Unlimited Coins, Packs, Dupes ]
      Modded/Hacked App: MADFUT 25 By MEDFUT, OOO
      Bundle ID: com.madfut.madfut25
      iTunes Store Link: https://apps.apple.com/us/app/madfut-25/id6593674091?uo=4


      Hack Features:
      - Unlimited Coins -> Earn or spend some. [ VIP ]
      - Unlimited LTM Points -> Earn or spend some. [ VIP ]
      - Unlimited Packs -> Buy/use one.
      - Unlimited Tokens -> Use one.
      - Unlimited Draft Puzzle Market Items -> Buy an item.
      - Unlimited Free Pack Reward Points [ VIP ]
      - Unlimited Dupes -> Quick sell any card then re-launch the game. [ VIP ]


      Jailbreak required hack(s): [Mod Menu Hack] MADFUT25 v1.0 +7 Cheats [ Unlimited Coins, Packs, Dupes ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 117 replies
    • MADFUT 25 v1.1.3 +7 Cheats [ Unlimited Coins, Packs, Dupes ]
      Modded/Hacked App: MADFUT 25 By MEDFUT, OOO
      Bundle ID: com.madfut.madfut25
      iTunes Store Link: https://apps.apple.com/us/app/madfut-25/id6593674091?uo=4


      Hack Features:
      - Unlimited Coins -> Earn or spend some. [ VIP ]
      - Unlimited LTM Points -> Earn or spend some. [ VIP ]
      - Unlimited Packs -> Buy/use one.
      - Unlimited Tokens -> Use one.
      - Unlimited Draft Puzzle Market Items -> Buy an item.
      - Unlimited Free Pack Reward Points [ VIP ]
      - Unlimited Dupes -> Quick sell any card then re-launch the game. [ VIP ]


      Non-Jailbroken & No Jailbreak required hack(s): [IPA Mod Menu] MADFUT25 v1.0 +7 Jailed Cheats [ Unlimited Coins, Packs, Dupes ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 76 replies
    • Pondlife — Relaxing Fish Game v1.0.8 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Pondlife — Relaxing Fish Game By Runaway Play Ltd
      Bundle ID: com.runawayplay.fishgame
      iTunes Store Link: https://apps.apple.com/us/app/pondlife-relaxing-fish-game/id6670146440?uo=4

       
       

      🤩 Hack Features

      - Unlimited Bubble Coins -> Earn or spend some.
      - Unlimited Aquacash -> Earn or spend some.
      - Max Level -> Earn some XP then restart the game.
      • 0 replies
    • Pondlife — Relaxing Fish Game v1.0.8 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Pondlife — Relaxing Fish Game By Runaway Play Ltd
      Bundle ID: com.runawayplay.fishgame
      iTunes Store Link: https://apps.apple.com/us/app/pondlife-relaxing-fish-game/id6670146440?uo=4

       


      🤩 Hack Features

      - Unlimited Bubble Coins -> Earn or spend some.
      - Unlimited Aquacash -> Earn or spend some.
      - Max Level -> Earn some XP then restart the game.
      • 0 replies
    • HungryAliens v1176 +2 Jailed Cheats
      Modded/Hacked App: HungryAliens By DETAIL GAMES Inc.
      Bundle ID: com.DetailGames.HungryAliens
      iTunes Store Link: https://apps.apple.com/us/app/hungryaliens/id6449141384?uo=4

       

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Damage Multiplier
      - Never Die

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: 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 8: 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. 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 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
      • 0 replies
    • HungryAliens v1176 +2 Cheats
      Modded/Hacked App: HungryAliens By DETAIL GAMES Inc.
      Bundle ID: com.DetailGames.HungryAliens
      iTunes Store Link: https://apps.apple.com/us/app/hungryaliens/id6449141384?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Damage Multiplier
      - Never Die

       

      ⬇️ iOS Hack Download Link


      Hidden Content

      Download Hack







       

      📖 iOS Installation Instructions

      STEP 1: Download the .deb 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 needed, tap on the downloaded file again, then select ‘Normal Install’ from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. If it doesn’t install successfully, see the note below.
      STEP 5: Open the game, log in to your iOSGods account when asked, then toggle on the features you want and enjoy!

       

      NOTE: If you have any questions or problems, read our Jailbreak iOS Hack Troubleshooting & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue 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

       

      More iOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.

      Modded Android APKs
      Need modded apps or games for Android? Check out the latest custom APK mods, cheats & more in our Android Section.
      • 0 replies
    • Idle RPG - Cannibal Planet 3 v5.3.1 +3 Jailed Cheats
      Modded/Hacked App: Idle RPG - Cannibal Planet 3 By Town Soft LLC.
      Bundle ID: com.TownSoft.cannibalplanet3
      iTunes Store Link: https://apps.apple.com/us/app/idle-rpg-cannibal-planet-3/id6737494391?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Unlimited Craft Stone → Spend/Gain
      - Unlimited Gold → Spend/Gain
      - Unlimited Prayer → Spend/Gain

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: 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 8: 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. 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 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
      • 1 reply
×
  • 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