Decrypt a code (as I understand it is in ASCII)

Asked

Viewed 1,178 times

1

Well, basically I’d like to know if there’s any way to turn a script written in ASCII into Characters and if there is, how would I turn it?

Code (1)

 local code = '\27\76\117\97\81\0\1\4\4\4\8\0\55\0\0\0\64\67\58\92\85\115\101\114\115\92\106\111\97\111\99\92\68\79\67\85\77\69\126\49\92\88\101\110\111\66\111\116\92\83\99\114\105\112\116\115\92\92\69\78\67\82\89\80\126\49\46\76\85\65\0\2\0\0\0\22\0\0\0\0\0\0\5\17\0\0\0\2\0\128\0\7\0\0\0\1\128\0\0\7\64\0\0\5\192\0\0\6\0\65\0\28\128\128\0\69\64\1\0\70\128\193\0\92\128\128\0\133\192\1\0\134\0\66\1\193\64\2\0\36\1\0\0\0\0\0\0\156\64\128\1\30\0\128\0\10\0\0\0\4\9\0\0\0\109\105\110\105\109\105\122\101\0\4\4\0\0\0\98\112\115\0\3\0\0\0\0\0\0\240\63\4\3\0\0\0\111\115\0\4\6\0\0\0\99\108\111\99\107\0\4\10\0\0\0\67\111\110\116\97\105\110\101\114\0\4\9\0\0\0\71\101\116\70\105\114\115\116\0\4\7\0\0\0\77\111\100\117\108\101\0\4\4\0\0\0\78\101\119\0\4\10\0\0\0\114\101\99\111\110\110\101\99\116\0\1\0\0\0\0\0\0\0\7\0\0\0\20\0\0\0\1\0\0\3\44\0\0\0\5\0\0\0\6\64\64\0\69\0\0\0\70\128\192\0\92\128\128\0\132\0\0\0\28\128\128\1\25\0\128\129\22\64\7\128\5\0\1\0\6\64\65\0\28\128\128\0\69\128\1\0\70\192\193\0\92\128\128\0\84\0\128\0\133\0\2\0\24\128\128\0\22\192\4\128\69\64\2\0\70\128\194\0\92\64\128\0\69\0\1\0\70\192\194\0\92\64\128\0\69\0\3\0\129\64\3\0\92\64\0\1\69\0\1\0\70\128\195\0\133\192\3\0\92\64\0\1\69\0\3\0\140\0\68\0\92\64\0\1\69\64\2\0\70\64\196\0\92\64\128\0\22\0\249\127\5\0\0\0\6\128\64\0\28\128\128\0\8\0\0\0\30\0\128\0\18\0\0\0\4\3\0\0\0\111\115\0\4\9\0\0\0\100\105\102\102\116\105\109\101\0\4\6\0\0\0\99\108\111\99\107\0\3\0\0\0\0\0\0\240\63\4\5\0\0\0\83\101\108\102\0\4\5\0\0\0\80\105\110\103\0\4\10\0\0\0\67\111\110\116\97\105\110\101\114\0\4\7\0\0\0\71\101\116\65\108\108\0\4\4\0\0\0\98\112\115\0\4\8\0\0\0\67\97\118\101\98\111\116\0\4\5\0\0\0\83\116\111\112\0\4\16\0\0\0\67\108\111\115\101\67\111\110\116\97\105\110\101\114\115\0\4\5\0\0\0\119\97\105\116\0\3\0\0\0\0\0\64\159\64\4\17\0\0\0\79\112\101\110\77\97\105\110\66\97\99\107\112\97\99\107\0\4\9\0\0\0\109\105\110\105\109\105\122\101\0\3\0\0\0\0\0\64\143\64\4\6\0\0\0\83\116\97\114\116\0\0\0\0\0\44\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\8\0\0\0\9\0\0\0\9\0\0\0\9\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\10\0\0\0\11\0\0\0\11\0\0\0\11\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\13\0\0\0\13\0\0\0\13\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\15\0\0\0\15\0\0\0\15\0\0\0\16\0\0\0\16\0\0\0\16\0\0\0\16\0\0\0\19\0\0\0\19\0\0\0\19\0\0\0\19\0\0\0\20\0\0\0\1\0\0\0\5\0\0\0\112\105\110\103\0\12\0\0\0\39\0\0\0\1\0\0\0\9\0\0\0\108\97\115\116\84\105\109\101\0\17\0\0\0\3\0\0\0\3\0\0\0\4\0\0\0\4\0\0\0\5\0\0\0\5\0\0\0\5\0\0\0\6\0\0\0\6\0\0\0\6\0\0\0\7\0\0\0\7\0\0\0\7\0\0\0\20\0\0\0\20\0\0\0\7\0\0\0\22\0\0\0\2\0\0\0\9\0\0\0\108\97\115\116\84\105\109\101\0\7\0\0\0\16\0\0\0\5\0\0\0\109\97\105\110\0\10\0\0\0\16\0\0\0\0\0\0\0'
      loadstring(code) ()

This code in numbers above is equivalent to the code below :

Code (2)

  minimize = true -- minimizar a mainbp?
  bps = 1 -- quantidade de bps, deixar em 8
  local lastTime = os.clock()
  local main = Container.GetFirst()
  Module.New("reconnect", function()   
  if (os.difftime(os.clock(), lastTime) >= 1) then      
  local ping = Self.Ping()        
  while (#Container.GetAll() < bps) do      
  Cavebot.Stop()        
  Self.CloseContainers()        
  wait(2000)       
  Self.OpenMainBackpack(minimize)            
  wait(ping + 1000)     
  Cavebot.Start()           
  end    
  end    
  lastTime = os.clock()
  end)

I ran this script to turn the code into characters (2) for ASCII code (1)

Code (3)

  local script = string.dump(
  function()
  minimize = true -- minimizar a mainbp?
  bps = 1 -- quantidade de bps, deixar em 8
  local lastTime = os.clock()
  local main = Container.GetFirst()
  Module.New("reconnect", function()
  if (os.difftime(os.clock(), lastTime) >= 1) then
  local ping = Self.Ping()
  while (#Container.GetAll() < bps) do  
  Cavebot.Stop()
  Self.CloseContainers()    
  wait(2000)
  Self.OpenMainBackpack(minimize)    
  wait(ping + 1000)     
  Cavebot.Start()     
  end
  end
  lastTime = os.clock()
  end)

  end
  )

  buff=""
  for v=1,string.len(script) do --Convert our string into a hex string.
  buff=buff..'\\'..string.byte(script,v)
  end

  file=io.open('encrypted.txt','w') --Output our bytecode into ascii format to encrypted.txt
  file:write(buff)
  file:flush()
  file:close()

2 answers

2

As you seem to know, the string in Code 1 is a pre-compiled version of Code 2. It contains instructions for the Lua virtual machine. You can see a listing by changing Code 1 to io.write(code), saving the output in a file luac.out, and then running luac -l -p.

It is not simple to decompile a pre-compiled script. You can try using Luadec for Lua 5.1.

  • I did not succeed in decompilation, you can give me some light on what to do?

  • @Pedroduarte, as I said, is not simple at all.

-1

To "decompile" this string, I used the following code:

local file = io.open("exemplo.txt", "w") --Define arquivo que será preenchido com o conteúdo pre-compilado.
file:write (
    code = 'CódigoPreCompilado' --Código pré-compilado, exemplo: '1/2/3/4/5/...'
    loadstring(code) () --Você poderá jogar o código pré-compilado no lugar da variável **CODE**, utilizei desta forma para que pudesse organizar melhor, escolha pessoal.
)
file:close()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.