qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Execute a char buffer without loading ELF
@ 2010-03-23 16:50 John Vele
  2010-03-24  0:20 ` Paul Brook
  0 siblings, 1 reply; 2+ messages in thread
From: John Vele @ 2010-03-23 16:50 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

Hello,

I am involved in a project that we use Qemu user mode for i386
(./i386-linux-user/qemu-i386). I want to modify the source code
in such a way to make qemu execute a buffer of bytes (given from the comman
line for example) rather than loading
an ELF file and executing. I started looking at linux-user/linuxload.c
loader_exec() function  and linux-user/elfload.c load_elf_binary()
function. Is there a way to bypass the loading of an ELF file and load a
single buffer of bytes (that is i386 code) into memory
and make Qemu start execution on it?

Any help or comment is very very appreciated.

Thanx in advance

[-- Attachment #2: Type: text/html, Size: 657 bytes --]

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

* Re: [Qemu-devel] Execute a char buffer without loading ELF
  2010-03-23 16:50 [Qemu-devel] Execute a char buffer without loading ELF John Vele
@ 2010-03-24  0:20 ` Paul Brook
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Brook @ 2010-03-24  0:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Vele

> I am involved in a project that we use Qemu user mode for i386
> (./i386-linux-user/qemu-i386). I want to modify the source code
> in such a way to make qemu execute a buffer of bytes (given from the comman
> line for example) rather than loading
> an ELF file and executing. I started looking at linux-user/linuxload.c
> loader_exec() function  and linux-user/elfload.c load_elf_binary()
> function. Is there a way to bypass the loading of an ELF file and load a
> single buffer of bytes (that is i386 code) into memory
> and make Qemu start execution on it?

Short answer is no.

Long answer is:
- Creating an ELF image from a blob of data if fairly trivial, so you don't 
really need this functionality.
- You're using linux usermode emulation. Linux doesn't load and execute random 
data. Neither do we.
- Loading a blob of code at an arbitrary location probably won't do what you 
want anyway.

Paul

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

end of thread, other threads:[~2010-03-24  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23 16:50 [Qemu-devel] Execute a char buffer without loading ELF John Vele
2010-03-24  0:20 ` Paul Brook

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).