File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,17 @@ cmake_minimum_required ( VERSION 3.0 )
3
3
# replace "peconv_project" by your own project name:
4
4
project ( peconv_project )
5
5
6
-
7
6
# libs
8
7
# modules:
9
8
set ( M_PARSER "libpeconv/libpeconv" )
10
9
10
+ option (PECONV_UNICODE "Enable Unicode" OFF )
11
+
12
+ # enable unicode support
13
+ if (PECONV_UNICODE)
14
+ add_definitions (-DUNICODE -D_UNICODE)
15
+ endif ()
16
+
11
17
# modules paths:
12
18
set (PECONV_DIR "${CMAKE_SOURCE_DIR} /${M_PARSER} " CACHE PATH "PEConv main path" )
13
19
add_subdirectory ( ${PECONV_DIR} )
Original file line number Diff line number Diff line change 1
1
#include < Windows.h>
2
2
#include < iostream>
3
+ #include < tchar.h>
3
4
4
5
#include < peconv.h> // include libPeConv header
5
6
6
7
/* *
7
8
A demo of a basic manual PE loader - you can use it as a starting point for your own project,
8
9
or delete it and start from the scratch
9
10
*/
10
- int load_and_run (LPCSTR pe_path)
11
+ int load_and_run (LPCTSTR pe_path)
11
12
{
12
13
// manually load the PE file using libPeConv:
13
14
size_t v_size = 0 ;
@@ -41,12 +42,12 @@ int load_and_run(LPCSTR pe_path)
41
42
return new_main ();
42
43
}
43
44
44
- int main (int argc, char * argv[])
45
+ int _tmain (int argc, LPTSTR argv[])
45
46
{
46
47
if (argc < 2 ) {
47
48
std::cout << " Args: <path to the exe>" << std::endl;
48
49
return 0 ;
49
50
}
50
- const LPCSTR pe_path = argv[1 ];
51
+ const LPTSTR pe_path = argv[1 ];
51
52
return load_and_run (pe_path);
52
53
}
You can’t perform that action at this time.
0 commit comments