[unicorn-engine] Re: Getting started

  • From: Brian <lotharyx@xxxxxxxxx>
  • To: unicorn-engine@xxxxxxxxxxxxx
  • Date: Sun, 4 Aug 2019 16:06:24 -0400

What’s a use case for this?  I’m having trouble imagining a broad-scope 
application for an execution environment with absolutely no connection to the 
world outside the emulator whatsoever.  Want to send network packets? You 
can’t.  Want to write a line to the console? There isn’t one.  etc....

-B

On Aug 4, 2019, at 3:35 PM, Derek Snider <derekbsnider@xxxxxxxxx> wrote:

Not exactly. It would be 100% pure compatible C (C99), so no mapping C data 
structures back and forth between the the script language’s form. If a C 
library exists, you could just link it in, and map the function calls, 
nothing else. I know you could do this with CLING but it’s huge, and requires 
basically the entirety of LLVM, and I doubt the result would be as secure as 
using Unicorn-Engine.

So yes, it would be “yet another scripting language”, but it would actually 
be C — real C, not just “C-like”, generating real x86 code, not a high-level 
interpreted bytecode, and can “JIT” the exact same x86 code it’s 
interpreting, and be safely running in the Unicorn engine sandbox, etc.

I think it would be particularly useful, and probably run a heck of a lot 
faster than any other “script language”, even ones with JIT.

Sent from my iPhone

On Aug 4, 2019, at 2:45 PM, farmdve <farmdve@xxxxxxxxx> wrote:

What you are describing is called a scripting language. You know what, even 
Python fits your needs.


On Sun, 4 Aug 2019 at 18:54, Derek Snider <derekbsnider@xxxxxxxxx> wrote:
I looked at that, but it wasn’t quite what I was looking for, I don’t think 
it answered either of my questions.

Is anyone interested perhaps in combining something like “Tiny CC” and 
Unicorn to make a sort of C language that is both secure and portable, and 
fast enough to compile and execute on the fly if necessary, yet still be 
safe (as opposed to actually directly executing compiled code)?


Sent from my iPhone

On Aug 3, 2019, at 1:26 PM, Unicorn Engine <unicorn.emu@xxxxxxxxx> wrote:

You can find some docs from the homepage unicorn-engine.org. 

For example code, see samples under samples/, or bindings/python/




On Sun, Aug 4, 2019, 01:16 Derek Snider <derekbsnider@xxxxxxxxx> wrote:
Hello there,

This project looks super interesting, but the documentation and examples 
are a little lacking.

Two questions:

1) Is there a simple, "Hello, world", type example somewhere? (Ideally 
for Linux or MacOS)?

2) Is there a way to use GCC to generate code that can be executed by 
Unicorn Engine? Like read in a raw .o file and execute it?

Thanks in advance,
-Derek

Other related posts: