What kind of LUA encoding is that? - security

everyone,
I am not so familiar with coding but I have been looking for hours now without answer. Maybe because I do not know what am I looking for.
I have found an LUA code with the below encoded code,
I was wondering which kind of encoding it is? Is there a specific name for it, is there a way to decrypt it? for the curious one, it looks like :
return(function(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_llIIlIIllllIl)local aaEE_IIllllIIlIIllIlIIII=string.char;local aaEE_lIlllIlIllIIIlIlIl=string.sub;local aaEE_IlIlIIIllIlIIIllllIIIIIIl=table.concat;local aaEE_IIIIIIlllIIIIllllIlIII=math.ldexp;local aaEE_IIIlIIllIIllIIlIIllIllII=getfenv or function()return _ENV end;local aaEE_lIllIIIIIllllIlIlIl=select;local aaEE_lIlIlllIllIIII=unpack or table.unpack;local aaEE_llllIlllllIlIlIl=tonumber;local function aaEE_lllIllIIIlIIlllIIll(aaEE_IIlIllIlII)local aaEE_llllIIllllIll,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIlIlllIllIIII="","",{}local aaEE_IlIllIlllIIlIllllIll=256;local aaEE_IIllIllIIIlIIlllIIlIII={}for aaEE_lIlIIIIIlI=0,aaEE_IlIllIlllIIlIllllIll-1 do aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]=aaEE_IIllllIIlIIllIlIIII(aaEE_lIlIIIIIlI)end;local aaEE_lIlIIIIIlI=1;local function aaEE_IlIlllllllIIlI()local aaEE_llllIIllllIll=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+1;local aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI+aaEE_llllIIllllIll-1),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+aaEE_llllIIllllIll;return aaEE_lIIlIlllIlllIIIllIIlIllI end;aaEE_llllIIllllIll=aaEE_IIllllIIlIIllIlIIII(aaEE_IlIlllllllIIlI())aaEE_lIlIlllIllIIII[1]=aaEE_llllIIllllIll;while aaEE_lIlIIIIIlI<#aaEE_IIlIllIlII do local aaEE_lIlIIIIIlI=aaEE_IlIlllllllIIlI()if aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]then aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]else aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_llllIIllllIll,1,1)end;aaEE_IIllIllIIIlIIlllIIlIII[aaEE_IlIllIlllIIlIllllIll]=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_lIIlIlllIlllIIIllIIlIllI,1,1)aaEE_lIlIlllIllIIII[#aaEE_lIlIlllIllIIII+1],aaEE_llllIIllllIll,aaEE_IlIllIlllIIlIllllIll=aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_IlIllIlllIIlIllllIll+1 end;return table.concat(aaEE_lIlIlllIllIIII)end;
https://pastebin.com/4HU5pFHZ
Thank you for your answers and explanation

Its called obfuscation (you can look up "lua obfuscator" or "script obfuscator" for more information) and just makes the code unreadable. I've already seen this obfuscation but i can't recall the name of it, its a paid one tho.

This is the best encryption see here.
1 = Let's encrypt lua code com or: LuaEncrypt.exe.
2 = Let's chamar or encrypted lua code.
3 = To call this encrypted code, we will use AmsLuac.dll created in C++
https://github.com/AmsPluginsBox/Encrypt-Lua-Code

Related

Formatting user input with .title() method

Currently, I started to learn programming with Python. Currently, I am tackling my first 'real' project.
The most problems that I seem to find, are based around formatting. I am curious if my code is written understandable. For example:
new_customer = input('Name? \n')
customer = new_customer.title()
I want to make sure all the inputs received are saved with the same format.
Is this the correct way to transform a user's input with the .title() method?
Thank you in advance, I hope that these kind of questions are accepted here!
You can use the same variable:
newcustomer = input('Name? \n').title()
Is this what you mean?

Executing functions stored in a string

Lets say that there is a function in my Delphi app:
MsgBox
and there is a string which has MsgBox in it.
I know what most of you are going to say is that its possible, but I think it is possible because I opened the compiled exe(compiled using delphi XE2) using a Resource Editor, and that resource editor was built for Delphi. In that, I could see most of the code I wrote, as I wrote it. So since the variables names, function names etc aren't changed during compile, there should a way to execute the functions from a string, but how? Any help will be appreciated.
EDIT:
What I want to do is to create a simple interpreter/scripting engine. And this is how its supposed to work:
There are two files, scr.txt and arg.txt
scr.txt contains:
msg_show
0
arg.txt contains:
"Message"
And now let me explain what that 0 is:
First, scr.txt's first line is function name
second line tells that at which line its arguments are in the arg.txt, i.e 0 tells that "Message" is the argument for msg_show.
I hope my question is now clear.
I want to make a simple scripting engine.
In order to execute arbitrary code stored as text, you need a compiler or an interpreter. Either you need to write one yourself, or embed one that already exists. Realistically, the latter option is your best option. There are a number available but in my view it's hard to look past dwscript.
I think I've already solved my problem! The answer is in this question's first answer.
EDIT:
But with that, as for a workaround of the problem mentioned in first comment, I have a very easy solution.
You don't need to pass all the arguments/parameters to it. Just take my example:
You have two files, as mentioned in the question. Now you need to execute the files. It is as simple as that:
read the first line of scr.txt
check if it's a function. If not, skip the line
If yes, read the next line which tells the index where it's arguments are in arg.txt
pass on the index(an integer) to the "Call" function.
Now to the function which has to be executed, it should know how many arguments it needs. i.e 2
Lets say that the function is "Sum(a,b : integer)".It needs 2 arguments
Now let the function read the two arguments from arg.txt.
And its done!
I hope it will help you all.
And I can get some rep :)

