forked from PapaGateau/override
-
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.
- Loading branch information
Jean-Baptiste Terrazzoni
committed
Feb 24, 2020
1 parent
99b00a8
commit a9f883e
Showing
1 changed file
with
25 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 1,36 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/ptrace.h> | ||
|
||
int auth(login_str ebp 0x8, Serial ebp 0xc) | ||
{ | ||
int login_len; // EBP - 0xc | ||
|
||
login_str[strcspn('\n', login_str)] = 0; | ||
login_len = strnlen(login_str, 32); | ||
|
||
if (login_len != 5) { | ||
return 1; | ||
} | ||
|
||
if (ptrace(0, 0, 1, 0) == 0xffffffff) { // ??? | ||
puts("\e[32m.---------------------------."); | ||
puts("\e[31m| !! TAMPERING DETECTED !! |"); | ||
puts("\e[32m.---------------------------."); | ||
return 1; | ||
} | ||
|
||
int value; // EBP - 0x10 | ||
value = (int) (login_str[3]) ^ 0x1337 0x5eeded; | ||
|
||
} | ||
|
||
int main() | ||
{ | ||
fgets(esp 0x2c, 32, stdin); Login | ||
|
||
scanf(%u, esp 0x28); Serial | ||
|
||
if (auth(Login, Serial)) | ||
if (!auth(Login, Serial)) | ||
system("/bin/sh"); | ||
} | ||
|
||
auth(Login ebp 0x8, Serial ebp 0xc) | ||
{ | ||
int temp; | ||
Login[strcspn('\n', Login)] = '\0'; Replaces '\n' with '\0' | ||
temp = strnlen(Login, 32); | ||
|
||
} |