Esempio n. 1
0
void ObjectivesEditor::_onEditLogic()
{
	MissionLogicDialog _dialog(getRefPtr(), *_curEntity->second);
	_dialog.show();

	refreshObjectivesList();
}
Esempio n. 2
0
void ObjectivesEditor::_onEditObjConditions()
{
	ObjectiveConditionsDialog _dialog(getRefPtr(), *_curEntity->second);
	_dialog.show();

	refreshObjectivesList();
}
StimResponseEditor::StimResponseEditor() :
	gtkutil::BlockingTransientWindow(_(WINDOW_TITLE), GlobalMainFrame().getTopLevelWindow()),
	_entity(NULL),
	_stimEditor(Gtk::manage(new StimEditor(_stimTypes))),
	_responseEditor(Gtk::manage(new ResponseEditor(getRefPtr(), _stimTypes))),
	_customStimEditor(Gtk::manage(new CustomStimEditor(_stimTypes)))
{
	// Set the default border width in accordance to the HIG
	set_border_width(12);
	set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);

	signal_key_press_event().connect(sigc::mem_fun(*this, &StimResponseEditor::onWindowKeyPress), false);

	// Create the widgets
	populateWindow();

	// Connect the window position tracker
	_windowPosition.loadFromPath(RKEY_WINDOW_STATE);

	_windowPosition.connect(this);
	_windowPosition.applyPosition();

	// Show the dialog, this enters the gtk main loop
	show();
}
Esempio n. 4
0
// Edit an existing objective
void ObjectivesEditor::_onEditObjective()
{
	// Display the ComponentsDialog
	ComponentsDialog compDialog(getRefPtr(), getCurrentObjective());
	compDialog.show(); // show and block

	// Repopulate the objective list
	refreshObjectivesList();
}
void ConversationDialog::onEditConversation()
{
	// Retrieve the index of the current conversation
	int index = (*_currentConversation)[_convColumns.index];

	conversation::Conversation& conv = _curEntity->second->getConversation(index);

	// Display the edit dialog, blocks on construction
	ConversationEditor editor(getRefPtr(), conv);

	// Repopulate the conversation list
	refreshConversationList();
}
Esempio n. 6
0
FloatingCamWnd::FloatingCamWnd(const Glib::RefPtr<Gtk::Window>& parent) :
	PersistentTransientWindow(_("Camera"), parent, true)
{
	CamWnd::setContainer(getRefPtr());

	add(*Gtk::manage(new gtkutil::FramedWidget(*CamWnd::getWidget())));

	set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);

#ifdef WIN32
	// This is to fix camviews from going grey in Windows, due to some GTK/GtkGLExt bug
	CamWnd::connectWindowStateEvent(*this);
#endif
}
Esempio n. 7
0
static bool objc_find_refs(RCore *core) {
	static const char *oldstr = NULL;

	RCoreObjc objc = {0};

	const int objc2ClassSize = 0x28;
	const int objc2ClassInfoOffs = 0x20;
	const int objc2ClassMethSize = 0x18;
	const int objc2ClassBaseMethsOffs = 0x20;
	const int objc2ClassMethImpOffs = 0x10;

	objc.core = core;
	objc.word_size = (core->assembler->bits == 64)? 8: 4;

	RList *sections = r_bin_get_sections (core->bin);
	if (!sections) {
		return false;
	}
	
	RBinSection *s;
	RListIter *iter;
	r_list_foreach (sections, iter, s) {
		const char *name = s->name;
		if (strstr (name, "__objc_data")) {
			objc._data = s;
		} else if (strstr (name, "__objc_selrefs")) {
			objc._selrefs = s;
		} else if (strstr (name, "__objc_msgrefs")) {
			objc._msgrefs = s;
		} else if (strstr (name, "__objc_const")) {
			objc._const = s;
		}
	}
	if (!objc._const) {
		if (core->anal->verbose) {
			eprintf ("Could not find necessary objc_const section\n");
		}
		return false;
	}
	if ((objc._selrefs || objc._msgrefs) && !(objc._data && objc._const)) {
		if (core->anal->verbose) {
			eprintf ("Could not find necessary Objective-C sections...\n");
		}
		return false;
	}

	objc.db = sdb_new0 ();
	if (!objc_build_refs (&objc)) {
		return false;
	}
	oldstr = r_print_rowlog (core->print, "Parsing metadata in ObjC to find hidden xrefs");
	r_print_rowlog_done (core->print, oldstr);

	int total = 0;
	ut64 off;
	for (off = 0; off < objc._data->vsize ; off += objc2ClassSize) {
		ut64 va = objc._data->vaddr + off;
		ut64 classRoVA = readQword (&objc, va + objc2ClassInfoOffs);
		if (isInvalid (classRoVA)) {
			continue;
		}
		ut64 classMethodsVA = readQword (&objc, classRoVA + objc2ClassBaseMethsOffs);
		if (isInvalid (classMethodsVA)) {
			continue;
		}

		int count = readDword (&objc, classMethodsVA + 4);
		classMethodsVA += 8; // advance to start of class methods array
		ut64 from = classMethodsVA;
		ut64 to = from + (objc2ClassMethSize * count);
		ut64 va2;
		for (va2 = from; va2 < to; va2 += objc2ClassMethSize) {
			bool isMsgRef = false;
			ut64 selRefVA = getRefPtr (&objc, va2, &isMsgRef);
			if (!selRefVA) {
				continue;
			}
			// # adjust pointer to beginning of message_ref struct to get xrefs
			if (isMsgRef) {
				selRefVA -= 8;
			}
			ut64 funcVA = readQword (&objc, va2 + objc2ClassMethImpOffs);
			RList *list = r_anal_xrefs_get (core->anal, selRefVA);
			RListIter *iter;
			RAnalRef *ref;
			r_list_foreach (list, iter, ref) {
				r_anal_xrefs_set (core->anal, ref->addr, funcVA, R_META_TYPE_CODE);
				total++;
			}
		}

	}
Esempio n. 8
0
void FindAndReplaceShader::onChooseReplace()
{
	// Construct the modal dialog, enters a main loop
	ShaderChooser chooser(getRefPtr(), _replaceEntry);
    chooser.show();
}