What old language is this?

A friend of mine sended bunch of code for me to build a software. However, I do not recognize language and my friend is no coder. One thing I'm sure about though. The code is something like 20-40 years old.
Code was originally used in electrical works.
Character limit per line seems to be 20 characters.
Can someone recognize this language? I'm also looking for manuals for this language if possible.
10:"K": PAUSE "IK":
CLEAR
15:P=1: INPUT "ETR=PRIN
T, 0=NO? ";P
20:DIM L(20),R(20),X(20
),B(1),G(1),Q(1),O$(
1)*24
22:IF P=1 INPUT "K. /DA
TE? ";O$(0)
24:IF P=0 GOTO 30
26:INPUT "N:0 AND NAME?
"; O$(1)
28:LPRINT O$(1): LPRINT
"KKS/";OS(0)
30:INPUT "(KVA)? ";S
35:IF P=1 LPRINT "KVA",
S
40:R=3.31 :Z=4
...
I searched for this language and PowerBasic seems to be close to it, but it contains many other features what this code lacks. Any guesses?
Edit 1
It seems that there were typos. No wonder "P=!" or "0$(0) didn't make any sense.
Edit 2
I accepted Gaby's answer because code seems to be very close to GW-Basic. Also found a manual for the language which works perfectly: http://www.antonis.de/qbebooks/gwbasman/
Thanks for the help!
Edit 3
Got some new information. Language might actually be something called "Nova Basic" from 1975. I'm unable to find manual for that language, but at least this gives me a new direction.
It's definitely a BASIC variant, one of those like in the early micro-computer days, before things like VB and structured coding came into play :-)
However, it has a few non-recognisable aspects such as:
the statement "K".
the assignment P=!, unless that ! should be a 1.
the use of variables starting with a numeric: 0$(0), unless you've mistakenly typed an O (owe) in as a 0 (zero).
None of those were very common in BASICs of the day though keep in mind the language wasn't standardised to the same level as something like C is nowadays. Everything else seems pretty standard: input, printing, assignment, array dimensioning, and so on.
Given the line length limit, the domain (KKS and KVA are both electrical terms) and the weird syntax variations, I'd say it was for one of the early programmable calculators, such as Casio, Texas Instruments or Sharp (though not necessarily those specific brands).
It reminds me of GW-BASIC
Example code at http://fr.wikipedia.org/wiki/GW-BASIC
Not a lot information in your code. Maybe QBASIC ? http://fr.wikipedia.org/wiki/QBasic

How can I access the bit representation of a file using Scheme?

If I had a file called raw_text.txt, is there a way I could iterate through each bit?
I see the following but am confused on how to use it:
http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/File-Manipulation.html
— procedure: file-attributes/mode-string attributes
The mode string of the file, a newly allocated string showing the file's mode bits. Under unix, this string is in unix format. Under Windows, this string shows the standard “DOS” attributes in their usual format.
EDIT: I am using mit-scheme
It's implementation-specific. On the Racket side of things, there are a few libraries:
http://planet.racket-lang.org/display.ss?package=bitsyntax.plt&owner=tonyg
http://planet.racket-lang.org/display.ss?package=bit-io.plt&owner=soegaard
You can probably use something like the binary-parse library as well: http://okmij.org/ftp/Scheme/binary-io.html, as long as your implementation of Scheme can support it.
Under MIT Scheme, you can use the bit-string functions.
I haven't actually tried to do anything with this, but I think you're looking for this section of the mit-scheme docs: Input/Output. Specifically the file ports and input procedures sections.
I didn't see anything specifically about reading the binary bits, but if it's character bytes you want, it looks like there are procedures for that. Maybe you want to do something like this?
(call-with-input-file "raw_text.txt" <procedure>)
or
(call-with-binary-file "raw_text.txt" <procedure>)
Where <procedure> will take the file port and use the input procedures to read things from that file.
Just out of curiosity, what are you trying to do?
EDIT: It appears that someone did a write up on this here.

How to convert string to key to be used in encryption?

Hi All
I want to convert the string (taken as input from user) into a secretkey.I am coding in J2ME.The algorithm used is blowfish.
The Java cryptography APIs are not available in Java ME.
You'll need to download the Bouncy Castle lightweight cryptography API, which supports Java ME. You can then extract the classes you need from there. I found a code example here that should help you get started.
About charsets: Java ME does indeed support UTF-8, so that's always a safe bet. And a good idea, yes, although you'll see a lot of code that doesn't specify a charset.
Edit: Please see Eric's answer. This is not available in J2ME.
To convert a string to a key, you can do:
String strkey = "My key goes here";
SecretKeySpec key = new SecretKeySpec(strkey.getBytes("UTF-8"), "Blowfish");

Resources