Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: How to stop Reverse Engineer a C, C++, VB or C# application? Date: Fri, 31 Mar 2017 12:29:59 -0700 Organization: None to speak of Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="31673d0b95f3086fea3354b3e6518160"; logging-data="11644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7Yq/804fgumynMg+aXPBb" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Ilv5Wuv7UtJfMrKg5BI9/3bi7HY= sha1:vflBJCoBu6fx7XrKVHTKdYsTlUc= Xref: csiph.com comp.lang.c:107549 Ken Brody writes: [...] > In the general sense, you can't generate source code from an executable > file. (You can't turn hamburger back into a cow.) In some cases, it may be > possible, if you know a lot about the compiler and environment used to build > it. (And debug info helps with that.) Well, in principle it should be possible (but perhaps very difficult) to generate source code that can be compiled to produce an identical, or at least functionally identical, executable file. The derived source code isn't likely to bear much resemblance to the original. (If you don't insist on portability, it can just be a C source file consisting almost entirely of inline assembler.) It's likely to be impossible to derive local variable names or the exact forms of constant expressions. This: int x = 0; x ++; and this: int foo = 1-1; foo = foo + 7/5; are likely to generate exactly the same machine code. And any source code you generate is not likely to be useful. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"