1
0
Fork 0

Merge branch 'master' of github.com:x64dbg/x64dbg

This commit is contained in:
Mr. eXoDia 2015-04-25 19:18:36 +02:00
commit 8ef3cb257b
9 changed files with 21 additions and 12 deletions

View File

@ -48,7 +48,8 @@ extern "C" DLL_EXPORT bool _dbg_memwrite(duint addr, const unsigned char* src, d
extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
{
CriticalSectionLocker locker(LockMemoryPages);
SHARED_ACQUIRE(LockMemoryPages);
int pagecount = (int)memoryPages.size();
memset(memmap, 0, sizeof(MEMMAP));
memmap->count = pagecount;

View File

@ -236,9 +236,15 @@ bool BpEnumAll(BPENUMCALLBACK EnumCallback, const char* Module)
bpInfo.addr += ModBaseFromName(bpInfo.mod);
bpInfo.active = MemIsValidReadPtr(bpInfo.addr);
// Lock must be released due to callback sub-locks
SHARED_RELEASE()
// Execute the callback
if(!EnumCallback(&bpInfo))
callbackStatus = false;
// Restore the breakpoint map lock
SHARED_REACQUIRE(LockBreakpoints);
}
return callbackStatus;

View File

@ -32,7 +32,7 @@ bool CommentSet(uint Address, const char* Text, bool Manual)
comment.manual = Manual;
comment.addr = Address - ModBaseFromAddr(Address);
// Insert into list
// Key generated from module hash
const uint key = ModHashFromAddr(Address);
EXCLUSIVE_ACQUIRE(LockComments);

View File

@ -22,7 +22,7 @@ bool bListAllPages = false;
void MemUpdateMap(HANDLE hProcess)
{
CriticalSectionLocker locker(LockMemoryPages);
EXCLUSIVE_ACQUIRE(LockMemoryPages);
MEMORY_BASIC_INFORMATION mbi;
SIZE_T numBytes;
uint MyAddress = 0, newAddress = 0;

View File

@ -280,7 +280,7 @@ bool SymGetSourceLine(uint Cip, char* FileName, int* Line)
return true;
}
// Construct full path from .pdb path
// Construct full path from pdb path
IMAGEHLP_MODULE64 modInfo;
memset(&modInfo, 0, sizeof(IMAGEHLP_MODULE64));
modInfo.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
@ -288,11 +288,11 @@ bool SymGetSourceLine(uint Cip, char* FileName, int* Line)
if(!SafeSymGetModuleInfo64(fdProcessInfo->hProcess, Cip, &modInfo))
return false;
// Strip the full path, leaving only the file name
char* fileName = strrchr(modInfo.LoadedPdbName, '\\');
// Strip the name, leaving only the file directory
char* pdbFileName = strrchr(modInfo.LoadedPdbName, '\\');
if(fileName)
fileName[1] = '\0';
if(pdbFileName)
pdbFileName[1] = '\0';
// Copy back to the caller's buffer
strcpy_s(FileName, MAX_STRING_SIZE, modInfo.LoadedPdbName);

View File

@ -22,13 +22,11 @@ bool waitislocked(WAIT_ID id);
// Better, but requires VISTA+
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa904937%28v=vs.85%29.aspx
//
#define CriticalSectionLocker
#define locker(x) EXCLUSIVE_ACQUIRE(x)
#define EXCLUSIVE_ACQUIRE(Index) SectionLocker<SectionLock::##Index, false> __ThreadLock;
#define EXCLUSIVE_RELEASE() __ThreadLock.Unlock();
#define SHARED_ACQUIRE(Index) SectionLocker<SectionLock::##Index, true> __SThreadLock;
#define SHARED_REACQUIRE(Index) __SThreadLock.Lock();
#define SHARED_RELEASE() __SThreadLock.Unlock();
enum SectionLock

View File

@ -487,6 +487,8 @@ void CPUDisassembly::setupRightClickContextMenu()
connect(mCopySelectionNoBytes, SIGNAL(triggered()), this, SLOT(copySelectionNoBytes()));
mCopyAddress = new QAction("&Address", this);
mCopyAddress->setShortcutContext(Qt::WidgetShortcut);
this->addAction(mCopyAddress);
connect(mCopyAddress, SIGNAL(triggered()), this, SLOT(copyAddress()));
mCopyDisassembly = new QAction("Disassembly", this);
@ -582,6 +584,7 @@ void CPUDisassembly::refreshShortcutsSlot()
mSearchPattern->setShortcut(ConfigShortcut("ActionFindPattern"));
mEnableHighlightingMode->setShortcut(ConfigShortcut("ActionHighlightingMode"));
mCopySelection->setShortcut(ConfigShortcut("ActionCopy"));
mCopyAddress->setShortcut(ConfigShortcut("ActionCopyAddress"));
mSearchCommand->setShortcut(ConfigShortcut("ActionFind"));
}

View File

@ -260,6 +260,7 @@ Configuration::Configuration() : QObject()
defaultShortcuts.insert("ActionSetOneRegister", Shortcut(tr("Actions -> Set Register to One"), "1"));
defaultShortcuts.insert("ActionToggleRegisterValue", Shortcut(tr("Actions -> Toggle Register Value"), "Space"));
defaultShortcuts.insert("ActionCopy", Shortcut(tr("Actions -> Copy"), "Ctrl+C"));
defaultShortcuts.insert("ActionCopyAddress", Shortcut(tr("Actions -> Copy Address"), "Alt+INS"));
defaultShortcuts.insert("ActionCopySymbol", Shortcut(tr("Actions -> Copy Symbol"), "Ctrl+S"));
defaultShortcuts.insert("ActionLoadScript", Shortcut(tr("Actions -> Load Script"), "Ctrl+O"));
defaultShortcuts.insert("ActionReloadScript", Shortcut(tr("Actions -> Reload Script"), "Ctrl+R"));

View File

@ -6,4 +6,4 @@ copy ..\..\bin\%1\lib%1bridge.a Src\Bridge\
if %ERRORLEVEL%==0 set result=0
copy ..\..\bin\%1\%1bridge.lib Src\Bridge\
if %ERRORLEVEL%==0 set result=0
exit %result%
exit %result%