Problem with precompiled bitecode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with precompiled bitecode

Michal Lisičan
Hi,

I have a two bitecodes what was made with two different lua copilers can you explain me difference beetwen those two bitecodes? I see swaped few bytes in second line. Can you explain me why? What are that bytes? I use luac version 5.3.4.

file name: main.lua
mime type: 

0000-0010:  1b 4c 75 61-53 00 19 93-0d 0a 1a 0a-04 04 04 04  .LuaS... ........
0000-0020:  08 78 56 00-00 00 00 00-00 00 28 77-40 01 00 00  .xV..... ..(w@...
0000-0030:  00 00 00 00-00 00 00 00-01 02 02 00-00 00 08 40  ........ .......@
0000-0040:  40 80 26 00-80 00 02 00-00 00 04 09-50 4c 4f 5f  @.&..... ....PLO_
0000-0050:  54 4f 4f 4c-13 01 00 00-00 01 00 00-00 01 00 00  TOOL.... ........
0000-005f:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00     ........ .......

file name: main.lua_out
mime type: 

0000-0010:  1b 4c 75 61-53 00 19 93-0d 0a 1a 0a-04 04 04 04  .LuaS... ........
0000-0020:  08 78 56 00-00 00 28 77-40 00 00 00-00 01 00 00  .xV...(w @.......
0000-0030:  00 00 00 00-00 00 00 00-01 02 02 00-00 00 08 40  ........ .......@
0000-0040:  40 80 26 00-80 00 02 00-00 00 04 09-50 4c 4f 5f  @.&..... ....PLO_
0000-0050:  54 4f 4f 4c-13 01 00 00-00 01 00 00-00 01 00 00  TOOL.... ........
0000-005f:  00 00 00 00-00 00 00 00-00 00 00 00-00 00 00     ........ .......

content of not compiled file is:
PLO_TOOL=1

Thank you,
Michal
Reply | Threaded
Open this post in threaded view
|

Re: Problem with precompiled bitecode

Luiz Henrique de Figueiredo
> I have a two bitecodes what was made with two different lua copilers can you
> explain me difference beetwen those two bitecodes? I see swaped few bytes in
> second line. Can you explain me why? What are that bytes? I use luac version
> 5.3.4.

The order of the byte are different because the platforms where you
ran luac are different.

For the format of the header, see
https://www.lua.org/source/5.3/ldump.c.html#DumpHeader

0000-0020:  08 78 56 00-00 00 00 00-00 00 28 77-40 01 00 00  .xV..... ..(w@...
0000-0020:  08 78 56 00-00 00 28 77-40 00 00 00-00 01 00 00  .xV...(w @.......

The 8 bytes " 00 00 00 00 00 28 77 40" are a double (370.5 in Lua
5.3), stored in Intel order.

The 8 bytes "00 28 77 40 00 00 00 00" are the same number stored in a
different order, I'm guessing an ARM here.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with precompiled bitecode

Michal Lisičan
Is possible to set which order will use comiler? Is possible to to make bytecode on windows and run it on linux based system?

Thank you.

št 24. 5. 2018 o 15:06 Luiz Henrique de Figueiredo <[hidden email]> napísal(a):
> I have a two bitecodes what was made with two different lua copilers can you
> explain me difference beetwen those two bitecodes? I see swaped few bytes in
> second line. Can you explain me why? What are that bytes? I use luac version
> 5.3.4.

The order of the byte are different because the platforms where you
ran luac are different.

For the format of the header, see
https://www.lua.org/source/5.3/ldump.c.html#DumpHeader

0000-0020:  08 78 56 00-00 00 00 00-00 00 28 77-40 01 00 00  .xV..... ..(w@...
0000-0020:  08 78 56 00-00 00 28 77-40 00 00 00-00 01 00 00  .xV...(w @.......

The 8 bytes " 00 00 00 00 00 28 77 40" are a double (370.5 in Lua
5.3), stored in Intel order.

The 8 bytes "00 28 77 40 00 00 00 00" are the same number stored in a
different order, I'm guessing an ARM here.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with precompiled bitecode

Charles Heywood
It is not only the operating system that can change how bytecode works, but also the processor. Bytecode is not portable and should not be expected to be portable. If you're looking for source code obfuscation, you will not find it with shipping bytecode.

On Thu, May 24, 2018 at 8:21 AM Michal Lisičan <[hidden email]> wrote:
Is possible to set which order will use comiler? Is possible to to make bytecode on windows and run it on linux based system?

Thank you.

št 24. 5. 2018 o 15:06 Luiz Henrique de Figueiredo <[hidden email]> napísal(a):
> I have a two bitecodes what was made with two different lua copilers can you
> explain me difference beetwen those two bitecodes? I see swaped few bytes in
> second line. Can you explain me why? What are that bytes? I use luac version
> 5.3.4.

The order of the byte are different because the platforms where you
ran luac are different.

For the format of the header, see
https://www.lua.org/source/5.3/ldump.c.html#DumpHeader

0000-0020:  08 78 56 00-00 00 00 00-00 00 28 77-40 01 00 00  .xV..... ..(w@...
0000-0020:  08 78 56 00-00 00 28 77-40 00 00 00-00 01 00 00  .xV...(w @.......

The 8 bytes " 00 00 00 00 00 28 77 40" are a double (370.5 in Lua
5.3), stored in Intel order.

The 8 bytes "00 28 77 40 00 00 00 00" are the same number stored in a
different order, I'm guessing an ARM here.

--
--
Ryan | Charles <[hidden email]>
Software Developer / System Administrator