This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | sudo apt install gcc-aarch64-linux-gnu | |
| sudo apt install crossbuild-essential-arm64 | |
| sudo apt install crossbuild-essential-armel | |
| sudo apt install gcc-arm-linux-gnueabi gcc-arm-none-eabi | |
| git clone https://sourceware.org/git/glibc.git | |
| cd glibc | |
| mkdir build | |
| cd build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def group_by_increment(iterable, group_incr, field_access=None, do_sort=True): | |
| """ | |
| Identify series of values that increment/decrement | |
| within a bounds @group_incr, grouping them into lists. | |
| The comparison to determine whether a value belongs in a group is | |
| if (prev_val + group_incr) <= curr_val: | |
| @iterable: iterable. This must be sorted for this function to work correctly. | |
| @group_incr: amount to be added to a value to determine | |
| @field_access: optional function to run on each element of the iterable to get | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import string | |
| def batch(it, sz): | |
| for i in range(0, len(it), sz): | |
| yield it[i:i+sz] | |
| def hexdump_str(bytevals, offset=0, bytes_per_line=16, bytegroupsize=2): | |
| # get max address size | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # hg update --clean # clean | |
| # hg purge | |
| hg clone https://gmplib.org/repo/gmp | |
| cd gmp | |
| ./.bootstrap | |
| mkdir build | |
| cd build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | sudo apt install gcc-aarch64-linux-gnu | |
| sudo apt install crossbuild-essential-arm64 | |
| sudo apt install crossbuild-essential-armel | |
| sudo apt install gcc-arm-linux-gnueabi gcc-arm-none-eabi | |
| git clone https://sourceware.org/git/glibc.git | |
| cd glibc | |
| mkdir build | |
| cd build | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | sudo apt install gcc-aarch64-linux-gnu | |
| sudo apt install crossbuild-essential-arm64 | |
| sudo apt install crossbuild-essential-armel | |
| sudo apt install gcc-arm-linux-gnueabi gcc-arm-none-eabi | |
| git clone git@github.com:strace/strace.git | |
| cd strace | |
| ./bootstrap | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | set height 0 | |
| set width 0 | |
| set $BINBASE = <YOUR-BINARY-BASE-HERE> | |
| # this works correctly for the linux kernel after printk started using a ringbuffer in he linux kernel | |
| set $PRINTLOC = 0x0 | |
| set $BP_record_print_text = $BINBASE + <offset-to-record_print_text> | |
| b *$BP_record_print_text | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| CODEQL_DB_DIR="$HOME/Documents/codeql_dbs" | |
| mkdir -p "$CODEQL_DB_DIR" | |
| LINUX_REPO_DIR="$HOME/cloned/linux" | |
| ORIGINAL_DIR=$(pwd) | |
| cd "$LINUX_REPO_DIR" | |
| make defconfig | |
| cd "$ORIGINAL_DIR" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # on remote target | |
| cat << EOF | base64 -d - | tar -Jxf - -O > exp && chmod +x exp && ./exp | |
| # on your machine (copies the base64 to your clipboard) | |
| xclip -sel c <(tar -cJO exp | base64 - | sed -e '$a\\nEOF\n') | |
| # Literally just paste the entirety of the compressed binary in base64 to the connected terminal |