-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtarget.cpp
34 lines (24 loc) · 866 Bytes
/
target.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
extern "C" {
#include <unistd.h>
}
#include "shared.h"
int main(int argc, char **argv) {
char password[256] = {};
LOG("This is the victim application.");
LOG("We have PID: " << getpid());
LOG("password buffer is at " << std::hex << reinterpret_cast<void *>(password) << std::dec);
LOG("Type in a password:");
std::cin >> password;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
LOG("Password contents:")
DumpHex(password, 256);
LOG("Start 'memaccess' and wait for instructions to resume the target.");
waitForEnter();
LOG("Password contents after probe install:")
DumpHex(password, 256);
LOG("Please stop the DTrace script now, then continue this application.");
waitForEnter();
LOG("Password contents after probe uninstall:")
DumpHex(password, 256);
return 0;
}