| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|---|
| 2 | <html>
|
|---|
| 3 | <head>
|
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|---|
| 5 | <title>How to Discover Hidden GPL Use</title>
|
|---|
| 6 | <style type="text/css"></style>
|
|---|
| 7 | </head>
|
|---|
| 8 | <center>
|
|---|
| 9 | <font size="+2"><b>How to Discover Hidden GPL Use</b></font>
|
|---|
| 10 | </center>
|
|---|
| 11 |
|
|---|
| 12 | <blockquote>
|
|---|
| 13 | The simplest way to discover hidden GPL use in programs is to use strings.exe, found at
|
|---|
| 14 | <a href="https://technet.microsoft.com/en-us/sysinternals/bb897439.aspx" target=_blank>sysinternals</a>.
|
|---|
| 15 | But since the idea is to hide the use, the program is more often than not encrypted or compressed.
|
|---|
| 16 | To compress programs, one common method is to use UPX, found at
|
|---|
| 17 | <a href="http://upx.sourceforge.net/" target=_blank>upx.sourceforce.net</a>. Fortunately, UPX can
|
|---|
| 18 | also decompress what it has compressed. Again, since the idea is to hide what can be discovered by looking
|
|---|
| 19 | at strings (strings are text), the "UPX" markers are often removed, even though doing so is against the UPX
|
|---|
| 20 | license.
|
|---|
| 21 | <p>
|
|---|
| 22 | Find the EXEs or DLLs you want to investigate. This example uses the 32-bit version of BlueIris.exe,
|
|---|
| 23 | from one of its many 4.0.9.x releases.
|
|---|
| 24 | <pre>
|
|---|
| 25 | 2015.06.23 22:54 <DIR> sounds
|
|---|
| 26 | 2015.06.23 22:54 <DIR> www
|
|---|
| 27 | 2008.01.26 12:07 135,168 HHNetClient.dll
|
|---|
| 28 | 2013.10.05 02:38 4,449,952 mfc120u.dll
|
|---|
| 29 | 2013.10.05 02:38 970,912 msvcr120.dll
|
|---|
| 30 | 2013.12.04 10:33 506,368 EASendMailObj.dll
|
|---|
| 31 | 2014.04.28 16:32 220,016 ftd2xx.dll
|
|---|
| 32 | 2014.05.21 15:25 143,720 SeaMAX.dll
|
|---|
| 33 | 2014.09.03 14:16 59,776 BlueIrisService.exe
|
|---|
| 34 | 2014.10.31 21:17 608,640 BlueIrisApplePush.exe
|
|---|
| 35 | 2014.12.16 16:36 230,400 libfaad.dll
|
|---|
| 36 | 2014.12.22 13:01 1,410 ReadMe.txt
|
|---|
| 37 | 2015.04.12 21:02 490,336 BlueIrisAdmin.exe
|
|---|
| 38 | 2015.06.21 02:40 4,032,566 BlueIris.chm
|
|---|
| 39 | 2015.06.23 14:36 7,768,416 BlueIris.exe
|
|---|
| 40 | 13 File(s) 19,617,680 bytes
|
|---|
| 41 |
|
|---|
| 42 | </pre>
|
|---|
| 43 | The main program is BlueIris.exe, sized at 7,768,416 bytes. However, this is the UPX-compressed size.
|
|---|
| 44 | How can you tell it's been compressed by UPX? Use a binary editor to look at the first KB of the
|
|---|
| 45 | file:
|
|---|
| 46 | <pre>
|
|---|
| 47 | 0000 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00 MZ..............
|
|---|
| 48 | :
|
|---|
| 49 | 0040 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 ..............Th
|
|---|
| 50 | 0050 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f is program canno
|
|---|
| 51 | 0060 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 t be run in DOS
|
|---|
| 52 | 0070 6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00 mode............
|
|---|
| 53 | 0080 94 db 54 a6 d0 ba 3a f5 d0 ba 3a f5 d0 ba 3a f5 ................
|
|---|
| 54 | :
|
|---|
| 55 | 0250 55 50 58 30 00 00 00 00 00 b0 5a 01 00 10 00 00 UPX0............
|
|---|
| 56 | 0260 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 ................
|
|---|
| 57 | 0270 00 00 00 00 80 00 00 e0 55 50 58 31 00 00 00 00 ........UPX1....
|
|---|
| 58 | :
|
|---|
| 59 | 03d0 00 00 00 00 00 00 00 00 00 00 00 33 2e 39 31 00 ...........3.91.
|
|---|
| 60 | 03e0 55 50 58 21 0d 09 08 09 9d 81 28 4d c1 83 65 9f UPX.............
|
|---|
| 61 | 03f0 9b 1d cd 01 4a 78 72 00 00 78 58 01 16 00 00 c6 ................
|
|---|
| 62 | 0400 ed ff ff ff 55 89 e5 57 56 53 83 ec 5c 89 cb 8a ................
|
|---|
| 63 | </pre>
|
|---|
| 64 | If you don't see UPX that does not mean it was not UPX compressed since it's simple
|
|---|
| 65 | to overwrite the UPX characters with spaces. Often, UPX can still detect that it
|
|---|
| 66 | is a UPX-compressed binary so go ahead and try even if you don't see these markers.
|
|---|
| 67 | <p>
|
|---|
| 68 | First thing, decompress the program using UPX with its -d option switch:
|
|---|
| 69 | <pre>
|
|---|
| 70 | C:\wk>upx.exe -d BlueIris.exe
|
|---|
| 71 | Ultimate Packer for eXecutables
|
|---|
| 72 | Copyright (C) 1996 - 2013
|
|---|
| 73 | UPX 3.91w Markus Oberhumer, Laszlo Molnar & John Reiser Sep 30th 2013
|
|---|
| 74 |
|
|---|
| 75 | File size Ratio Format Name
|
|---|
| 76 | -------------------- ------ ----------- -----------
|
|---|
| 77 | 22579040 <- 7768416 34.41% win32/pe BlueIris.exe
|
|---|
| 78 |
|
|---|
| 79 | Unpacked 1 file.
|
|---|
| 80 | </pre>
|
|---|
| 81 | Notice the 7.7 MB file size has ballooned to 22.5 MB. This, the non-compressed
|
|---|
| 82 | program file, is on what strings.exe is to operate. To use strings.exe you can
|
|---|
| 83 | run with only the file to inspect as the input, but that scrolls off the screen very
|
|---|
| 84 | fast. For this program, strings.exe generates 1,103,007 lines of text. Not all lines
|
|---|
| 85 | are true text, but you can presume that there is a LOT of text in this. The text belongs
|
|---|
| 86 | primarily to the GPL libraries being used. Which GPL libraries? A simple way to see
|
|---|
| 87 | only text lines which have the text, GPL, in them, is to use this trick:
|
|---|
| 88 | <pre>
|
|---|
| 89 | C:\wk>strings.exe BlueIris.exe | findstr /i GPL
|
|---|
| 90 | </pre>
|
|---|
| 91 | to see this: (most of the text generated was removed below - in total about 24 lines, though some lines are very long)
|
|---|
| 92 | <pre>
|
|---|
| 93 | libswresample license: GPL version 2 or later
|
|---|
| 94 | libswscale license: GPL version 2 or later
|
|---|
| 95 | libavcodec license: GPL version 2 or later
|
|---|
| 96 | libavformat license: GPL version 2 or later
|
|---|
| 97 | libavutil license: GPL version 2 or later
|
|---|
| 98 | </pre>
|
|---|
| 99 | You can redirect the output of strings.exe so that it goes to a file, if, for
|
|---|
| 100 | example, you want to see the entire lot of possible strings (a very large file
|
|---|
| 101 | results from this):
|
|---|
| 102 | <pre>
|
|---|
| 103 | C:\wk>strings.exe BlueIris.exe > bi_using_gpl.txt (has over 1 million lines of text)
|
|---|
| 104 | </pre>
|
|---|
| 105 | You have discovered that this particular program is using GPL code. If you discover such programs,
|
|---|
| 106 | contact their respective companies and demand that they comply with the (L)GPL license. These
|
|---|
| 107 | companies often have draconian DRM in place to force you to comply to their licenses, so why are
|
|---|
| 108 | they free to ignore the GPL?
|
|---|
| 109 | <p>
|
|---|
| 110 | For LGPL use, the first and last requirements listed at <a href="https://www.ffmpeg.org/legal.html" target=_blank>https://www.ffmpeg.org/legal.html</a> are:
|
|---|
| 111 | <p>
|
|---|
| 112 | <blockquote>
|
|---|
| 113 | 1. Compile FFmpeg without "--enable-gpl" and without "--enable-nonfree".<br>
|
|---|
| 114 | :<br>
|
|---|
| 115 | 18. Make sure your program is not using any GPL libraries (notably libx264).</i>
|
|---|
| 116 | </blockquote>
|
|---|
| 117 | yet from the strings' output of blueiris.exe (see above) you find:
|
|---|
| 118 | <blockquote>
|
|---|
| 119 | <code>
|
|---|
| 120 | --enable-gpl --cpu=i686 --prefix=/c/msys/1.0/ffmpeg/build --enable-libx264
|
|---|
| 121 | </code>
|
|---|
| 122 | </blockquote>
|
|---|
| 123 | which makes this GPL use, not LGPL. Numbers 2 through 17 are also violated.
|
|---|
| 124 | <p>
|
|---|
| 125 | <br>
|
|---|
| 126 | </blockquote>
|
|---|
| 127 | </body>
|
|---|
| 128 | </html>
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|