[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

If we know how a compiler compiles code in a given language and

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 2

File: 1321719.jpg (57KB, 640x577px) Image search: [Google]
1321719.jpg
57KB, 640x577px
If we know how a compiler compiles code in a given language and we have the compiled binary, isn't it technically possible to reverse the process and get to the source from any given binary?
>>
No.
>>
>>57102306
why?
>>
>>57102292
That's called reverse engineering
>>
>>57102292
It is. Let's make a program which will do that automatically. I'll make the logo.
>>
>>57102319
>downscale bitmap image to smaller size
>upscale it again to original size
>suddenly seemingly-random pixels and blur everywhere
A computer can't make up extra pixels that make sense for a human as much as a compiler can guess how the original code was written.
>>
>>57102292

>f(x) = 4

If I know that for some value of x the output of f is 4, isn't it technically possible to reverse the process and get to the original value?
>>
it's called a decompiler and it has limited usability

https://en.wikipedia.org/wiki/Decompiler
>>
File: untitled.png (208KB, 811x438px) Image search: [Google]
untitled.png
208KB, 811x438px
>disassembler software
>>
>>57102512
disassemblers and decompilers are different things
>>
>>57102292
It is called decompiling. You won't get the exact same source since compilers do several clever things like inlining functions and removing unreachable code and the won't be any variable names so you lose all context from that.
>>
>>57102459
Multiple values of x can map to 4, how do you disambiguate
>>
>>57102292

Consider the fact that you can get the same binary with a lot of different source files.
>>
>>57102574
surely that actually helps you since you only need a usable source, not an identical one
>>
Its a complicated question. There is a lot of stuff that can't easily be determined by just looking at the assembly instructions. For example, most modern day compilers and languages support Object Oriented programming. This allows you to separate chunks of code into little black boxes with fixed inputs and outputs (encapsulation). Once things are finally compiled into something that can actually run on the processor, all this nice organization and formatting disappears. Variable names disappear. Classes disappear. On the bright side, it runs very fast. When you decompile code, you don't get back the same code that you put in. Instead you get a logically identical set of instructions that you sort of manually have to sort through to determine their function.

So yes, its possible. But there's literally a whole industry based around it because its so fucking hard.
>>
>>57102351
Fuck off I'll make the logo.
>>
~$ sha1sum a\ personal\ secret\ of\ mine
2c3b82be 71dac37c 31a53b9a 4eab937d 4142ad54 a personal secret of mine
~$

sha1sum is an open standard, so we know exactly how it works. Find my personal secret.
>>
>>57102653
>current year
>still using spaces in filenames
>>
>>57102653
Hashing has nothing to do with decompiling though
>>
>>57102653
Compiling doesn't turn the code into some cryptographically secure output. It just converts the instructions into machine code.

Nice job showing everyone that you use linux tho.
Thread posts: 20
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.