qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Funny Bash Script ...
@ 2005-02-13  7:21 Herbert Poetzl
  2005-02-13  7:57 ` Brad Campbell
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Herbert Poetzl @ 2005-02-13  7:21 UTC (permalink / raw)
  To: qemu-devel


Hi Folks!

there is a funny bash script available at

  http://vserver.13thfloor.at/Stuff/QEMU/rev_01.sh

using this on object files (like the kqemu-mod-i386.o)
produces interesting output, which will compile nicely
with gcc to something very similar of the original ..

it's a quick and dirty hack, so naturally far away from
being perfect (for example it doesn't rebuild non .text
sections yet) and of course I would not suggest to use
it on before mentioned object file ...

best,
Herbert

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Funny Bash Script ...
  2005-02-13  7:21 [Qemu-devel] Funny Bash Script Herbert Poetzl
@ 2005-02-13  7:57 ` Brad Campbell
  2005-02-13 15:44   ` Herbert Poetzl
  2005-02-13  8:23 ` Grzegorz Kulewski
  2005-02-13 17:06 ` Jim C. Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Brad Campbell @ 2005-02-13  7:57 UTC (permalink / raw)
  To: qemu-devel

Herbert Poetzl wrote:
> Hi Folks!
> 
> there is a funny bash script available at
> 
>   http://vserver.13thfloor.at/Stuff/QEMU/rev_01.sh
> 
> using this on object files (like the kqemu-mod-i386.o)
> produces interesting output, which will compile nicely
> with gcc to something very similar of the original ..
> 

Anyone can disassemble a binary and re-compile it. Understanding exactly how it works is another 
story entirely. I believe you would be in violation of the license if you distributed the 
de-compiled source, so what do you gain by doing this?

In addition, we are talking kernel code here. The sort of stuff where random compiler optimisations 
can cause catastrophic failures. Can you guarantee by doing this you are generating exactly the same 
code as you started with? I would certainly be loathe to trust the compiled binary.

Brad
-- 
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Funny Bash Script ...
  2005-02-13  7:21 [Qemu-devel] Funny Bash Script Herbert Poetzl
  2005-02-13  7:57 ` Brad Campbell
@ 2005-02-13  8:23 ` Grzegorz Kulewski
  2005-02-13 17:06 ` Jim C. Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Kulewski @ 2005-02-13  8:23 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: qemu-devel

On Sun, 13 Feb 2005, Herbert Poetzl wrote:
> there is a funny bash script available at
>
>  http://vserver.13thfloor.at/Stuff/QEMU/rev_01.sh
>
> using this on object files (like the kqemu-mod-i386.o)
> produces interesting output, which will compile nicely
> with gcc to something very similar of the original ..
>
> it's a quick and dirty hack, so naturally far away from
> being perfect (for example it doesn't rebuild non .text
> sections yet) and of course I would not suggest to use
> it on before mentioned object file ...

Hi,

Ok, so you just (re)invented dissassembler that produces compilable 
output. There are of course better ones (that for example are trying to 
make C code out of its output).

Using it may be illegal in some countries. Maybe in some not. But this is 
clearly against the author who gave it to you for free but with no source.

I can bet that any programmer who knows assembler a little can disassemble 
that file (come on its only 36 kilo!) by hand using anything and put the 
result into C code. I know about better challenges. For example try to 
disassemble (and understand) normal PC BIOS. It is really something 
challenging. And some people did this in the past (you think how companies 
other than IBM got the BIOS production technology?). BIOS is a mix of 
awfull hacks (some with historical explanation). Desassembling it is a 
real pain. How can I compare it to that clean 36666 bytes output of gcc 
- even not linked part of Linux module.

The only thing that I do not understand is why such tool can be useful at 
all??? Forgive me, but I really do not. What you can get is more-or-less 
(rather less) correct version of oryginal. It can produce strange bugs or 
not work at all. But this way you do not change its licence or make it any 
more open source. Open source does not mean "you can compile it" but "you 
can get the _real_ source of it and the _author_ does want to give it to 
you"!

Can you clarify your intentions?


Grzegorz Kulewski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Funny Bash Script ...
  2005-02-13  7:57 ` Brad Campbell
@ 2005-02-13 15:44   ` Herbert Poetzl
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Poetzl @ 2005-02-13 15:44 UTC (permalink / raw)
  To: Brad Campbell; +Cc: qemu-devel

On Sun, Feb 13, 2005 at 11:57:37AM +0400, Brad Campbell wrote:
> Herbert Poetzl wrote:
> >Hi Folks!
> >
> >there is a funny bash script available at
> >
> >  http://vserver.13thfloor.at/Stuff/QEMU/rev_01.sh
> >
> >using this on object files (like the kqemu-mod-i386.o)
> >produces interesting output, which will compile nicely
> >with gcc to something very similar of the original ..
> 
> Anyone can disassemble a binary and re-compile it. 

sure, that's why this script is there ... ;)

> Understanding exactly how it works is another story entirely. 

agreed, but understanding binary code is harder ;)

> I believe you would be in violation of the license if you 
> distributed the de-compiled source, so what do you gain by 
> doing this?

well, I'm pretty sure that most of the current qemu
hackers are able to _understand_ readable assembler
code, so it might not be that complicated ...

> In addition, we are talking kernel code here. 

yes, I'm aware of that, but let me assure you, this
kernel code is much simpler than most of the userspace
part qemu folks are working with/on ...

> The sort of stuff where random compiler optimisations can cause 
> catastrophic failures. 

of course, and some hackers have been eaten by a grue!

> Can you guarantee by doing this you are generating exactly the 
> same code as you started with? 

nobody wants to do that, otherwise you could take the
object file and be done, nevertheless, comparing the
disassembled code of two object files usually sheds
some light on the differences (i.e. with diff)

> I would certainly be loathe to trust the compiled binary.

but an unknown, proprietary object file nobody takes
liability for you trust ... i.c. 

best,
Herbert

> Brad
> -- 
> "Human beings, who are almost unique in having the ability
> to learn from the experience of others, are also remarkable
> for their apparent disinclination to do so." -- Douglas Adams
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Funny Bash Script ...
  2005-02-13  7:21 [Qemu-devel] Funny Bash Script Herbert Poetzl
  2005-02-13  7:57 ` Brad Campbell
  2005-02-13  8:23 ` Grzegorz Kulewski
@ 2005-02-13 17:06 ` Jim C. Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Jim C. Brown @ 2005-02-13 17:06 UTC (permalink / raw)
  To: qemu-devel

On Sun, Feb 13, 2005 at 08:21:20AM +0100, Herbert Poetzl wrote:
> 
> and of course I would not suggest to use
> it on before mentioned object file ...

I agree. Doing so would be very unethical, considering that Fabrice released it
to us for free. Only reason to do so would be to find and fix bugs, and even
that is a long shot. You certainly can't use this to make kqemu open - the
redistribution restriction would apply to the disassembled code as well
(assuming that such disassembly is legal).

> 
> best,
> Herbert
> 

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-13 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-13  7:21 [Qemu-devel] Funny Bash Script Herbert Poetzl
2005-02-13  7:57 ` Brad Campbell
2005-02-13 15:44   ` Herbert Poetzl
2005-02-13  8:23 ` Grzegorz Kulewski
2005-02-13 17:06 ` Jim C. Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).