Frida: Difference between revisions

imported>Mic92
improve automation of fhsuserenv
imported>Nix
m add Software/Applications subcategory
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[https://www.frida.re Frida] is a dynamic binary instrumentation framework.
[https://www.frida.re Frida] is a dynamic binary instrumentation framework.


== Getting it work on NixOS ==
== Using the genesis's NUR package ==
The project provides pre-compiled binaries that almost work out of the box (when installed via <code> pip install frida</code>)
 
Setup [https://github.com/nix-community/NUR NUR] as described.
Then install frida from genesis's repository:
 
<syntaxHighlight lang=console>
$ nix-shell -p nur.repos.genesis.frida-tools
nix-shell> frida-trace -i "recv*" firefox
</syntaxHighlight>
 
The python bindings are available via <code>nur.repos.genesis.python3Packages.frida</code>
Both frida and frida-tools packages are based on pypi, feel free to post a PR to add support for your platform to them.
 
== Using frida's own binaries ==
The project provides pre-compiled binaries that almost work out of the box (when installed via <code> pip install frida-tools</code>)
However at runtime it unpacks a helper called <code>frida-helper-64</code> that uses <code>/lib64/ld-linux-x86-64.so.2</code> as its link-loader.
However at runtime it unpacks a helper called <code>frida-helper-64</code> that uses <code>/lib64/ld-linux-x86-64.so.2</code> as its link-loader.
The error message will be similar to this one:
The error message will be similar to this one:
Line 37: Line 50:
       which
       which
       git
       git
       (python3.withPackages (p: [ p.setuptools ]))
       (python3.withPackages (p: [ p.setuptools p.wheel ]))
       nodejs
       nodejs
       perl
       perl
Line 46: Line 59:
     profile = ''
     profile = ''
       export hardeningDisable=all
       export hardeningDisable=all
      export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
       # initialize sdk
       # initialize sdk
       make
       make
Line 51: Line 65:
       (cd frida-gum/bindings/gumjs && yarn install)
       (cd frida-gum/bindings/gumjs && yarn install)


       # for frida-python egg
       # for frida-python wheel
       export FRIDA_VERSION=$(git describe --tags)
       export FRIDA_VERSION=$(git describe --tags)
       export FRIDA_EXTENSION=$(realpath build/frida-linux-x86_64/${python3.sitePackages}/_frida.so)
       export FRIDA_EXTENSION=$(realpath build/frida-linux-x86_64/${python3.sitePackages}/_frida.so)
      export SOURCE_DATE_EPOCH="315532800"
     '';
     '';
   };
   };
Line 62: Line 77:


<syntaxHighlight lang=console>
<syntaxHighlight lang=console>
$  make python-64
$  make python-linux-x86_64
</syntaxHighlight>
</syntaxHighlight>


Line 68: Line 83:


<syntaxHighlight lang=console>
<syntaxHighlight lang=console>
$ cd frida-python/src/
$ cd frida-python
$ python setup.py bdist_egg
$ python setup.py bdist_wheel
$ easy_install dist/frida-*.egg
$ pip install dist/frida-*.whl
</syntaxHighlight>
</syntaxHighlight>


Mic92 has an [https://github.com/Mic92/nur-packages/blob/master/frida-python/default.nix expression] that provides a pre-compiled version of frida using the compiled egg as shown.
[[Category:Applications]]