Skip to content

Commit fe942d9

Browse files
committed
[REFACT] Changed the info strings
1 parent 2fd654c commit fe942d9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pe2shc/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ BYTE* shellcodify(BYTE *my_exe, size_t exe_size, size_t &out_size, bool is64b)
3535
int res_id = is64b ? STUB64 : STUB32;
3636
BYTE *stub = peconv::load_resource_data(stub_size, res_id);
3737
if (!stub) {
38-
std::cout << "Stub not loaded" << std::endl;
38+
std::cout << "[-] Stub not loaded" << std::endl;
3939
return nullptr;
4040
}
4141
size_t ext_size = exe_size + stub_size;
@@ -57,20 +57,20 @@ bool is_supported_pe(BYTE *my_exe, size_t exe_size)
5757
{
5858
if (!my_exe) return false;
5959
if (!peconv::has_relocations(my_exe)) {
60-
std::cout << "The PE must have relocations!" << std::endl;
60+
std::cout << "[-] The PE must have relocations!" << std::endl;
6161
return false;
6262
}
6363
if (peconv::get_subsystem(my_exe) != IMAGE_SUBSYSTEM_WINDOWS_GUI) {
6464
std::cout << "[WARNING] This is a console application! The recommended subsystem is GUI." << std::endl;
6565
}
6666
IMAGE_DATA_DIRECTORY* dotnet_dir = peconv::get_directory_entry(my_exe, IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR);
6767
if (dotnet_dir) {
68-
std::cout << ".NET applications are not supported!" << std::endl;
68+
std::cout << "[-] .NET applications are not supported!" << std::endl;
6969
return false;
7070
}
7171
IMAGE_DATA_DIRECTORY* tls_dir = peconv::get_directory_entry(my_exe, IMAGE_DIRECTORY_ENTRY_TLS);
7272
if (tls_dir) {
73-
std::cout << "Applications with TLS callbacks are not supported!" << std::endl;
73+
std::cout << "[-] Applications with TLS callbacks are not supported!" << std::endl;
7474
return false;
7575
}
7676
return true;
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
104104
std::cout << "Reading module from: " << in_path << std::endl;
105105
BYTE *my_exe = peconv::load_file(in_path.c_str(), exe_size);
106106
if (!my_exe) {
107-
system("pause");
107+
std::cout << "[-] Could not read the input file!" << std::endl;
108108
return -1;
109109
}
110110
if (!is_supported_pe(my_exe, exe_size)) {
@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
121121
return -3;
122122
}
123123
if (peconv::dump_to_file(out_str.c_str(), ext_buf, ext_size)) {
124-
std::cout << "[+] Saved to file: " << out_str << std::endl;
124+
std::cout << "[+] Saved as: " << out_str << std::endl;
125125
}
126126
else {
127127
std::cout << "[-] Failed to save the output!" << std::endl;

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set_tests_properties(RunPe2Shc PROPERTIES DEPENDS runshc)
2222

2323
# 2) does conversion of the test application work
2424
add_test(ConvTestCase1 "${CMAKE_BINARY_DIR}//pe2shc.exe" "${CMAKE_BINARY_DIR}//test_case1.exe" "${CMAKE_BINARY_DIR}//test_case1.shc.exe")
25-
set_tests_properties(ConvTestCase1 PROPERTIES PASS_REGULAR_EXPRESSION "Saved to file:")
25+
set_tests_properties(ConvTestCase1 PROPERTIES PASS_REGULAR_EXPRESSION "Saved as:")
2626

2727
# 3) does converted application run properly
2828
add_test(RunTestCase1 "${CMAKE_BINARY_DIR}//runshc.exe" "${CMAKE_BINARY_DIR}//test_case1.shc.exe")

0 commit comments

Comments
 (0)