mlevin@jade.tufts.edu (06/26/91)
I'd like to hear suggestions, or any tricks that the pros out there know about, for putting some kind of text label or code into your executable (compiled and linked from C code) so that if anyone were to copy a part of the code, you could know it was a copy by somehow seeking out that label. For example, I guess you could probably define a static string in your C program which contained a code word, and then you could know if a given program was copied from yours by doing "strings a.out | grep keyword" or something. I am looking for ideas that are less obvious to detect - a method such that someone copying the code wasn't likely to notice and edit out (with a patch or something). Any ideas would be appreciated. Mike Levin
mullens@jamsun.ic.ornl.gov (James A. Mullens) (06/27/91)
In article <1991Jun26.165609.9692@athena.mit.edu>, mlevin@jade.tufts.edu writes: |> |> I'd like to hear suggestions, or any tricks that the pros out there |> know about, for putting some kind of text label or code into your |> executable (compiled and linked from C code) so that if anyone were to |> copy a part of the code, you could know it was a copy by somehow |> seeking out that label. For example, I guess you could probably define |> a static string in your C program which contained a code word, and |> then you could know if a given program was copied from yours by |> doing "strings a.out | grep keyword" or something. I am looking for |> ideas that are less obvious to detect - a method such that someone |> copying the code wasn't likely to notice and edit out (with a patch or |> something). Any ideas would be appreciated. |> |> Mike Levin How about a static long int initialized to your social security number? To make finding it in a binary file easier you might declare a struct with 2 or 3 such unique numbers, but I think most people's social security number would be unique enough by itself. -- jim mullens oak ridge national laboratory mullens@jamsun.ic.ornl.gov (128.219.64.31) 615-574-5564
kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) (06/27/91)
In article mullens@jamsun.ic.ornl.gov (James A. Mullens) writes: >In article mlevin@jade.tufts.edu writes: >|> >|> I'd like to hear suggestions, or any tricks that the pros out there >|> know about, for putting some kind of text label or code into your >|> executable (compiled and linked from C code) so that if anyone were to > >How about a static long int initialized to your social security >number? To make finding it in a binary file easier you might >declare a struct with 2 or 3 such unique numbers, but I think most >people's social security number would be unique enough by itself. > How about little-endian vs. big-endian architectures? What looks like your SSN on one machine would surely be scrambled on another. Same for text strings coded as long ints. For that matter, how do you go about locating an arbitrary integer within some binary? I'll wager I could find my social security number buried in binaries all over the place. And lint, or perhaps an ANSI compiler will complain about these variables never being used. What are you writing that requires this level of "protection"? Or do you just want to see how "far" your code goes without you? -- Kaleb Keithley kaleb@thyme.jpl.nasa.gov No flashy sig. No clever quips. No famous quotes. This space for rent.
berke@sideout.Kodak.COM (Mike Berke) (06/27/91)
>>|> I'd like to hear suggestions, or any tricks that the pros out there >>|> know about, for putting some kind of text label or code into your >>|> executable (compiled and linked from C code) so that if anyone were to we simply use a character array: static unsigned char copyright[] = {"Copyright Eastman Kodak Company..."}; if you look through the executable code, you will see it. ======================================================================= Don't forget Kodak's Information Center (800-242-2424). Lots of photo- graphic information available and Kodak pays for the call. Try it!! ======================================================================= Mike Berke | Even if Kodak thinks I'm "nobody", Professional Photography Division | I'm really me!! Advanced Imaging Technology +----------------------------------- Eastman Kodak Company | Acutally, I'm not sure that big (716) 726-6823 | companies really think, so I berke@titan.kodak.com | guess these opinions are mine! ======================================================================
mullens@jamsun.ic.ornl.gov (James A. Mullens) (06/27/91)
In article <1991Jun26.194059.19047@thyme.jpl.nasa.gov>, kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) writes: |> In article mullens@jamsun.ic.ornl.gov (James A. Mullens) writes: |> >In article mlevin@jade.tufts.edu writes: |> >|> |> >|> I'd like to hear suggestions, or any tricks that the pros out there |> >|> know about, for putting some kind of text label or code into your |> >|> executable (compiled and linked from C code) so that if anyone were to |> > |> >How about a static long int initialized to your social security |> >number? To make finding it in a binary file easier you might |> >declare a struct with 2 or 3 such unique numbers, but I think most |> >people's social security number would be unique enough by itself. |> > |> |> How about little-endian vs. big-endian architectures? What looks like |> your SSN on one machine would surely be scrambled on another. Same |> for text strings coded as long ints. If your program to detect the SSN were compiled on the same architecture as the executable you are trying to scan, you just define it in the same way -- the byte ordering takes care of itself. |> For that matter, how do you go |> about locating an arbitrary integer within some binary? It think you just read the file as a stream of bytes and check for the SSN byte sequence, starting at every byte in the file (except the last 3 :-). |> I'll wager I could |> find my social security number buried in binaries all over the place. This depends entirely on your SSN. If it happens to match a commonly used sequence of machine instructions (like a return) then you are out of luck. A quickie calculation, assuming a random SSN and an executable consisting of random bytes, tells me there is a 99% chance that a 1 Mb executable will not contain a particular SSN. But hey, I could be wrong and I'm not about to accept your wager! Those with SSN of 000-00-0000 need not try this. -- jim mullens oak ridge national laboratory mullens@jamsun.ic.ornl.gov (128.219.64.31) 615-574-5564
sean@ms.uky.edu (Sean Casey) (06/27/91)
How about generating a random 256 bit number, and imbedding it somewhere in the executable as data. The chance that this particular number will appear in any other given executable is one in 115,792,089, \ 237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457, \ ,584,007,913,129,639,936. Assuming it's very random of course. Sean -- ** Sean Casey <sean@s.ms.uky.edu> ** Recent subject line in comp.sys.handhelds: Printing BIG GROBS
jaenicke@w414zrz.ee.tu-berlin.de (Lutz Jaenicke) (06/27/91)
In article <1991Jun26.165609.9692@athena.mit.edu> mlevin@jade.tufts.edu writes: > > I'd like to hear suggestions, or any tricks that the pros out there >know about, for putting some kind of text label or code into your >executable (compiled and linked from C code) so that if anyone were to >copy a part of the code, you could know it was a copy by somehow >seeking out that label. >I am looking for >ideas that are less obvious to detect - a method such that someone >copying the code wasn't likely to notice and edit out (with a patch or >something). Any ideas would be appreciated. > >Mike Levin As I understand your problem you want to mark your code with a unique identifier, which is not obvious but easy to find for you. There are many ideas which are easy to realise. I would do it by coding my sign twice into the program, one readable for everyone (normally I'm proud of my work) and one in a coded form (XORed, backwarded or whatever else): static char *COPYRIGHT= "@(#) (c) Lutz Jaenicke etc."; static char *COPYRIGHT_EXTRA="A)$*!)d*!Mvu{!Kbfojdlf!dud/"; where the second string is just the same replaced by the char in the ASCII table. The first string is easily found by "what" without problems, search the second by whatever you want. Using a coded form of your signature can lead you to just code your crypt-scheme into your program and check, if a little pig has patched... One could think of doing nasty things, if..., but that depends on your problem. I know people, who I'd suppose to patch in their own name and go shopping with my program. I don't like such people. Don't get ideas, you are sorry of later, Mvu{!Kbfojdlf -- Lutz Jaenicke jaenicke@w414zrz.ee.tu-berlin.de Institut fuer Elektrische Maschinen jaenicke@emapollo.ee.tu-berlin.de Technische Universitaet Berlin Tel. (004930)314-24552 Einsteinufer 11, D-1000 Berlin 10 Fax. (004930)314-21133
iris@interet.UUCP (User) (06/27/91)
In article <1991Jun26.165609.9692@athena.mit.edu> mlevin@jade.tufts.edu writes: > > I'd like to hear suggestions, or any tricks that the pros out there >know about, for putting some kind of text label or code into your >executable (compiled and linked from C code) so that if anyone were to >copy a part of the code, you could know it was a copy by somehow >seeking out that label. For obvious reasons, I won't tell you EXACTLY what we do but it amounts to something like this: static short copyright_stamp[] = CONSTANT1, /* a few starting fixed bytes to search for */ CONSTANT2, CONSTANT3, CONSTANT4, 'T' * CONSTANT5, 'h' * CONSTANT6, 'i' * CONSTANT7, 's' * CONSTANT8, ' ' * CONSTANT9, 'i' * CONSTANT11, 's' * CONSTANT12, ' ' * CONSTANT13, 'm' * CONSTANT14, 'i' * CONSTANT15, 'n' * CONSTANT16, 'e' * CONSTANT17, '!' * CONSTANT18, 0; Make sure whatever operation you perform on the individual characters is reversible. ========================================================================== Iris Engelson uunet!iris@interet Director of Software Development Tel: 201-763-1200 Interet Fax: 201-763-5120 111 Dunnell Road Maplewood, NJ 07040
pbiron@keynes.ucsd.edu (Paul Biron) (06/27/91)
In article <1991Jun26.165609.9692@athena.mit.edu> mlevin@jade.tufts.edu writes: > > I'd like to hear suggestions, or any tricks that the pros out there >know about, for putting some kind of text label or code into your >executable (compiled and linked from C code) so that if anyone were to >copy a part of the code, you could know it was a copy by somehow >seeking out that label. For example, I guess you could probably define >a static string in your C program which contained a code word, and >then you could know if a given program was copied from yours by >doing "strings a.out | grep keyword" or something. I am looking for >ideas that are less obvious to detect - a method such that someone >copying the code wasn't likely to notice and edit out (with a patch or >something). Any ideas would be appreciated. > >Mike Levin How about just using rcs(1L) and ident(1L). rcs allows you put "labels" into to code which are initialized to a character string and are accessable in the binary with the ident command. Basically you put something like: static char *id = "$Source$" ; into your source file, and then when you check something out with rcs, it substitutes for $Source$ something like: static char *id = "$Source: /u3/ssdb/pbiron/src/Nssdb/RCS/main.c,v $" ; Then, when you run ident on the binary, it outputs: $Source: /u3/ssdb/pbiron/src/Nssdb/RCS/main.c,v $ You can get the rcs suite from uunet.
hutch@fps.com (Jim Hutchison) (06/29/91)
In article mlevin@jade.tufts.edu writes: > I'd like to hear suggestions, or any tricks that the pros out there > know about, for putting some kind of text label or code into your > executable (compiled and linked from C code) so that if anyone were to If you "lightly encrypt" a text string and then use either an undocumented command line option or a special command (if its for example a game) to cause the program to print out your banner, you might get just the 007 effect you are looking for. Optionally, you could monitor the progress much more easily by just having it offer your credit card number to the user each 10 times they use the program. This would provide you a relatively geographic spread each time you got your bill. :-) -- - Jim Hutchison {dcdwest,ucbvax}!ucsd!fps!hutch Disclaimer: I am not an official spokesman for FPS computing