MCPcopy Create free account
hub / github.com/beefytech/Beef / DisassembleAtRaw

Method DisassembleAtRaw

IDEHelper/WinDebugger.cpp:12195–12348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12193}
12194
12195String WinDebugger::DisassembleAtRaw(intptr inAddress)
12196{
12197 addr_target address = (addr_target)inAddress;
12198
12199 const int addrBorder = 1024;
12200
12201 for (int offset = 0; offset < 8; offset++)
12202 {
12203 String result;
12204 bool addOffset = true;
12205 bool hadAddr = false;
12206
12207 DbgModule* dbgModule = mDebugTarget->FindDbgModuleForAddress(address);
12208 DbgModuleMemoryCache* memCache = NULL;
12209 defer
12210 (
12211 if (dbgModule == NULL)
12212 delete memCache;
12213 );
12214
12215 if ((dbgModule != NULL) && (dbgModule->mOrigImageData == NULL))
12216 dbgModule = NULL;
12217
12218 result += "R\n"; // Raw
12219
12220 addr_target addrStart = address;
12221 if (dbgModule != NULL)
12222 {
12223 dbgModule->ParseSymbolData();
12224 memCache = dbgModule->mOrigImageData;
12225 addrStart = BF_MAX((addr_target)dbgModule->mImageBase, address - addrBorder - offset);
12226 }
12227 else
12228 {
12229 memCache = new DbgModuleMemoryCache(addrStart & (4096 - 1), 4096 * 2);
12230 }
12231
12232 if (memCache->mAddr == 0)
12233 return "";
12234
12235 //addr_target imageBase = dbgModule->mImageBase;
12236 //int imageSize = dbgModule->mImageSize;
12237
12238 addr_target dataAddr = addrStart;
12239 addr_target addrEnd = addrStart + addrBorder * 2 + 16;
12240
12241 while (dataAddr < addrEnd)
12242 {
12243 if (dataAddr == address)
12244 hadAddr = true;
12245 if (dataAddr > address)
12246 {
12247 if (!hadAddr)
12248 {
12249 if (offset == 7)
12250 {
12251 dataAddr = address;
12252 }

Callers

nothing calls this directly

Calls 13

FindSymbolAtMethod · 0.80
GetLinkedModuleMethod · 0.80
ifFunction · 0.50
ParseSymbolDataMethod · 0.45
emptyMethod · 0.45
DecodeMethod · 0.45
ReadMethod · 0.45
GetLengthMethod · 0.45
InstructionToStringMethod · 0.45
IsCallMethod · 0.45
IsBranchMethod · 0.45

Tested by

no test coverage detected