MCPcopy Create free account
hub / github.com/KasperskyLab/hrtng / ct_keyboard

Function ct_keyboard

src/MicrocodeExplorer.cpp:568–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568static bool idaapi ct_keyboard(TWidget * /*v*/, int key, int shift, void *ud)
569{
570 sample_info_t* si = (sample_info_t*)ud;
571 if (shift == 0) {
572 switch (key)
573 {
574#if IDA_SDK_VERSION >= 740
575 case 'G':
576 {
577 qstring nBlock_or_addr;
578 if (!ask_str(&nBlock_or_addr, HIST_SEG, "[hrt] Go to block number or address..."))
579 return false;
580
581 lochist_entry_t hist;
582 get_custom_viewer_location(&hist, si->cv, false);
583 simpleline_place_t* newplace = (simpleline_place_t*)hist.place()->clone();
584
585 int nBlock = atoi(nBlock_or_addr.c_str());
586 ea_t ea = BADADDR;
587 if(atoea(&ea, nBlock_or_addr.c_str()) && is_mapped(ea) && si->md.ea2line.find(ea) != si->md.ea2line.end()) {
588 newplace->n = si->md.ea2line[ea];
589 } else if (si->md.block2line.find(nBlock) != si->md.block2line.end()) {
590 newplace->n = si->md.block2line[nBlock];
591 }
592 hist.set_place(newplace);
593 custom_viewer_jump(si->cv, hist, CVNF_JUMP);
594 return true;
595 }
596 break;
597#endif //IDA_SDK_VERSION >= 740
598 case 'I':
599 {
600 if (si->mba == NULL)
601 return false;
602 minsn_t* minsn;
603 if (InsGraphCheck(si, &minsn)) {
604 MicrocodeInstructionGraphContainer* mcg = new MicrocodeInstructionGraphContainer;
605 return mcg->Display(minsn, si);
606 }
607 }
608 case 'M':
609 if (si->mba != NULL) {
610 MicrocodeGraphContainer* mgc = new MicrocodeGraphContainer(si->mba);
611 mgc->Display(si);
612 return true;
613 }
614 break;
615 case IK_RETURN:
616 cv_jump(si);
617 return true;
618 default:
619 break;
620 }
621 }
622 return false;
623}
624
625static const custom_viewer_handlers_t handlers(

Callers

nothing calls this directly

Calls 3

InsGraphCheckFunction · 0.85
cv_jumpFunction · 0.85
endMethod · 0.80

Tested by

no test coverage detected