Skip to content

Instantly share code, notes, and snippets.

@ice799
Created November 17, 2011 19:43
Show Gist options
  • Select an option

  • Save ice799/1374231 to your computer and use it in GitHub Desktop.

Select an option

Save ice799/1374231 to your computer and use it in GitHub Desktop.

Revisions

  1. ice799 created this gist Nov 17, 2011.
    20 changes: 20 additions & 0 deletions stupid.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    diff --git a/src/elfcore.c b/src/elfcore.c
    index 4304770..598f5dc 100644
    --- a/src/elfcore.c
    +++ b/src/elfcore.c
    @@ -856,13 +856,8 @@ static int CreateElfCore(void *handle,
    mappings[i].start_address += zeros;
    }

    - /* Do not write contents for memory segments that are read-only */
    - if ((mappings[i].flags & (PF_ANONYMOUS|PF_W)) == 0) {
    - mappings[i].write_size = 0;
    - } else {
    - mappings[i].write_size = mappings[i].end_address
    - - mappings[i].start_address;
    - }
    + mappings[i].write_size = mappings[i].end_address
    + - mappings[i].start_address;

    /* Remove mapping, if it was not readable, or completely zero
    * anyway. The former is usually the case of stack guard pages, and