This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
H4X0RZ's profile picture

[Question] How can I clean up/mess up my code?

Started by H4X0RZ, 16 April 2013 - 08:45 AM
H4X0RZ #1
Posted 16 April 2013 - 10:45 AM
The "Clean up" is self explanatory.

But you think "Why does he want to mess up his code?" Right?

Here's the answer:
I want to make "pointless" programs, like a password protected door, and you can't edit the code (unless he is a pro in reobfuscating etc.

Off-topic:
What means "BTW"?
Sorry for this question, i'm not the best in english ^^ cuz english isn't my native language (my native language is german)

Thx for reading
-Freack100
JokerRH #2
Posted 16 April 2013 - 10:51 AM
@offtopic question: "by the way" or "nebenbei bemerkt"

@question: You can prevent termination by typing os.pullEvent = os.pullEventRaw, anything more secure is really hard (run apis with modified fs api, disk eventlistener and modified setfenv to prevent people from getting _G)
Engineer #3
Posted 16 April 2013 - 10:53 AM
BTW = by the way

To make your code anti terminate-able you can us these:

os.pullEvent = os.pullEventRaw
 
local oldEvent = os.pullEvent
os.pullEvent = os.pullEventRaw

-- your code

os.pullEventRaw = oldEvent

the first one is a permanent block and the second one only for the program in question

Edit: ninja's are faster than light! Yup, I got ninja'd :P/>
Smiley43210 #4
Posted 16 April 2013 - 10:57 AM
If you want to "obfuscate" it, you COULD make your code into byte code and do loadstring() on it, but byte code can easily be reversed.
H4X0RZ #5
Posted 16 April 2013 - 11:02 AM
If it's a big (big, big, big…) project I can simple rename the variables, functions etc. into some pointless crap like "dkug4" right?
H4X0RZ #6
Posted 16 April 2013 - 11:20 AM
To the "You can safe your code with
os.pullEvent = os.pullEventRaw"
You can bypass it with an Floppy disk.
So, do you still think it's safe?