-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from lapla-cogito/got
GOT overwrite
- Loading branch information
Showing
8 changed files
with
307 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// gcc got.c -no-pie -o got | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
|
||
int secret(char* s) { | ||
if (s[0] == 's' && s[1] == 'e' && s[2] == 'c' && s[3] == 'r' && s[4] == 'e' && s[5] == 't') { | ||
puts("secret function called"); | ||
} | ||
return 0; | ||
} | ||
|
||
int main() { | ||
int x=system("secret"); | ||
} |
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,28 @@ | ||
#[derive(thiserror::Error, Debug)] | ||
pub enum Error { | ||
#[error("invalid option: {0}")] | ||
InvalidOption(&'static str), | ||
|
||
#[error("failed to open file: {0}")] | ||
OpenFile(std::io::Error), | ||
|
||
#[error("failed to create file: {0}")] | ||
CreateFile(std::io::Error), | ||
|
||
#[error("invalid ELF magic")] | ||
InvalidMagic, | ||
|
||
#[error("failed to mmap: {0}")] | ||
Mmap(std::io::Error), | ||
|
||
#[error("failed in I/O operation: {0}")] | ||
Io(std::io::Error), | ||
|
||
#[error("failed to process obfuscation: {0}")] | ||
Obfuscation(&'static str), | ||
|
||
#[error("not found: {0}")] | ||
NotFound(String), | ||
} | ||
|
||
pub type Result<T> = std::result::Result<T, Error>; |
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
Oops, something went wrong.