Author Topic: An obfuscator for GLb on windows  (Read 3091 times)

Offline sf-in-sf

  • Mr. Drawsprite
  • **
  • Posts: 93
  • Artist F.P. Brixey
    • View Profile
    • My computed art project
An obfuscator for GLb on windows
« on: 2014-May-29 »
==== EDIT =====
   Finally my obfuscator works -a long, difficult job. It keeps the GLb commands and translates the rest into confusing generic "values", in selectable styles. The media files are automatically copied and renamed with fancy-names which are re-used in the source files accordingly. It worked with my 2505-commands game project, spanned on 10 *.gbas files, and about 50 media files. {Get it on the android market: flip7. By the way the first version costs 1$ and any advice is welcome about monetizing the app in a better way}.
  Back to the obfuscator: the generated code is meaningless : functions, variables, media files, are meaningless, random, looking all similar and confusing. But the program still works like before.
  • Supported features : multi-files, all GLb commands, media copy + renaming, intact 0x..... numbers, mark some words as keep-unchanged, automatic comment removal, choose/make your own style for generated words. Preprocessor code still works.
  • Not supported so far : INLINE'd code.

   Drop me a message if you are interested. You can get the customizable source code for a small price. Licence  :rtfm:  use and modify freely, you only. Don't distribute or sell anything in any way without my agreement. Please contact me for any unspecified case.
« Last Edit: 2014-May-29 by sf-in-sf »
On the day the atom is a cube I will start believing in the square pixel.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4310
    • View Profile
    • Portfolio
Re: An obfuscator for GLb on windows
« Reply #1 on: 2014-May-29 »
This sounds like a nice tool! :good:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3918
    • View Profile
    • Space Fractal
Re: An obfuscator for GLb on windows
« Reply #2 on: 2014-May-29 »
its a nice idea.

just make sure to not rename all functions and sub. There is few, that should not been named.

That is those which got called by the name, and some subs required for pause/resume/quit and the loop. Those functions called by name, could eventuely been remarked by something like this: //noobfucator.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline sf-in-sf

  • Mr. Drawsprite
  • **
  • Posts: 93
  • Artist F.P. Brixey
    • View Profile
    • My computed art project
Re: An obfuscator for GLb on windows
« Reply #3 on: 2014-May-29 »
Spacefractal, it's already feasible and easy -but not recommended normally. By looking closely you will sometimes find that it's o.k. to obfuscate a specific word. Example: GLOBAL emotion$  ...is in use everywhere in the program. You use it to throw and catch messages, communicate between modules. Then have words like "sad", "curious", "in_love" obfuscated as well, it will work. I had a problem when a media name resulted from a concatenation but it was easy to fix: check that the concatenated pieces follow the obfuscation accordingly. The practice has shown me that occasional problems are rare and easy to spot and fix.
Look at the generated code for flip7 (android market) and guess what is what:
Code: (glbasic) [Select]
FUNCTION a942433508: a942741226%, a942283078% //
ALIAS a942344236 AS a942177478
IF a942177478.a942056186=FALSE
//
IF a942741226>=0 AND a942741226<a942177478.a942996609 AND a942283078>=0 AND a942283078<a942177478.a942047006
ALIAS a942109143 AS a942344236.a942985991[a942283078+(a942344236.a942047006)*a942741226]
IF a942344236.a942619820[a942741226][a942283078]<60 //
//
IF a942908340=FALSE THEN a942599879(a942109143)
//

a942247375(a942741226,a942283078,1) //

ENDIF ; ENDIF

ELSE //
//
//
IF a942741226>=0 AND a942741226<a942344236.a942396132 AND a942283078>=0 AND a942283078<a942344236.a942396132
INC a942344236.a942713984[a942741226][a942283078]
ENDIF
ENDIF
ENDFUNCTION
On the day the atom is a cube I will start believing in the square pixel.

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: An obfuscator for GLb on windows
« Reply #4 on: 2014-Sep-02 »
Even better ... use a lot of underscores and som of the same numbers (or no numbers) after them.

local __________________ = FALSE

IF _________________=__________________ THEN ________________(___________________)
    INC ______________._____________________[_____________][____________]
ENDIF

It would also compress better :)         
"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: An obfuscator for GLb on windows
« Reply #5 on: 2014-Sep-02 »
Refactoring in Netbeans or any other ide with refactoring support, would anyway render both of theese obfuscations pretty useless :(
"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1787
    • View Profile
    • Homepage
Re: An obfuscator for GLb on windows
« Reply #6 on: 2014-Sep-02 »
Or just search/replace

Offline hardyx

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 496
    • View Profile
Re: An obfuscator for GLb on windows
« Reply #7 on: 2014-Sep-03 »
Refactoring in Netbeans or any other ide with refactoring support, would anyway render both of theese obfuscations pretty useless :(
Yes, but first you must to know what are you refactoring. =D

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1637
  • Particle Hawk
    • View Profile
Re: An obfuscator for GLb on windows
« Reply #8 on: 2014-Sep-04 »
I wonder if turning it into a gbal would change it more?

Im with moru here, replace 'all'...i do it all the time =D

Hardy if someone grabs a lib, they already have a good idea what its about...time tells all.
« Last Edit: 2014-Sep-04 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)