diff --git a/.gitignore b/.gitignore index 3a0d9dc..fcd1e7a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,8 @@ src/readpe src/rva2ofs src/peres src/plugins/build/ -tests/samples +tests/samples/* +!tests/samples/helloworld.exe tests/*.exe tests/*.bin tests/*.log diff --git a/tests/samples/helloworld.exe b/tests/samples/helloworld.exe new file mode 100755 index 0000000..5bee2b4 Binary files /dev/null and b/tests/samples/helloworld.exe differ diff --git a/tests/samples_src/Makefile b/tests/samples_src/Makefile new file mode 100644 index 0000000..a15c049 --- /dev/null +++ b/tests/samples_src/Makefile @@ -0,0 +1,14 @@ +# This is probably not standardized but WorksForMe +CC = x86_64-w64-mingw32-gcc +# Very generic test file +CFLAGS += -DNDEBUG -Oz -mtune=generic -march=x86-64 -s -Wl,-s -Wl,--gc-sections + +all: helloworld.exe + +.PHONY: all + +helloworld: helloworld.c + +%.exe: % + mv $@ ../samples/$@ + diff --git a/tests/samples_src/helloworld.c b/tests/samples_src/helloworld.c new file mode 100644 index 0000000..308d7b5 --- /dev/null +++ b/tests/samples_src/helloworld.c @@ -0,0 +1,43 @@ +/* + pev - the PE file analyzer toolkit + + helloworld.c - basic hello world program + + Copyright (C) 2013 - 2020 pev authors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. +*/ + +#include +#include + +int main(int argc, char *argv[]) { + printf("Hello World\n"); + return EXIT_SUCCESS; +} + diff --git a/tests/valgrind_pedis.sh b/tests/valgrind_pedis.sh index 4329a7b..c56cd29 100755 --- a/tests/valgrind_pedis.sh +++ b/tests/valgrind_pedis.sh @@ -1,7 +1,7 @@ #!/bin/bash prog="valgrind -q ../src/build/pedis" -samples=../support_files/samples/* +samples=../samples/* n=0 err=0 diff --git a/tests/valgrind_pepack.sh b/tests/valgrind_pepack.sh index 5693fa7..b8d575b 100755 --- a/tests/valgrind_pepack.sh +++ b/tests/valgrind_pepack.sh @@ -1,7 +1,7 @@ #!/bin/bash prog="valgrind -q ../src/build/pepack" -samples=../support_files/samples/* +samples=../samples/* n=0 err=0 diff --git a/tests/valgrind_pesec.sh b/tests/valgrind_pesec.sh index 34f52c0..1481965 100755 --- a/tests/valgrind_pesec.sh +++ b/tests/valgrind_pesec.sh @@ -1,7 +1,7 @@ #!/bin/bash prog="valgrind -q ../src/build/pesec" -samples=../support_files/samples/* +samples=../samples/* n=0 err=0 diff --git a/tests/valgrind_readpe.sh b/tests/valgrind_readpe.sh index bf7ab2d..c1f8fee 100755 --- a/tests/valgrind_readpe.sh +++ b/tests/valgrind_readpe.sh @@ -1,7 +1,7 @@ #!/bin/bash readpe="valgrind -q ../src/build/readpe" -samples=../support_files/samples/* +samples=../samples/* opts_noarg='-A -H -d -i' opts_arg[0]='-h dos' opts_arg[1]='-h coff'