-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new ELF linking type for statically linked PIE binaries
- Loading branch information
Showing
6 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Prints the dynamic symbol names with the corresponding PLT address | ||
* Same as plt_dump2, but uses the plt iterator. | ||
*/ | ||
|
||
#define _GNU_SOURCE | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <elf.h> | ||
#include <sys/types.h> | ||
#include <search.h> | ||
#include <sys/time.h> | ||
#include "../include/libelfmaster.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
elfobj_t obj; | ||
elf_error_t error; | ||
|
||
if (argc < 2) { | ||
printf("Usage: %s <binary>\n", argv[0]); | ||
exit(EXIT_SUCCESS); | ||
} | ||
if (elf_open_object(argv[1], &obj, ELF_LOAD_F_FORENSICS, &error) == false) { | ||
fprintf(stderr, "%s\n", elf_error_msg(&error)); | ||
return -1; | ||
} | ||
if (elf_linking_type(&obj) == ELF_LINKING_STATIC_PIE) { | ||
printf("Executable is a PIE statically linked executable\n"); | ||
} else { | ||
printf("Executable is not a static PIE linked executable\n"); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters