Add test program to test random start addresses.

This commit is contained in:
Ernie Pasveer
2022-07-28 19:25:59 -05:00
parent 7b56132a35
commit 1ca0569aa3
4 changed files with 41 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
hellostart
+21
View File
@@ -0,0 +1,21 @@
# This is the default target, which will be built when
# you invoke make
.PHONY: all
all: hellostart
# This rule tells make how to build hellostart from hellostart.cpp
hellostart: hellostart.cpp
g++ -g -o hellostart hellostart.cpp
# This rule tells make to copy hellostart to the binaries subdirectory,
# creating it if necessary
.PHONY: install
install:
mkdir -p binaries
cp -p hellostart binaries
# This rule tells make to delete hellostart and hellostart.o
.PHONY: clean
clean:
rm -f hellostart hellostart.o
+3
View File
@@ -0,0 +1,3 @@
Simple HelloWorld program to test random start addresses in seer/gdb.
+16
View File
@@ -0,0 +1,16 @@
#include <string>
#include <iostream>
int main (int argc, char** argv) {
int i=0;
for (i=0; i<argc; i++) {
std::cout << "XX: " << i << " " << argv[i] << std::endl;
}
std::cout << "Address of 'i' == " << &i << std::endl;
return 0;
}