Skip to content

Commit

Permalink
More PT decoding options
Browse files Browse the repository at this point in the history
  • Loading branch information
ifratric committed Feb 4, 2019
1 parent 7dd4dbb commit d79c71f
Show file tree
Hide file tree
Showing 15 changed files with 797 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if (${INTELPT})

SET(PT_ADDITIONAL_SOURCES
winaflpt.c
ptdecode.c
third_party/processor-trace/libipt/src/pt_cpu.c
third_party/processor-trace/libipt/src/windows/pt_cpuid.c
)
Expand Down
12 changes: 11 additions & 1 deletion afl-fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -4019,6 +4019,10 @@ static void maybe_delete_out_dir(void) {
if(delete_subdirectories(fn)) goto dir_cleanup_failed;
ck_free(fn);

fn = alloc_printf("%s\\ptmodules", out_dir);
if (delete_files(fn, NULL)) goto dir_cleanup_failed;
ck_free(fn);

OKF("Output dir cleanup successful.");

/* Wow... is that all? If yes, celebrate! */
Expand Down Expand Up @@ -7172,6 +7176,10 @@ static void setup_dirs_fds(void) {
if (mkdir(tmp)) PFATAL("Unable to create '%s'", tmp);
ck_free(tmp);

tmp = alloc_printf("%s\\ptmodules", out_dir);
if (mkdir(tmp)) PFATAL("Unable to create '%s'", tmp);
ck_free(tmp);

}


Expand Down Expand Up @@ -7917,7 +7925,9 @@ int main(int argc, char** argv) {

if (use_intelpt) {
#ifdef INTELPT
int pt_options = pt_init(argc - optind, argv + optind);
char *modules_dir = alloc_printf("%s\\ptmodules", out_dir);
int pt_options = pt_init(argc - optind, argv + optind, modules_dir);
ck_free(modules_dir);
if (!pt_options) usage(argv[0]);
optind += pt_options;
#endif
Expand Down
Binary file modified bin32/afl-fuzz.exe
Binary file not shown.
Binary file modified bin32/libipt.dll
Binary file not shown.
Binary file added bin32/winaflpt-debug.exe
Binary file not shown.
Binary file modified bin64/afl-fuzz.exe
Binary file not shown.
Binary file modified bin64/libipt.dll
Binary file not shown.
Binary file added bin64/winaflpt-debug.exe
Binary file not shown.
Binary file modified ipttool.c
Binary file not shown.
4 changes: 2 additions & 2 deletions ipttool.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BOOL EnableAndValidateIptServices(VOID);
BOOL ConfigureBufferSize(_In_ PWCHAR pwszSize, _Inout_ PIPT_OPTIONS pOptions);
BOOL ConfigureTraceFlags(_In_ PWCHAR pwszFlags, _Inout_ PIPT_OPTIONS pOptions);
BOOL ConfigureBufferSize(_In_ DWORD dwSize, _Inout_ PIPT_OPTIONS pOptions);
BOOL ConfigureTraceFlags(_In_ DWORD dwFlags, _Inout_ PIPT_OPTIONS pOptions);
PIPT_TRACE_DATA GetIptTrace(HANDLE hProcess);
Loading

0 comments on commit d79c71f

Please sign in to comment.