qiling
qiling copied to clipboard
Rewrite in Rust
Python is a poor choice for anything remotely complex, especially that affects the execution times like emulation. Projects like Angr and Miasm met a bottleneck of Python, it's slowness, GIL, memory hunger, and poor parallelism. On the other hand, reimplementing most of the code in Rust will still allow to provide Python interface, see Rust-Python example.
Hi,
You are right. I am not too sure about Angr but we are definitely more complex then miasm.
So, if someone can start to implement Rust-Python in QIling. We will be really happy.
In fact @xwings has answered this in a Podcast, basically
- friendly for developers and new coming contributors
- code base could be a good learning material (especially for students who want to learn OS internals)
- just enough libraries to base on (unicorn engine, etc)
Miasm folks are rewriting it in Rust too, by the way.
i am pretty sure is a good idea. but do we need it or not now will be the questions.
i am not familiar with MIASM. so, i cannot comment.
I like this idea. But it seems to require a lot of work.
@XVilka I read your link about Rust-Python. It is about to make rust libraries for python. It is nice for people who will need to import our project in python but can we import python in rust to avoid to recode everything?
Is there a way to avoid to recode everything?
@XVilka Your link https://github.com/rochacbruno/rust-python-example might be deprecated. See https://users.rust-lang.org/t/try-keyword-reservation-breaks-macro-try/23398 and https://github.com/rochacbruno/rust-python-example/issues/21
@xwings I do not understand why you closed this issue. We think rust is a good choice and all has not been replaced.
i think re-write with unicorn rust binding will be a good idea, but it seems deprecated.
Has there been any progress on this issue? I'd like to contribute to this if possible. This is a big task though, and I don't think it will happen unless we can get a few core people to divide up the work and contribute consistently. Is anyone actively working on this? Or is anyone interested in working on this?
@0xchase I noticed that I could make a rust library and import it in python see here because it is easier than import python in rust.
I did not do more yet.
Const is a rust keyword. I can not create a const crate instead of this. Do I open an issue to rename this file in order to replace it with a crate?
reopened.
I wrote a similar implementation in rust. Only realized loading windows pe. Lack of gdtr implementation, tls implementation and api hook. It used to be when a private project was implemented, and I saw people have similar ideas, so I will make it public here, and will continue to update.
https://github.com/edsky/muhe
I just found a tool to translate c code to rust https://c2rust.com/ I am looking for a similar program from python to rust. It does not do everything but could help a lot.
DONE! This tools may help very much : https://github.com/konchunas/pyrs !
Assign me to this issue immediately :)
@gogo2464 I can guarantee the automatic transpile will be more difficult than rewriting it from scratch and probably won't work at all
Yup. I agree.
Close for now. Did not see light at the end of tunnel.