Skip to content
Snippets Groups Projects
  1. Oct 19, 2023
  2. Jun 08, 2023
  3. Apr 03, 2023
  4. Mar 27, 2023
  5. Feb 14, 2023
  6. Feb 09, 2023
  7. Feb 01, 2023
  8. Jan 06, 2023
  9. May 19, 2022
  10. May 04, 2022
    • Jason Hiser's avatar
      Update to fix calls for exception handling. · be161585
      Jason Hiser authored
      Fixed calls break exception handling, and largely aren't needed anymore.
      We were still "fixing" calls when it had no fallthrough instruction,
      assuming the call is used for something else.  Except that sometimes a
      "call _cxa_throw" ends a function/section and legitimately has no
      fallthrough.  And this breaks the exception handling.
      
      Testing this fix against the Zipr test suite to verify that it is OK
      on a large suite of programs.
      be161585
  11. Apr 27, 2022
  12. Apr 25, 2022
  13. Jan 10, 2022
  14. Jan 08, 2022
  15. Dec 31, 2021
  16. Dec 29, 2021
  17. Dec 09, 2021
  18. Nov 28, 2021
    • Jason Hiser's avatar
      Work through issues discovered in GT benchmark suite. · 5fc3e51a
      Jason Hiser authored
      * Update 68-sled code to be keystone friendly
      * Corrected spelling of getInstruction.  removed extraneous assert.
      * Disable should-pin-immediately because it interfers with sleds.
      * Remove assert from fix-calls about odd prefixing, just dont fix the call.  More of an issue with FII doing disassembly
      * Update switch->code discovery path to only happen if switch table is in text segment
      * fixed FII to do what the last commit said -- only disassembly when TABLE is in text.  also patched zipr to handle xbegin gracefully.
      * Disable verbose setting
      * Create lots of dbs instead of just a few
      5fc3e51a
  19. Nov 22, 2021
  20. Nov 21, 2021
  21. Nov 17, 2021
    • Jason Hiser's avatar
      Fixed issue with FII finding wrong cmp · c73569e8
      Jason Hiser authored
      Issue was related to intermediate set of the compare register.
      Leveraged backup_until's stopif argument to stop backup until sooner.
      
      Note: as indicated in code comment, single register/register move
      is common and could be used to improve accuracy.
      c73569e8
    • Jason Hiser's avatar
      Zipr/FII failure-to-tranform fixes · a86e408d
      Jason Hiser authored
      1) FII was finding the wrong cmp for switch tables.
      Removed the blind cmp and forced the cmp to use the proper
      register or not find a cmp.  Also changed the limit for a table
      size when no cmp is found from 2^32 to 255.
      
      2) Fixed an issue with zipr dollop layout where the size
      to layout 1 instruction + a trampoline was bigger than laying
      out two+ full dollops (because both dollops were short), but
      the dollops are disallowed from being coalesced.  The worst-size
      detector needed to account for non-coalescable dollops.
      a86e408d
  22. Nov 15, 2021
  23. Nov 11, 2021
  24. Sep 15, 2021
    • Jason Hiser's avatar
      Fix buggy unpinner when unpin stops early · b86172fe
      Jason Hiser authored
      Debugging code allows for one to binary-search the unpins.
      
      But a .dynsym, .got, etc. entry can be duplicated in it's own section
      or other sections.  Unpinning has to handle unpinning an instruction
      and deal with updating all tables properly.  Bug was found in handling
      of the unpin for .dynsym in this regard.  This patch fixes that bug.
      b86172fe
  25. Aug 12, 2021
  26. Aug 11, 2021
    • Jason Hiser's avatar
      Updates for detecting unoptimized switches better · 19d85e44
      Jason Hiser authored
      In particulate, an alternate version of switch tables
      was being mis-detected by FII.  In particular, switch
      tables were assumed to be size=4, but we found size!=4
      in sqlite (in particular, size=8).  And, I know windows
      binaries have size=1,2.
      
      Also fixed an issue where lea reg1, [reg2+reg3] assumed reg2/reg3
      had values (i.e., reg2 is the base address of a switch table),
      when reg3 might have the value.  Fixed the assumption by
      tracing both reg2+reg3.
      
      Some minor code cleanups.
      19d85e44
  27. Aug 10, 2021
  28. Jul 27, 2021
    • Jason Hiser's avatar
      ZS-86 issue in parsing dynsym section. · d678a840
      Jason Hiser authored
      The dynsym section is parsed by objdump/grep.  It's terrible and
      needs to be implemented in C++ to reduce dependence on external tools
      knowing what they are doing.
      
      In this case, the terrible pattern matching with grep caused a symbol
      defined in the binary to be missed, because `grep -v UND` was used
      to determine whether a symbol "mattered".  1) symbol names might have
      UND and get eliminated accidentally, but 2) (what really happened)
      was that the symbol was defined in a section without a "link" field
      in the dynsym section, thus objdump displayed the section name as UND
      and thus the code skipped the symbol.  Don't use objdump to parse ELF
      files!
      d678a840
  29. Jul 20, 2021
    • Jason Hiser's avatar
      Fix x86/32 issues for Ubuntu 20.04 · 8546a654
      Jason Hiser authored
      Rida: Parsing of .plt.sec section added for x86/64 ubuntu 20 needed to be
      updated to support x86/32 in ubuntu 20.
      
      Fix-calls: Thunk checks aged poorly.  Revived/fixed some of them.
      8546a654
  30. Jun 12, 2021
    • Jason Hiser's avatar
      Updated rodata scanner to skip pins without relocs in shared libs · 6e68317a
      Jason Hiser authored
      Shared libs need a reloc for a code pointer to live in rodata.
      I found in ffmpeg that many spurious pins were occuring because constant
      (particularly with relatively small values) data looked like code poitners
      (because the code's load point is address 0 in a shared library).
      
      To avoid these spuriosu pins, I extended the code pin algorithm
      to check isDLL() (which includes shared objects) and for a reloc
      before attempting to pin in the rodata.
      
      A perf. optimization verifies that it _might_ result in a pin
      before checking for a reloc, as checking for a reloc can be slow,
      while checking for a possible pin location is fast.
      6e68317a
  31. Apr 27, 2021
  32. Apr 26, 2021
    • Jason Hiser's avatar
      Update threshold for min. switch table size for ubuntu20. · 9f222161
      Jason Hiser authored
      Table size min was set to <=4 items, but readelf on ubuntu20
      had a switch table with exactly 4 elements.  This caused
      FII to miss the table size and subsequently include _many_ extra IBTs.
      Ultimately, Zipr failed by trying to 68-sled an entire function due to
      FII's failure.
      9f222161
Loading