viper-framework / viper

Binary analysis and management framework
Other
1.54k stars 353 forks source link

More strings module flags: r2 and xor #757

Closed xorhex closed 5 years ago

xorhex commented 5 years ago

These are two commands I've been using for awhile in my local viper instance and wanted to share.

Added two features to the strings module.

  1. -x which accepts a single byte xor key that the data is xor'ed with before any filters are applied (-H, -N, etc.). The idea here is to take the key found from the xor command and apply it to strings.

  2. -r added as a second string extraction method using r2. Sometimes r2 finds strings not found by the default string extraction method and sometimes the default finds strings r2 does not find. The -x flag does not work with the -r flag.

The modification to objects.py is to support xor operation in strings. Let me know if I should do this differently.

codecov-io commented 5 years ago

Codecov Report

Merging #757 into master will decrease coverage by 0.05%. The diff coverage is 22.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #757      +/-   ##
==========================================
- Coverage   44.88%   44.82%   -0.06%     
==========================================
  Files         131      131              
  Lines       14476    14513      +37     
==========================================
+ Hits         6497     6505       +8     
- Misses       7979     8008      +29
Impacted Files Coverage Δ
viper/modules/strings.py 21.91% <17.14%> (-1.08%) :arrow_down:
viper/common/objects.py 75% <60%> (-0.43%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 967c7d8...2bf8cc3. Read the comment docs.

botherder commented 5 years ago

These look good to me. Thanks!