Common design by obfuscation practices?

Common design by obfuscation practices?

千纸鹤带着心事 发布于 2021-11-28 字数 246 浏览 783 回复 6 原文

What are some common practices you have seen used in the design by obfuscation crowd? I find it interesting to be on projects that are not allowed to be rewritten while, that would be the faster and most efficient solution to the problem.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。



需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。


我的鱼塘能养鲲 2022-06-07 6 楼

And there I was thinking that well designed code should stand up on its own to be read, not deciphered.

I understand that people who care about obfuscation are encouraged to use tools like dotfuscator and its equivalents in other environments. Obfuscation in the sense of making the code harder to decompile though, not just making it a pain to work with.

Why anyone would deliberately design horrible code (except to demonstrate the gotchas) is beyond me.

魂牵梦绕锁你心扉 2022-06-07 5 楼

I worked with a programmer that used to write hugely complex conditions that when met would call a method that simply did a system out. He did this dozens of times throughout the entire app. Still not sure why....

多像笑话 2022-06-07 4 楼

No or useless comments in the code along with no useful documentation.

海拔太高太耀眼 2022-06-07 3 楼

We had one person we worked with store files in a folder call /kensington in order to "hide" them. It just contained some xml files that he didnt want seen and figured people wouldn't look in there.

青春有你 2022-06-07 2 楼

I once worked on perl code where the author decided to have most of the subs receive a single hash as a variable and returned that same hash with data added or removed. Basically one global hash used to pass data through the different code paths.

It looked something like this:

my $hash = ();

$hash->{'CUSTID'} = 1001;
$hash = GetAccounts($hash);

if ($hash->{'AccountTotal'} > 100) {
    $hash = getTotals($hash);
    $hash->{'Acct_Sbkt_Marker'} = 'R1';
    $hash->{'Acct_Invr_Marker'} = 'BT';
    $hash = removeInvalidAccount($hash);

To this day I can't figure out what design pattern he was trying to implement with this.

I remember the $hash would be lined up nicely.

好听的两个字的网名 2022-06-07 1 楼

My favorites always revolve around variables...leaving ones in the code that are no longer used, then giving them all meaningless names. Of course, you have to be careful to avoid nearly all convention if you really want to obfuscate. So, a perfect one would be to have two similarly used variables, one named myVar1, and another named myVarOne. Stuff like that...

Another one is to include un-used controls that are only visible within the code. I stared at one ASP.NET site for a good hour trying to figure out why a FormView was dropped into it..(there was no answer to that).