- Home /
Can I use 'variable name & function name' in a foreign language? (유니티는 '한글 변수명 & 한글 함수명' 이름 지정이 가능한가요?)
It used Google Translator.
Here is why I want to use 'variable name && function name' in a foreign language.
1) Intuitive.
For example, if you write [어제 평균] in English, you should write "YesterdayAverage".
Readability is poor. So I would like to mix 'Korean + English'.
(ex)
class 몬스터class
int 체력int
2) Code defense (a foreigner steals my code)
Unity is vulnerable to decompilation. So, when you develop in Korea, foreigners will decompile it.
Foreigners take my code and sell it in their country.
In order to prevent this code theft, I want to set it in Korean so that I can not recognize the variable.
(ex)
int 가로 = 10;
int 세로 = 20;
int 넓이 = 가로 * 세로;
Original
내가 외국어로 '변수명 && 함수명'을 사용하려는 이유는 다음과 같습니다.
1) 직관적이다.
예를들어, [어제평균]을 영어로 적으면 "AverageYesterday"라고 써야 합니다.
가독성이 떨어집니다.
2) 코드 방어 (외국인이 나의 코드를 도둑질한다.)
유니티는 디컴파일에 취약합니다. 그래서, 한국에서 개발하면, 외국 사람이 그것을 디컴파일합니다.
외국인들은 나의 코드를 가져가서, 그것을 그들의 국가에서 판매해버립니다.
이러한 코드 도둑질을 막기 위해, 나는 변수를 알아볼 수 없도록 한국어로 설정하고 싶습니다.
"Readability is poor" is what you use as argument, as if people can read chinese. lol. I would refrain from using anyother language in program$$anonymous$$g other than english as most program$$anonymous$$g languages are actually based of english words.
I try to develop by myself. However, if I collaborate, I will develop in English.
Answer by tanoshimi · Jul 25, 2017 at 02:41 PM
You can name your variables however you like, but you should do so to increase understandability, not decrease it!
I can't speak Korean, but I can decompile your code and it would be trivial to work out what each variable did from its usage - what you chose to name that variable is irrelevant to me.
Thank you for your reply ^_^ If so, I want to know how to defeat decompilation.
I agree on your first point, i disagree with your second ^^. It's a quite heavy task to deobfuscate code like that. Have a look at Robocraft's main assembly. It's extremely hard to actually distinguish type names from variables or methods. I've seen a vb.net virus (got it for free via email -.-) that actually used some chinese or korean letters. Hell you couldn't even tell them apart as they look all the same :D
You would need to pre-process the code and give everything a simpler name. Also reflection / Cecil can tell you what is a class / method / variable / property ... so you could at least choose a different na$$anonymous$$g style.
When you have a large code base it's a pain to actually reconstruct the classes with meaningful names. I've seen some games made with Untiy and they only use monobehaviour "wrapper". So there's a wrapper monobehaviour with a more or less meaningful name and all it does in awake is to create an instance of a normal class which has completely been obfuscated. Certain events might be forwarded by the wrapper but it makes it very hard to figure out what is doing what.
Thank you for your reply :)
I wonder if I understood your sentence.
(PS : I used Google Translator, so the sentence might be strange.)
1) It's a quite heavy task to deobfuscate code like that.
→ Does encrypting $$anonymous$$orean code mean making the system heavy?
→ Google translator does not recognize the word 'deobfuscate'. However, I am guessing it is related to encryption.
2) Also reflection / Cecil can tell you what is a class / method / variable / property ... so you could at least choose a different na$$anonymous$$g style.
→ If I develop alone, I will create a separate rule to distinguish between 'class / method / variable / property'.
→ example : 몬스터class ($$anonymous$$onster class), int 체력int (int i_HP) ...
→ However, if you are developing in a particular group, I must follow their rules. (I will probably use English at that time.)
3) I've seen some games made with Untiy and they only use monobehaviour "wrapper"
→ From the $$anonymous$$orean search engine I searched monobehaviour "wrapper" but did not see any details. But I'm guessing that this is an act of encrypting existing code.
Answer by EdwinChua · Jul 25, 2017 at 02:37 PM
I'm not sure that what you're proposing would be useful. A good IDE (eg. Visual Studio) would be able to trace the dependencies and refactor them into readable form in a couple of keystrokes.
Example: Pressing F2 in VS when a variable is selected will allow you to rename all uses of this variable, same for classes etc.
Secondly, assuming that you manage to mask your variable names, all your code will still be in English, meaning the logic can be easily understood.
But if you really did want to use another language, you might be able to. See this link where someone did it with Chinese (with problems). https://developercommunity.visualstudio.com/content/problem/75502/intellisense-can-not-list-the-variables-and-functi.html
Thank you for your reply. Visual Studio and Eclipse support $$anonymous$$orean variable names. But Unity was not sure if it would support it.
Other communities recommended code encryption to me. But I still have not enough studying. I'm learning more.
[P.S] This sentence uses a Google Translator, so it may be strange.
Answer by itsharshdeep · Jul 25, 2017 at 03:21 PM
Hi @ggavi2000 ,
I know my answer is not suited with the title, but the user was asking to save the code from decryption by using foreign language
Sorry in case I get the question wrong, But I also just wanna add my opinion
Thanks lot for such a post, I also wanna ask this question a long time ago, but that for just fun part.
Now coming back to your question, I wanna say that do need any system/framework/library which just encrypts the code, so that if someone decompiles then the vars, methods name shouldn't be visible
So I would suggest some of the followings assets available which may fulfill your requirements:
Thanks
Thank you for your kindly reply. I will discuss this with my $$anonymous$$cher. Based on the keywords you provided, I will search more.