LoginLogin
Might make SBS readonly: thread

SmileBASIC Obfuscator

Root / Submissions / [.]

SimeonCreated:
Download:NKW5E3JD
Version:1.3Size:22.9KB
This application compresses SmileBASIC code, removes comments, newlines, spacing, renames variables, functions, and labels, compresses numbers. It moves strings and numbers into a compact data section, then masks these values to constants that are accessed in array indexing. It provides automatic code editing, line indentation, formatting numbers, string, and spacing properly, or just minify and compact everything. Currently, there are a few options that the user can choose from, but this application is currently undergoing major development to support many more options with a user friendly UI in the future. This current version is stable and provides high quality code automation. The discussion forum can be found at: http://smilebasicsource.com/forum?ftid=1659 Cheers!

Instructions:

Currently, there are eight boolean options that the obfuscator provides:
  • Minify or semi-beautify the code
  • Keep or remove comments
  • Rename labels
  • Rename variables
  • Rename functions
  • Assign variables to non-variable values such as strings and numbers
  • Mask numbers and indexes with constants and hexadecimal representations
  • Search strings for variable names, function names, and labels, which will be renamed as well
By saying "Yes" to every question, the code will become compact and unreadable, yet executable. Future updates will expand the code beautification capabilities and provide a lot more customization than the eight yes/no options that are currently present. The file will be saved as the original name of the program with "OBF_" added to the front. (The obfuscated code can also be found in PRG1) It will then attempt to execute the program.

Enjoy!


I don't really get the criticism of this... It's just a small experimental program that has a bunch of uses outside scrambling your code around. You could, for example, use this on a small part of your code just to hide the checksum algorithm for your save files, or the puzzle solution in a game. If someone actually uses this on their entire program, obscuring the most useful and repurposable functions, then that's bad. also i just think it's a bit rude to downvote someone's program without trying it...

Replying to:TheV360
I don't really get the criticism of this... It's just a small experimental program that has a bunch of uses outside scrambling your code around. You could, for example, use this on a small part of your code just to hide the checksum algorithm for your save files, or the puzzle solution in a game. If someone actually uses this on their entire program, obscuring the most useful and repurposable functions, then that's bad. also i just think it's a bit rude to downvote someone's program without trying it...
i never thought of using it this way...

Replying to:TheV360
I don't really get the criticism of this... It's just a small experimental program that has a bunch of uses outside scrambling your code around. You could, for example, use this on a small part of your code just to hide the checksum algorithm for your save files, or the puzzle solution in a game. If someone actually uses this on their entire program, obscuring the most useful and repurposable functions, then that's bad. also i just think it's a bit rude to downvote someone's program without trying it...
I would find your comment agreeable and applicable, if not for two things: The creator suggested an intent to protect code in whole and really only suggested the cheating motive later, stating
people would be able to compress and rename all variables and functions in their code automatically, and make it nearly impossible to understand This would be a really nice program for SmileBASIC
and suggesting that "SmileBASIC may be less beginner friendly" is some sort of minor inconvenience. This troubles me. If obfuscating SmileBASIC programs becomes the norm I think the community will suffer for it. Even if people cheat--so what? Either they're learning by working with someone else's code, or they're just ruining the fun for themselves. I don't think the tool should be removed entirely: its existence does not invent obfuscation. Any sufficiently knowledgeable programmer could do so manually as needed. It may not even cause its proliferation. But there is something to be said for its existence towards the encouragement of such practices, if no one speaks against it. I would retract my vote, but at this point contention has played out on the vote system and I don't think there is much point.

Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?

Replying to:haloopdy
Most of the programs I've made use VAR("THING") and CALL("WHATEVER"), and considering how useful it is, I'd say many of the more complex programs for which your program would be beneficial (like for anti-cheating) would fail. But I get why it's difficult. You COULD do a heuristic to capture the common use cases for VAR and CALL, and if a program STILL doesn't work well then they're doing something crazy. For instance, you could search for all string literals and if they match an existing function or variable name (that you've obfuscated), you can replace the literal. This will fix both CALL("MYFUNC") and CALL(THING$) where THING$ is set to a literal SOMEWHERE.
Will do! Good idea

Replying to:haloopdy
Most of the programs I've made use VAR("THING") and CALL("WHATEVER"), and considering how useful it is, I'd say many of the more complex programs for which your program would be beneficial (like for anti-cheating) would fail. But I get why it's difficult. You COULD do a heuristic to capture the common use cases for VAR and CALL, and if a program STILL doesn't work well then they're doing something crazy. For instance, you could search for all string literals and if they match an existing function or variable name (that you've obfuscated), you can replace the literal. This will fix both CALL("MYFUNC") and CALL(THING$) where THING$ is set to a literal SOMEWHERE.
Keep in mind that if the string is prefaced by a number and a colon, you have to keep the number/colon combo. For instance:
VAR("AVARIABLE") -> VAR("OBFA")
VAR("3:AVARIABLE") -> VAR("3:OBFA")
So you must check both that a literal matches the exact name and also that the string matches [n]:<string>, and only replace the name portion.

Replying to:Simeon
Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?
Manually obfuscating something means that you would put the effort into making it unreadable, making you think twice about it. Automation removes that barrier, allowing anyone with the knowledge of how to operate your obfuscator to ruin their code for everyone else. :(

Replying to:Simeon
Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?
Also line 325 gives me an out of memory error

Replying to:Simeon
Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?
I don't remember anyone ever praising manual obfuscation.

Replying to:Simeon
Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?
He's referring to that one puzzle thing where no one knew what did what

I actually don't understand why there is too much hate... I like the idea.

Replying to:Simeon
Wow that is a lot of opinions... I don't like arguing can I not be on anybody's bad side? Lol Well I'm going to turn this into a highly customizable, automatic code editor ** Which will include beautifying code too ** But the purpose of this was to support the idea of complete consistency of code, and I can achieve that really easily now. So, after some updates I'll end up renaming this to something that doesn't sound as threatening. Sorry for that. Cause it'll be a tool to edit code however the user wants. To save time doing it manually. Not to focus purely on hiding things! (But I want that to be an option) It's worth noting that this would be easy to apply only to specific functions. My goal is to give the users more power over THEIR code, that's all. Before submitting this, manually obfuscating programs was praised. Why does automating it suddently change everyone's opinions?
The thing Nathaniel did?

Replying to:hakke
I actually don't understand why there is too much hate... I like the idea.
The posts below and the related thread gives a general idea or two.

This is pretty cool! I can understand why some people are upset, but when used in the right ways, this can be used as a way to hide secret code (such as code for puzzles).

SmileBASIC Deobfuscator. Coming 2019 to a 3DS near you. Official Devlog

Replying to:IAmRalsei
SmileBASIC Deobfuscator. Coming 2019 to a 3DS near you. Official Devlog
Heck yeah, now I can deobfuscate the... [checks notes] zero programs using this

Replying to:IAmRalsei
SmileBASIC Deobfuscator. Coming 2019 to a 3DS near you. Official Devlog
This program was obfuscated probably using itself