1+ #include < map>
2+ #include < set>
3+ #include < queue>
14#include < inttypes.h>
25#include " binaryninjaapi.h"
36#include " binaryninjacore.h"
@@ -235,7 +238,8 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
235238 size_t maxLen = data->Read (opcode, location.address , location.arch ->GetMaxInstructionLength ());
236239 if (maxLen == 0 )
237240 {
238- // string text = fmt::bnformat("Could not read instruction at {:#x}", location.address);
241+ string text = fmt::format (" Could not read instruction at {:#x}" , location.address );
242+ function.CreateAutoAddressTag (location.arch , location.address , " Invalid Instruction" , text, true );
239243 if (location.arch ->GetInstructionAlignment () == 0 )
240244 location.address ++;
241245 else
@@ -248,8 +252,8 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
248252 info.delaySlots = delaySlotCount;
249253 if (!location.arch ->GetInstructionInfo (opcode, location.address , maxLen, info))
250254 {
251- // string text = fmt::bnformat ("Could not get instruction info at {:#x}", location.address);
252- // function-> CreateAutoAddressTag(location.arch, location.address, "Invalid Instruction", text, true);
255+ string text = fmt::format (" Could not get instruction info at {:#x}" , location.address );
256+ function. CreateAutoAddressTag (location.arch , location.address , " Invalid Instruction" , text, true );
253257 if (location.arch ->GetInstructionAlignment () == 0 )
254258 location.address ++;
255259 else
@@ -261,8 +265,8 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
261265 // The instruction is invalid if it has no length or is above maximum length
262266 if ((info.length == 0 ) || (info.length > maxLen))
263267 {
264- // string text = fmt::bnformat ("Instruction of invalid length at {:#x}", location.address);
265- // function-> CreateAutoAddressTag(location.arch, location.address, "Invalid Instruction", text, true);
268+ string text = fmt::format (" Instruction of invalid length at {:#x}" , location.address );
269+ function. CreateAutoAddressTag (location.arch , location.address , " Invalid Instruction" , text, true );
266270 if (location.arch ->GetInstructionAlignment () == 0 )
267271 location.address ++;
268272 else
@@ -278,8 +282,8 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
278282 ((!IsOffsetCodeSemanticsFast (data, readOnlySections, dataExternSections, instrEnd) && IsOffsetCodeSemanticsFast (data, readOnlySections, dataExternSections,location.address )) ||
279283 (!data->IsOffsetBackedByFile (instrEnd) && data->IsOffsetBackedByFile (location.address ))))
280284 {
281- // string text = fmt::bnformat ("Instruction at {:#x} straddles a non-code section", location.address);
282- // function-> CreateAutoAddressTag(location.arch, location.address, "Invalid Instruction", text, true);
285+ string text = fmt::format (" Instruction at {:#x} straddles a non-code section" , location.address );
286+ function. CreateAutoAddressTag (location.arch , location.address , " Invalid Instruction" , text, true );
283287 if (location.arch ->GetInstructionAlignment () == 0 )
284288 location.address ++;
285289 else
@@ -420,8 +424,8 @@ void Architecture::DefaultAnalyzeBasicBlocks(Function& function, BNBasicBlockAna
420424 if (!fastPath && !IsOffsetCodeSemanticsFast (data, readOnlySections, dataExternSections, target.address ) &&
421425 IsOffsetCodeSemanticsFast (data, readOnlySections, dataExternSections, location.address ))
422426 {
423- // string message = fmt::bnformat ("Non-code call target {:#x}", target.address);
424- // function-> CreateAutoAddressTag(target.arch, location.address, "Non-code Branch", message, true);
427+ string message = fmt::format (" Non-code call target {:#x}" , target.address );
428+ function. CreateAutoAddressTag (target.arch , location.address , " Non-code Branch" , message, true );
425429 break ;
426430 }
427431
0 commit comments