Skip to content

Instantly share code, notes, and snippets.

@oxagast
Last active December 8, 2021 01:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/87a4fd93a11c8bd9f0d5f20cf3c6e434 to your computer and use it in GitHub Desktop.
Save oxagast/87a4fd93a11c8bd9f0d5f20cf3c6e434 to your computer and use it in GitHub Desktop.
Dissassembles all binaries in a directory and sorts by most used processor instructions
# finds and sorts most commonly used processor instructions from raw objdump dissassembley.
objdump -D /bin/bash | grep -E " .{6,}:" | grep -v '(bad)' | cut -d ':' -f 2 | sort -b -t, -nk2 | uniq -c | sort -n -r | grep -E "\s+[[:digit:]]+\s+.{12,}$" | head -n 15
@oxagast
Copy link
Author

oxagast commented Dec 8, 2021

  38013         00 00                   add    %al,(%rax)
   2665         c3                      retq   
   2523         20 20                   and    %ah,(%rax)
   2511         6e                      outsb  %ds
   2493         85 c0                   test   %eax,%eax
   2421         6c                      insb   (%dx),%es
   2231         f3 0f 1e fa             endbr64 
   2188         31 c0                   xor    %eax,%eax
   2086         5f                      pop    %rdi
   2062         6f                      outsl  %ds
   2061         01 00                   add    %eax,(%rax)
   2034         08 00                   or     %al,(%rax)
   1763         5d                      pop    %rbp
   1523         5b                      pop    %rbx
   1523         48 85 c0                test   %rax,%rax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment