? SmileBASIC Obfuscator ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SmileBASIC Obfuscator

Submitted
Updated
Author
Simeon
Public Key
NKW5E3JD
Min. Compat.
All
Version
1.3
Size
22.9KB
Rating
22 votes
Description 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:
  1. Minify or semi-beautify the code
  2. Keep or remove comments
  3. Rename labels
  4. Rename variables
  5. Rename functions
  6. Assign variables to non-variable values such as strings and numbers
  7. Mask numbers and indexes with constants and hexadecimal representations
  8. 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!

Categories
Keywords
  • code
  • obfuscator
  • minifier
  • obfuscate
  • minify
  • beautify
34 Comment(s) HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Forum Contributor Hidden Achievements 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). banana banana RNG Hidden Easter Eggs Disguised Hidden Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I actually don't understand why there is too much hate... I like the idea. spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength The posts below and the related thread gives a general idea or two. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies 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? kenchic kenchic Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Good Page Hidden Achievements 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. :( SmileForTheKiddies SmileForTheKiddies Also line 325 gives me an out of memory error 12Me21 12Me21 Head Admin Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I don't remember anyone ever praising manual obfuscation. kenchic kenchic Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Good Page Hidden Achievements He's referring to that one puzzle thing where no one knew what did what MochaProbably MochaProbably Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies The thing Nathaniel did? TheV360 TheV360 Third Year My account is over 3 years old Website First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself 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... IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength i never thought of using it this way... Y_ack Y_ack 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.
MochaProbably MochaProbably Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies ”Hmm, what would be the best way for people to look at my stuff and say “Hey, what the hell is this?” Oh yeah, change very function to random lengths of _ and scatter random number throughout”. kantackistan kantackistan Neat! Can't wait to play around with this. Probably won't start obfuscating everything, but I love hiding secrets for only the most determined of players to find. randomous randomous Owner Robot Hidden Easter Eggs Second Year My account is over 2 years old Website Drawing I like to draw! Hobbies 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. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Will do! Good idea randomous randomous Owner Robot Hidden Easter Eggs Second Year My account is over 2 years old Website Drawing I like to draw! Hobbies 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. kenchic kenchic Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Good Page Hidden Achievements The point of an open-source platform is to allow others to read and eventually understand others' programs. Y_ack Y_ack commenting on the page increases rank. this debate goes here: https://smilebasicsource.com/forum?ftid=1659 Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Why the dislikes? IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength the fact an obfuscator exists is a problem in the first place Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies How is that a bad thing spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Only Toad would see non-editable and understandable code as a problem since Toad probably wants to view how a program works against an uploader's wishes. I'm guessing it's the quality of the obfuscation that people don't like or we have a Toad army. Y_ack Y_ack I downvoted this program based on the principles established in the discussion thread. Regardless of its quality, an obfuscator does not deserve widespread use or the same level of prestige as other development tools and libraries. Similarly, I downvoted Amihart's challenge after my solution not because of its quality but in an attempt to discourage mindless clones. spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Oh okay that makes sense. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Chicken also has a problem with it to quote the higher up comment, "The point of an open-source platform is to allow others to read and eventually understand others' programs." amihart amihart People salty over the existence of an obfuscator because they want "free code", when they don't realize that trying to suppress the existence of an obfuscator is antithetical to that very concept. amihart amihart Interesting. You should probably have a "WHILE BUTTON()!=0:WEND" at the beginning, because pressing A just to start the program causes it to also press A on the first option which is a bit annoying. spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength What about using an "on button release" for that? Or is bounce an issue? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Fixed, thanks! 12Me21 12Me21 Head Admin Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength It might be a good idea not to obfuscate COMMON functions since they'll probably be used in another slot. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Well, from my knowledge, then the COMMON functions would completely not work if it uses global variables. I need to do more testing My solution right now is just to combine everything into one file before obfuscation If I find a better solution I will definitely attempt it Maybe automatically combining all the needed files then separate them and save each one 12Me21 12Me21 Head Admin Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Oh, I meant to say specifically the function name. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies If you get an error other than "Out of memory" then you may be trying to obfuscate variables, functions, or labels in a program that uses CHKVAR(), CHKCALL(), or CHKLABEL(). If this is not the case, it would be very nice if you could send the un-obfuscated program to me so that I can find the cause. CHK functions cannot be worked around without completely re-implementing the CHK function code. This uses the same principles of the halting problem, CHK function strings cannot be obfuscated without evaluating the expression, which leads to broader issues...