Skip to content

Commit

Permalink
Added option to show config, ctrl-O
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Oca committed Sep 9, 2016
1 parent a237a8e commit eabaae7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
24 changes: 24 additions & 0 deletions Ponce/src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "globals.hpp"
#include "utils.hpp"
#include "callbacks.hpp"
#include "formChoser.hpp"

//Triton
#include "api.hpp"
Expand Down Expand Up @@ -627,6 +628,29 @@ static const action_desc_t action_IDA_createSnapshot = ACTION_DESC_LITERAL(
NULL,
15);

struct ah_show_config_t : public action_handler_t
{
virtual int idaapi activate(action_activation_ctx_t *ctx)
{
prompt_conf_window();
return 1;
}

virtual action_state_t idaapi update(action_update_ctx_t *ctx)
{
return AST_ENABLE_ALWAYS;
}
};
static ah_show_config_t ah_show_config;

action_desc_t action_IDA_show_config = ACTION_DESC_LITERAL(
"Ponce:show_config", // The action name. This acts like an ID and must be unique
"Show config", //The action text.
&ah_show_config, //The action handler.
"Ctrl-O", //Optional: the action shortcut
"Show the Ponce configuration", //Optional: the action tooltip (available in menus/toolbar)
201); //Optional: the action icon (shows when in menus/toolbars)

/*This list defined all the actions for the plugin*/
struct action action_list[] =
{
Expand Down
3 changes: 2 additions & 1 deletion Ponce/src/actions.hpp
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

#pragma once
extern action_desc_t action_IDA_show_config;
4 changes: 4 additions & 0 deletions Ponce/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ void idaapi run(int)

if (!hooked)
{
if (register_action(action_IDA_show_config))
msg("action registered\n");
if (attach_action_to_menu("Edit/Ponce/", "Ponce:show_config", SETMENU_APP))
msg("menu attached\n");
//First we ask the user to take a snapshot, -1 is to cancel so we don't run the plugin
if (ask_for_a_snapshot() != -1)
{
Expand Down

0 comments on commit eabaae7

Please sign in to comment.