[HN Gopher] Making our own executable packer, part 13, Thread-lo...
       ___________________________________________________________________
        
       Making our own executable packer, part 13, Thread-local storage
        
       Author : lukastyrychtr
       Score  : 35 points
       Date   : 2020-06-25 17:38 UTC (5 hours ago)
        
 (HTM) web link (fasterthanli.me)
 (TXT) w3m dump (fasterthanli.me)
        
       | platz wrote:
       | Would someone explain what the primary intent and current best-
       | case usages of thread-local storage are?
       | 
       | Is this more suited for certain languages than others?
        
         | Someone wrote:
         | https://en.wikipedia.org/wiki/Thread-local_storage mentions the
         | two most common uses: _errno_ (historically a global variable,
         | but on modern Unixes thread-local) and having separate threads
         | accumulate a value, to only merge them at the end, thus
         | decreasing contention for the merged value.
        
           | platz wrote:
           | > having separate threads accumulate a value, to only merge
           | them at the end, thus decreasing contention for the merged
           | value.
           | 
           | That sounds like just having scoped state in each thread that
           | isn't global.
        
       | drudru11 wrote:
       | Why is he making a packer?
        
         | chrisseaton wrote:
         | I don't understand what a 'packer' is - is it a linker?
        
           | rustybolt wrote:
           | From what I understand, it's something that 'packs' an
           | application, either to preserve space or to obfuscate it
           | (making it a little bit harder to reverse engineer it since
           | you have to peek at the extracted contents in the memory
           | instead of at the file contents).
           | 
           | So when you would run a packed application, there application
           | would essentially start to unpack an encrypted/compressed
           | blob of memory, and then jump to it once it's unpacked.
        
           | killercup wrote:
           | > I don't understand what a 'packer' is
           | 
           | You've found the right series of articles then!
        
             | chrisseaton wrote:
             | I read it - I did't find an explanation of what it was that
             | he was building, just how he was building it.
        
               | saagarjha wrote:
               | Think of it of decompression software bundled along with
               | a compressed version of the program you actually want to
               | run. So execution starts in the uncompression part, it
               | unzips all the code into memory, and then starts running
               | the program you actually cared about.
        
           | haecceity wrote:
           | It compresses executables.
        
         | scintill76 wrote:
         | > amos loves to tinker
        
         | killercup wrote:
         | Start at part 1.
         | 
         | No, he doesn't give you an answer, but you might just find it
         | interesting enough to no longer have the qusstion.
        
         | royjacobs wrote:
         | The better question is, why not?
        
       ___________________________________________________________________
       (page generated 2020-06-25 23:00 UTC)