Add a debug command

This commit is contained in:
2019-12-11 16:19:05 -05:00
parent ebe07f5c32
commit 3c8d6c62c5
10 changed files with 240 additions and 119 deletions

View File

@@ -1,11 +1,32 @@
#include <stdio.h>
#include "checkm8.h"
#include "payload.h"
#include <stdio.h>
#include <stdarg.h>
#include <execinfo.h>
void checkm8_debug(const char *format, ...)
{
#ifdef CHECKM8_LOGGING
void *traces[100];
int depth = backtrace(traces, 100) - 5;
for(int i = 0; i < depth; i++)
{
printf("\t");
}
va_list args;
va_start (args, format);
vprintf(format, args);
va_end(args);
#endif
}
int main()
{
struct pwned_device *dev = exploit_device();
if(dev == NULL)
if(dev == NULL || dev->status == DEV_NORMAL)
{
printf("Failed to exploit device\n");
return -1;