Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Howto install Qira on ubuntu 20.04 #258

Open
smurfd opened this issue Apr 18, 2021 · 16 comments
Open

Howto install Qira on ubuntu 20.04 #258

smurfd opened this issue Apr 18, 2021 · 16 comments

Comments

@smurfd
Copy link

smurfd commented Apr 18, 2021

This is done on a fresh install of ubuntu 20.04 with installed git.
grab these :
qira-qemu.txt
qira.txt

git clone https://github.com/geohot/qira.git
cd qira
patch -p1 < ../qira.txt

install.sh will end in error : util/memfd.c:43:12: error: static declaration of ‘memfd_create’ follows non-static declaration

cd tracers/qemu/qemu
patch -p1 < ../../../../qira-qemu.txt

cd ../../..
./install.sh
Booom :)

@Wgmlgz
Copy link

Wgmlgz commented Apr 18, 2021

I tried to use this but I get this error:

ERROR: Command errored out with exit status 1:
 command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-D2fxo9/filelock/setup.py'"'"'; __file__='"'"'/tmp/pip-install-D2fxo9/filelock/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-NbW9l7                                                                                         
     cwd: /tmp/pip-install-D2fxo9/filelock/                                                                                                                      
Complete output (8 lines):                                                                                                                                       
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'test_suite'                                                                 
  warnings.warn(msg)                                                                                                                                             
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]                                                                                            
   or: setup.py --help [cmd1 cmd2 ...]                                                                                                                           
   or: setup.py --help-commands                                                                                                                                  
   or: setup.py cmd --help                                                                                                                                       
                                                                                                                                                                 
error: invalid command 'egg_info'                                                                                                                                
----------------------------------------                                                                                                                         

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Can you please help me, I am n00b(

@smurfd
Copy link
Author

smurfd commented Apr 18, 2021

weird, try to in the qira folder:
mv venv venv1
then rerun the install.sh

if that does not work, im not sure ...maby you had installed pip2 already!?

@Wgmlgz
Copy link

Wgmlgz commented Apr 18, 2021

Yes, a have pip2 installed (I comment pip2 installation lines), but now I am getting another error:

util/memfd.c:43:12: error: static declaration of ‘memfd_create’ follows non-static declaration
43 | static int memfd_create(const char *name, unsigned int flags)
| ^~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:113,
from /usr/include/x86_64-linux-gnu/bits/mman.h:34,
from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
from /home/wgmlgz/qira/tracers/qemu/qemu/include/qemu/osdep.h:142,
from util/memfd.c:28:
/usr/include/x86_64-linux-gnu/bits/mman-shared.h:50:5: note: previous declaration of ‘memfd_create’ was here
50 | int memfd_create (const char *__name, unsigned int __flags) __THROW;
| ^~~~~~~~~~~~
make: *** [/home/wgmlgz/qira/tracers/qemu/qemu/rules.mak:57: util/memfd.o] Error 1
make: *** Waiting for unfinished jobs....

@smurfd
Copy link
Author

smurfd commented Apr 18, 2021

from my 1st post :

install.sh will end in error : util/memfd.c:43:12: error: static declaration of ‘memfd_create’ follows non-static declaration

cd tracers/qemu/qemu
patch -p1 < ../../../../qira-qemu.txt

cd ../../..
./install.sh

@Wgmlgz
Copy link

Wgmlgz commented Apr 18, 2021

I ended up just reinstalling my ubuntu vm and your patches are working! By the way, can you please make patch for kali?

@smurfd
Copy link
Author

smurfd commented Apr 18, 2021

same works for kali linux also, u just need to grab these and install them before ... since they seem to have screwed up something about their python2 install.
http://ftp.us.debian.org/debian/pool/main/p/python-scandir/python-scandir_1.9.0-2_amd64.deb
http://ftp.us.debian.org/debian/pool/main/p/python-filelock/python-filelock_3.0.10-1_all.deb

@Wgmlgz
Copy link

Wgmlgz commented Apr 18, 2021

Man, that's works for kali! Thanks you a lot!

@smurfd
Copy link
Author

smurfd commented Apr 25, 2021

These will not force python2, but use python3 only

Grab and save to a folder. had to update some stuff in the requirements.txt

qira-py39.txt
qira-qemu-py39.txt

Then :

git clone https://github.com/geohot/qira
cd qira/tracers/qemu
git clone https://github.com/geohot/qemu.git --depth 1 --branch qira
cd qemu
patch -p1 < ../../../../qira-qemu-py39.patch
cd ../../..
patch -p1 < ../qira-py39.patch
./install.sh

OBVIOUSLY there might be some subtleties that im missing or have broken. use at own risk, same ofcourse goes for previously pasted patches...

Sidenote:
Also tried to build against qemu git main. the trick to building that was to remove the --cpu=unknown and rearrange the symlinks in tracers/qemu to point to point like : qira-aarch64 -> qemu/build/aarch64-linux-user/qemu-aarch64

Something with the webserver/client/update part did not like this however :/
pretty sure it is some python2 to python3 junk that breakts things.

@hopinheimer
Copy link

Apparently python-pip has been removed from the repositories for Ubuntu 20.04 and according to the install.sh script python-pip is being used may be that's the reason
Ubuntu 20.04

@williams4564
Copy link

Thank you @smurfd your patch works on my Ubuntu 20.04 VM

a1eaiactaest added a commit to a1eaiactaest/qira that referenced this issue Aug 5, 2021
@a1eaiactaest
Copy link

works on Ubuntu 21.04 as well.

@a1eaiactaest
Copy link

I created a fork with all patches applied. if someone doesn't want to manually patch qira and qemu just clone a1eaiactaest/qira and normally run ./install.sh. i think everything should be fine.

@IdanBanani
Copy link

I created a fork with all patches applied. if someone doesn't want to manually patch qira and qemu just clone a1eaiactaest/qira and normally run ./install.sh. i think everything should be fine.

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
./install.sh: line 15: tracers/qemu/qira-i386: No such file or directory
building QEMU
./qemu_build.sh: line 10: ./configure: No such file or directory

DorianRudolph added a commit to DorianRudolph/qemu that referenced this issue Jul 23, 2022
DorianRudolph added a commit to DorianRudolph/qira that referenced this issue Jul 23, 2022
@IdanBanani
Copy link

@smurfd Do you have any idea if the integration (synchronization) with IDA requires an IDA PRO version (to use the plugin) to be installed on Linux or it is possible to use an IDA PRO on Windows which uses remote debugging connection?
Nevertheless, even without IDA this could be useful (too bad the project is kind of dead).

@smurfd
Copy link
Author

smurfd commented Oct 15, 2023

@smurfd Do you have any idea if the integration (synchronization) with IDA requires an IDA PRO version (to use the plugin) to be installed on Linux or it is possible to use an IDA PRO on Windows which uses remote debugging connection? Nevertheless, even without IDA this could be useful (too bad the project is kind of dead).

sorry i do not have a clue unfortunately. :(

@BelaBartok39
Copy link

I created a fork with all patches applied. if someone doesn't want to manually patch qira and qemu just clone a1eaiactaest/qira and normally run ./install.sh. i think everything should be fine.

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv ./install.sh: line 15: tracers/qemu/qira-i386: No such file or directory building QEMU ./qemu_build.sh: line 10: ./configure: No such file or directory

I'm having the same issue. Looks for ./configure file that does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants