|
|
Subscribe / Log in / New account

Obfuscated "GPL" driver?

Obfuscated "GPL" driver?

Posted Oct 9, 2015 2:49 UTC (Fri) by xobs (guest, #104247)
In reply to: Obfuscated "GPL" driver? by alvieboy
Parent article: Status updates for three graphics drivers

The Vivante driver (called "galcore") has lots of interesting nuggets like this gem: from https://github.com/xobs/novena-linux/blob/v3.17-rc5-noven...

/* Append LOAD_STATE. */
buffer[0]
= ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27))) | (((gctUINT32) (0x01 & ((gctUINT32) ((((1 ? 31:27) - (0 ? 31:27) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 31:27) - (0 ? 31:27) + 1))))))) << (0 ? 31:27)))
| ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (Count) & ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16)))
| ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0))) | (((gctUINT32) ((gctUINT32) (Address) & ((gctUINT32) ((((1 ? 15:0) - (0 ? 15:0) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 15:0) - (0 ? 15:0) + 1))))))) << (0 ? 15:0)));


to post comments

Obfuscated "GPL" driver?

Posted Oct 9, 2015 14:39 UTC (Fri) by bcopeland (subscriber, #51750) [Link] (2 responses)

Nice...

buffer[0] = (1 << 31) | ((count & 0x3ff) << 16) | (address & 0xffff);

(Just to satisfy my own curiosity, based on my looking at objdump -S output and no other context, mistakes are my own, etc.)

Obfuscated "GPL" driver?

Posted Oct 9, 2015 14:45 UTC (Fri) by bcopeland (subscriber, #51750) [Link] (1 responses)

Actually 1 << 27... you can read the bit positions directly out of the obfuscation; I mistook 0x8000000 as 0x80000000.

Obfuscated "GPL" driver?

Posted Oct 15, 2015 20:19 UTC (Thu) by pizza (subscriber, #46) [Link]

FWIW, this reads like it was the output of a code generator based on some sort of HDL; probably the same HDL that was used to generate the Verilog used to synthesize the ASIC.

(I've seen a lot of this sort of thing, unfortunately...)

Obfuscated "GPL" driver?

Posted Oct 12, 2015 12:56 UTC (Mon) by cortana (subscriber, #24596) [Link]

Good grief. And this mess is really the "preferred form for modification"?!


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds