XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Camouflaging Lua Code

  1. #1

    Join Date
    Dec 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Camouflaging Lua Code

    It may be that someone wants to know how to do, here it is:

    lua code:

    local script = string.dump(
    function()
    --Content
    print("Camouflaging Done.")

    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()


    Output of example:

    Code:
    \27\76\117\97\81\0\1\4\4\4\8\0\54\0\0\0\64\67\58\92\85\115\101\114\115\92\66\114\117\110\111\92\68\111\99\117\109\101\110\116\115\92\88\101\110\111\66\111\116\92\83\99\114\105\112\116\115\92\101\110\99\114\121\112\116\46\108\117\97\0\2\0\0\0\5\0\0\0\0\0\0\2\4\0\0\0\5\0\0\0\65\64\0\0\28\64\0\1\30\0\128\0\2\0\0\0\4\6\0\0\0\112\114\105\110\116\0\4\19\0\0\0\67\97\109\111\117\102\108\97\103\105\110\103\32\68\111\110\101\46\0\0\0\0\0\4\0\0\0\4\0\0\0\4\0\0\0\4\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0
    How to load this ?

    Example:

    lua code:

    local code = '\27\76\117\97\81\0\1\4\4\4\8\0\54\0\0\0\64\67\58\92\85\115\101\114\115\92\66\114\117\110\111\92\68\111\99\117\109\101\110\116\115\92\88\101\110\111\66\111\116\92\83\99\114\105\112\116\115\92\101\110\99\114\121\112\116\46\108\117\97\0\2\0\0\0\5\0\0\0\0\0\0\2\4\0\0\0\5\0\0\0\65\64\0\0\28\64\0\1\30\0\128\0\2\0\0\0\4\6\0\0\0\112\114\105\110\116\0\4\19\0\0\0\67\97\109\111\117\102\108\97\103\105\110\103\32\68\111\110\101\46\0\0\0\0\0\4\0\0\0\4\0\0\0\4\0\0\0\4\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0'

    loadstring(code) ()


    If anyone has any other way to do this and want to share with people, feel free

    Att,
    Diabolic

  2. #2
    XenoBot Developer DarkstaR's Avatar
    Join Date
    Dec 2010
    Posts
    6,104
    Mentioned
    1325 Post(s)
    Tagged
    16 Thread(s)
    It's actually called "obfuscation". Also, anyone can replace the loadstring function with a function that will print out the raw code. It's a nice first step but you can take it much further by using obfuscation around the loader code as well, in ways other than bytecode generation.

  3. #3

    Join Date
    Dec 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DarkstaR View Post
    It's actually called "obfuscation". Also, anyone can replace the loadstring function with a function that will print out the raw code. It's a nice first step but you can take it much further by using obfuscation around the loader code as well, in ways other than bytecode generation.
    You have any example to help ?
    I only managed to get up this.

  4. #4
    Senior Member Tripkip's Avatar
    Join Date
    Aug 2012
    Location
    Netherlands
    Posts
    1,310
    Mentioned
    105 Post(s)
    Tagged
    0 Thread(s)
    Him putting in here how to do encode would be pretty much equal to explaining people how te decode it.

  5. #5
    XenoBot Developer DarkstaR's Avatar
    Join Date
    Dec 2010
    Posts
    6,104
    Mentioned
    1325 Post(s)
    Tagged
    16 Thread(s)
    Quote Originally Posted by Diabolic View Post
    You have any example to help ?
    I only managed to get up this.
    Creativity and understanding of the language constructs.

  6. #6

    Join Date
    Dec 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tripkip View Post
    Him putting in here how to do encode would be pretty much equal to explaining people how te decode it.
    to encode is not the same thing of decode

    Quote Originally Posted by DarkstaR View Post
    Creativity and understanding of the language constructs.
    Ok, thank you bro

  7. #7
    dedi's Avatar
    Join Date
    Dec 2011
    Location
    Poznań, Poland
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's interesting. Thx mate
    • Sold 245 EK for Loloz (vent)
    • Sold 250 EK for Kajtek (vent)
    • Sold 250 EK for Poncek (vent)
    • Sold 245 ED (vent)
    • Sold 310 RP (vent)
    • Sold 265 EK for Loloz (vent)
    • Sold 232 EK to ppooll
    • Sold 165 ED to tonystrea
    • Sold 350 ED to Serek (allegro)
    • Sold 392 EK to Czoger

  8. #8
    XenoBot Scripts Developer Syntax's Avatar
    Join Date
    Feb 2011
    Posts
    1,658
    Mentioned
    431 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Diabolic View Post
    to encode is not the same thing of decode



    Ok, thank you bro
    1) You're not encoding. You're not even encrypting. You are obfuscating.
    2) If you know the way you are obfuscating, you know how to de-obfuscate.

    It's security through obscurity.

  9. #9

    Join Date
    Apr 2012
    Location
    RS, Brazil
    Posts
    179
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Syntax View Post
    1) You're not encoding. You're not even encrypting. You are obfuscating.
    2) If you know the way you are obfuscating, you know how to de-obfuscate.

    It's security through obscurity.
    I'm not an expert on it, so can I use the SciTE compiler like a method to encrypt my code ?

    For example my lib looks like this when I use compile function:



    But still can be loaded.

  10. #10

    Join Date
    Nov 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And how to decrypt this code now?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •