Jump to content

Basic Custom Compiler


bukandewa
 Share

Recommended Posts

Basic Custom Compiler


Hello guys.

I will share a basic custom compiler scripts with open source code. I let this scripts open source for education purpose. You can modify as you want, also you can add and improving many things in this compiler. 

About this compiler :

• This compiler just a basic code, I am not add and will never add any functions like block unluac etc.

• This compiler will convert your important code in the main scripts become unreadable. 

• Like I said above, this compiler just a basic, it will not guarantee to protect your scripts from leaker.

Very wellcome for any suggestions.


 

Link to comment
Share on other sites

  • 4 weeks later...
4 hours ago, DESYROLLERSE said:

@bukandewa

This script throws an error when compiling.

 

Script error: org.luaj.vm2.LuaError: @/storage/DOWNLOAD/#basic_compiler.lua:208
`local data = string.dump(loadfile(g.sel[1].. 'X'), true,true)`
bad argument #1 (nil): function expected, got nil
level = 1, pc = 504

   

It is depends on your code. You can learn and improving the code, for example :

function tochar(str, sep)
if type(str) == 'string' then
for i = 1,#str do
sep = ','
char = table.concat({string.byte(str, 1,-1)},sep)
end
return "load(string.char("..char.."))()"
end end

repeat
local data = filex:read("*l")
if data ~= nil then

if data:match('gg(.-)%p$') and
data:match('os(.-)%p$') or
data:match('searchNumber') or
data:match('editAll') or
data:match('getResults') or
data:match('toast') or
data:match('setRanges') or
data:match('searchAddress') or
data:match('remove') or
data:match('rename')
then

local data = tochar(data)
file = io.open(g.sel[1]..'X', 'a+')
file:write(data)
file:write("\n")
file:close()
else
file = io.open(g.sel[1]..'X', 'a+')
file:write(data)
file:write("\n")
file:close()
end
end

I just convert some important string using string.match. It will keep results smaller, also it will minimalizing error while compiling. 

You can improving function tochar, string.match to fix error while compiling. Of course, it is need enough knowledge.

But, you can learn by read in many refferences about lua programming, do trial and error.

Tips to know which line of code cause error while compiling, you can try edit os.remove(g.sel[1]..'X') to --os.remove(g.sel[1]..'X'). You can analyzing which part also read error log in precompiled file.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
On 3/29/2019 at 10:58 PM, maulz said:

How to fix it sir?

Screenshot_20190330-015742.png

It is because after you wil ecnrypt , some string chars are error and script will get unexecutable status so binary encryption i mean this string dump cannot be done on script which is executable for GG and it wil give u error like u show in photo .

So . . .

Remove some string char encode when it will read data .

Remove example toast or another which gives ur script error and after it u will not get this string dump error .

Of course its need some knowledge for do it .

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.