Пример #1
0
void MemoryTracer::initialize()
{

    m_tracer = static_cast<ExecutionTracer*>(s2e()->getPlugin("ExecutionTracer"));
    m_execDetector = static_cast<ModuleExecutionDetector*>(s2e()->getPlugin("ModuleExecutionDetector"));

    //Retrict monitoring to configured modules only
    m_monitorModules = s2e()->getConfig()->getBool(getConfigKey() + ".monitorModules");
    if (m_monitorModules && !m_execDetector) {
        s2e()->getWarningsStream() << "MemoryTracer: The monitorModules option requires ModuleExecutionDetector\n";
        exit(-1);
    }

    //Catch all accesses to the stack
    m_monitorStack = s2e()->getConfig()->getBool(getConfigKey() + ".monitorStack");

    //Catch accesses that are above the specified address
    m_catchAbove = s2e()->getConfig()->getInt(getConfigKey() + ".catchAccessesAbove");
    m_catchBelow = s2e()->getConfig()->getInt(getConfigKey() + ".catchAccessesBelow");

    //Whether or not to include host addresses in the trace.
    //This is useful for debugging, bug yields larger traces
    m_traceHostAddresses = s2e()->getConfig()->getBool(getConfigKey() + ".traceHostAddresses");

    //Start monitoring after the specified number of seconds
    bool hasTimeTrigger = false;
    m_timeTrigger = s2e()->getConfig()->getInt(getConfigKey() + ".timeTrigger", 0, &hasTimeTrigger);
    m_elapsedTics = 0;

    bool manualMode = s2e()->getConfig()->getBool(getConfigKey() + ".manualTrigger");

    m_monitorMemory = s2e()->getConfig()->getBool(getConfigKey() + ".monitorMemory");
    m_monitorPageFaults = s2e()->getConfig()->getBool(getConfigKey() + ".monitorPageFaults");
    m_monitorTlbMisses  = s2e()->getConfig()->getBool(getConfigKey() + ".monitorTlbMisses");

    s2e()->getDebugStream() << "MonitorMemory: " << m_monitorMemory << 
    " PageFaults: " << m_monitorPageFaults << " TlbMisses: " << m_monitorTlbMisses << '\n';

    if (hasTimeTrigger) {
        m_timerConnection = s2e()->getCorePlugin()->onTimer.connect(
                sigc::mem_fun(*this, &MemoryTracer::onTimer));
    } else if (manualMode) {
        s2e()->getCorePlugin()->onCustomInstruction.connect(
                sigc::mem_fun(*this, &MemoryTracer::onCustomInstruction));
    } else {
        enableTracing();
    }
}
Пример #2
0
void NewFileWizard::restoreSelectedIcon()
{
	QString selectedIconName = m_config->readEntry(getConfigKey(m_currentlyDisplayedType), DEFAULT_EMPTY_CAPTION);
	QIconViewItem *item = m_newDocumentWidget->templateIconView->findItem(selectedIconName);
	if(item) {
		m_newDocumentWidget->templateIconView->setSelected(item, true);
	}
}
Пример #3
0
void NewFileWizard::storeSelectedIcon()
{
	if(m_currentlyDisplayedType < 0) {
		return;
	}
	TemplateItem *selectedItem = getSelection();
	if (selectedItem) {
		m_config->writeEntry(getConfigKey(m_currentlyDisplayedType), selectedItem->name());
	}
}
Пример #4
0
    void UCoreUtils::initialize(){
      first = true;
      bool ok;
      system_map_file = s2e()
        ->getConfig()->getString(getConfigKey() + ".system_map_file",
                                 "", &ok);
      if(!ok){
        s2e()->getWarningsStream() << "No kernel.sym file provided. System.map is needed for UCoreMonitor to work properly. Quit.\n";
        exit(-1);
      }
      parseSymbolMap();

    }
Пример #5
0
void InterruptInjector::initialize()
{
    m_libcallMonitor = static_cast<LibraryCallMonitor*>(s2e()->getPlugin("LibraryCallMonitor"));
    m_symbolicHardware = static_cast<SymbolicHardware*>(s2e()->getPlugin("SymbolicHardware"));

    m_libcallMonitor->onLibraryCall.connect(
            sigc::mem_fun(*this, &InterruptInjector::onLibraryCall));

    m_hardwareId = s2e()->getConfig()->getString(getConfigKey() + ".hardwareId");

    m_deviceDescriptor = m_symbolicHardware->findDevice(m_hardwareId);
    if (!m_deviceDescriptor) {
        s2e()->getWarningsStream() << "InterruptInjector: you must specifiy a valid hardware id." << std::endl;
        exit(-1);
    }
}