File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,18 +21,16 @@ int main(int argc, char *argv[])
2121 size_t exe_size = 0 ;
2222 char * in_path = argv[1 ];
2323
24- std::cout << " Reading module from: " << in_path << std::endl;
24+ std::cout << " [*] Reading module from: " << in_path << std::endl;
2525 BYTE *my_exe = peconv::load_file (in_path, exe_size);
2626 if (!my_exe) {
27- system ( " pause " ) ;
27+ std::cout << " [-] Loading file failed " << std::endl ;
2828 return -1 ;
2929 }
30-
31- std::cout << " Test it!" << std::endl;
3230 BYTE *test_buf = peconv::alloc_aligned (exe_size, PAGE_EXECUTE_READWRITE );
3331 if (!test_buf) {
3432 peconv::free_file (my_exe);
35- system ( " pause " ) ;
33+ std::cout << " [-] Allocating buffer failed " << std::endl ;
3634 return -2 ;
3735 }
3836 // copy file content into executable buffer:
@@ -42,10 +40,12 @@ int main(int argc, char *argv[])
4240 peconv::free_file (my_exe);
4341 my_exe = nullptr ;
4442
43+ std::cout << " [*] Running the shellcode:" << std::endl;
4544 // run it:
4645 int (*my_main)() = (int (*)()) ((ULONGLONG )test_buf);
4746 int ret_val = my_main ();
4847
4948 peconv::free_aligned (test_buf, exe_size);
49+ std::cout << " [+] The shellcode finished with a return value: " << std::hex << ret_val << std::endl;
5050 return ret_val;
5151}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ set_tests_properties(RunPe2Shc PROPERTIES DEPENDS pe2shc)
1616
1717# 1) does runshc run
1818add_test (RunRunShc "${CMAKE_BINARY_DIR } //runshc.exe" "${CMAKE_BINARY_DIR } //demo.shc.exe" )
19- set_tests_properties (RunRunShc PROPERTIES PASS_REGULAR_EXPRESSION "Test it " )
19+ set_tests_properties (RunRunShc PROPERTIES PASS_REGULAR_EXPRESSION "Running the shellcode: " )
2020set_tests_properties (RunPe2Shc PROPERTIES DEPENDS pe2shc)
2121set_tests_properties (RunPe2Shc PROPERTIES DEPENDS runshc)
2222
You can’t perform that action at this time.
0 commit comments