engineering code obfuscation
play

Engineering Code Obfuscation ISSISP 2017 - Tamperproofing Christian - PowerPoint PPT Presentation

Engineering Code Obfuscation ISSISP 2017 - Tamperproofing Christian Collberg Department of Computer Science University of Arizona http://collberg.cs.arizona.edu collberg@gmail.com Supported by NSF grants 1525820 and 1318955 and by the


  1. Engineering Code Obfuscation ISSISP 2017 - Tamperproofing Christian Collberg Department of Computer Science University of Arizona http://collberg.cs.arizona.edu collberg@gmail.com Supported by NSF grants 1525820 and 1318955 and by the private foundation that shall not be named

  2. What is Tamperproofing?

  3. Bob wants to modify the program binary so that it does something different than we want: •remove functionality (license check) •change data (password, cryptographic key) •add functionality (print, save game) Tamperproofing the code makes it stop working if Bob changes as little as a byte of the binary!

  4. Tamperproofing has to do two things: 1. detect tampering 2. respond to tampering Essentially: if (tampering-detected()) respond-to-tampering() but this is too unstealthy!

  5. int foo() { … … … … } Detect tampering int main () { if ( foo-has-changed-in-any-way()) crash the program phone home Respond refuse to run to tampering run slower make wrong results foo(); }

  6. int hash (addr_t addr,int words){ int h = *addr; int foo() { … … … … for(int i=1; i<words; i++) { \ } addr++; h ^= *addr; } return h; Detect } tampering int main () { if ( hash(foo,1000) != 0x4C49F346) crash the program phone home Respond refuse to run to tampering run slower make wrong results foo(); }

  7. int foo () { int foo () { int foo () { if ( today > “Aug 17,2016” ){ if ( false ){ if (today > “Aug 17,2016”){ printf(“License expired!”); printf(“License expired!”); printf(“License expired!”); abort; abort; abort; } } } check(){ } } } if (hash(foo)!=42) abort() }

  8. int foo() { int foo_copy() { … … … … … … … … } } Repair foo!!! Checker 1 if ( foo-has-changed-in-any-way()) int foo_copy() { int foo() { copy … … … … … … … … } }

  9. Checker 2 Repair if ( foo-checker1-changed()) Checker 1! copy Checker1 Checker1_copy Checker 1 if ( foo-has-changed-in-any-way()) int foo_copy() { int foo() { copy … … … … … … … … } }

  10. Code Checker block Checker Repair Checker Code block Code Repair block Repair

  11. uint32 Skypes_hash_function () { addr_t addr =(addr_t)((uint32)addr ^(uint32)addr); addr = (addr_t)((uint32) addr + 0 x688E5C); uint32 hash = 0x320E83 ^ 0x1C4C4 ; int bound = hash + 0 xFFCC5AFD ; do { uint32 data =*((addr_t)((uint32)addr + 0x10)); goto b1; asm volatile (". byte 0x19"); b1: hash = hash ⊕ data ; addr -= 1; bound --; } while (bound !=0); goto b2; asm volatile (".byte 0x73"); b2: goto b3; asm volatile (".word 0xC8528417,…”); b3: hash -= 0x4C49F346; return hash; }

  12. Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend