From 142e6dc20a8bc56da577b6ec6d4b16f0559f0827 Mon Sep 17 00:00:00 2001 From: "mr.exodia" Date: Sat, 23 Nov 2013 18:40:36 +0100 Subject: [PATCH] DBG: active bp fix --- x64_dbg_bridge/bridgemain.h | 1 + x64_dbg_dbg/_exports.cpp | 5 ++++- x64_dbg_dbg/breakpoint.cpp | 5 +++++ x64_dbg_dbg/breakpoint.h | 3 +-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/x64_dbg_bridge/bridgemain.h b/x64_dbg_bridge/bridgemain.h index d8b299c7..86a4238b 100644 --- a/x64_dbg_bridge/bridgemain.h +++ b/x64_dbg_bridge/bridgemain.h @@ -98,6 +98,7 @@ struct BRIDGEBP duint addr; bool enabled; bool singleshoot; + bool active; char name[MAX_BREAKPOINT_SIZE]; char mod[MAX_MODULE_SIZE]; unsigned short slot; diff --git a/x64_dbg_dbg/_exports.cpp b/x64_dbg_dbg/_exports.cpp index 9e3ee844..0ece03a6 100644 --- a/x64_dbg_dbg/_exports.cpp +++ b/x64_dbg_dbg/_exports.cpp @@ -332,10 +332,10 @@ extern "C" DLL_EXPORT int _dbg_getbplist(BPXTYPE type, BPMAP* bplist) unsigned short slot=0; for(int i=0; ihProcess, curBp.addr)) + curBp.active=true; strcpy(curBp.mod, list[i].mod); strcpy(curBp.name, list[i].name); curBp.singleshoot=list[i].singleshoot; diff --git a/x64_dbg_dbg/breakpoint.cpp b/x64_dbg_dbg/breakpoint.cpp index a5d7b9f4..09cffc33 100644 --- a/x64_dbg_dbg/breakpoint.cpp +++ b/x64_dbg_dbg/breakpoint.cpp @@ -3,6 +3,7 @@ #include "addrinfo.h" #include "sqlhelper.h" #include "console.h" +#include "memory.h" static BREAKPOINT bpall[1000]; static int bpcount=0; @@ -99,6 +100,7 @@ bool bpget(uint addr, BP_TYPE type, const char* name, BREAKPOINT* bp) sqlite3_finalize(stmt); return true; } + memset(bp, 0, sizeof(BREAKPOINT)); if(!modbase) { const char* mod=(const char*)sqlite3_column_text(stmt, 6); //mod @@ -126,6 +128,9 @@ bool bpget(uint addr, BP_TYPE type, const char* name, BREAKPOINT* bp) strcpy(bp->name, bpname_); else *bp->name=0; + //TODO: fix this + if(memisvalidreadptr(fdProcessInfo->hProcess, bp->addr)) + bp->active=true; sqlite3_finalize(stmt); return true; } diff --git a/x64_dbg_dbg/breakpoint.h b/x64_dbg_dbg/breakpoint.h index 470023b4..0e135c00 100644 --- a/x64_dbg_dbg/breakpoint.h +++ b/x64_dbg_dbg/breakpoint.h @@ -13,19 +13,18 @@ enum BP_TYPE }; //structs -#pragma pack(1) struct BREAKPOINT { uint addr; bool enabled; bool singleshoot; + bool active; short oldbytes; BP_TYPE type; DWORD titantype; char name[MAX_BREAKPOINT_SIZE]; char mod[32]; }; -#pragma pack() //typedefs typedef bool (*BPENUMCALLBACK)(const BREAKPOINT* bp);