TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

An Evil Copy: How the Loader Betrays You [pdf]

2 pointsby secureover 8 years ago

1 comment

CalChrisover 8 years ago
TL;DR <i>when instantiating a process, constant external variables that are referenced in executables are forcefully relocated to a writable memory segment without warning</i><p>So my first reaction was to add a check to see that my constants are in fact mapped read-only.<p><pre><code> const int constant_int = 42; </code></pre> It&#x27;d be nice to validate this read-only property and refuse to run but while <i>mprotect()</i> will set the memory protections there seems to be no associated getter. How do you check this in a reasonably portably manner?