示例#1
0
bool reios_init(u8* rom, u8* flash) {

	printf("reios: Init\n");

	biosrom = rom;
	flashrom = flash;

	memset(rom, 0xEA, 2048 * 1024);
	memset(GetMemPtr(0x8C000000, 0), 0, RAM_SIZE);

	u16* rom16 = (u16*)rom;

	rom16[0] = REIOS_OPCODE;

	register_hook(0xA0000000, reios_boot);

	register_hook(0x8C001000, reios_sys_system);
	register_hook(0x8C001002, reios_sys_font);
	register_hook(0x8C001004, reios_sys_flashrom);
	register_hook(0x8C001006, reios_sys_gd);
	register_hook(0x8C001008, reios_sys_misc);

	register_hook(dc_bios_entrypoint_gd_do_bioscall, &gd_do_bioscall);

	return true;
}
示例#2
0
int __init init_syscall_hook(void)
{
    init_hook_table();

    register_hook(__NR_exit, (void*) my_hooked_exit);

    init_DR();

    printk(KERN_INFO "**** DR based syscall hook loaded ****\n");

    return 0;
}
示例#3
0
文件: beinfo.c 项目: lamproae/libfirm
void be_info_init(void)
{
	if (initialized)
		panic("double initialization of be_info");

	old_phi_copy_attr = op_Phi->ops.copy_attr;
	set_op_copy_attr(op_Phi, new_phi_copy_attr);
	initialized = true;

	hook_backend_info.hook._hook_node_info = dump_backend_info_hook;
	register_hook(hook_node_info, &hook_backend_info);
}
示例#4
0
static char *handle_cli_amihook_register_hook(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
	switch (cmd) {
	case CLI_INIT:
		e->command = "amihook register";
		e->usage = ""
			"Usage: amihook register"
			"";
		return NULL;
	case CLI_GENERATE:
		return NULL;
	case CLI_HANDLER:
		register_hook();
		return CLI_SUCCESS;
	}

	return CLI_FAILURE;
}
示例#5
0
文件: lua.c 项目: Cynede/hexchat
static int api_hexchat_hook_timer(lua_State *L)
{
	int ref, timeout = luaL_checkinteger (L, 1);
	hook_info *info, **u;

	lua_pushvalue(L, 2);
	ref = luaL_ref(L, LUA_REGISTRYINDEX);
	info = g_new(hook_info, 1);
	info->state = L;
	info->ref = ref;
	info->hook = hexchat_hook_timer(ph, timeout, api_timer_closure, info);
	u = lua_newuserdata(L, sizeof(hook_info *));
	*u = info;
	luaL_newmetatable(L, "hook");
	lua_setmetatable(L, -2);
	register_hook(info);
	return 1;
}
示例#6
0
文件: lua.c 项目: Cynede/hexchat
static int api_hexchat_hook_server_attrs(lua_State *L)
{
	char const *command = luaL_optstring(L, 1, "RAW LINE");
	int ref, pri;
	hook_info *info, **u;

	lua_pushvalue(L, 2);
	ref = luaL_ref(L, LUA_REGISTRYINDEX);
	pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
	info = g_new(hook_info, 1);
	info->state = L;
	info->ref = ref;
	info->hook = hexchat_hook_server_attrs(ph, command, pri, api_server_attrs_closure, info);
	u = lua_newuserdata(L, sizeof(hook_info *));
	*u = info;
	luaL_newmetatable(L, "hook");
	lua_setmetatable(L, -2);
	register_hook(info);
	return 1;
}
示例#7
0
文件: lua.c 项目: Cynede/hexchat
static int api_hexchat_hook_print(lua_State *L)
{
	char const *event = luaL_checkstring(L, 1);
	hook_info *info, **u;
	int ref, pri;

	lua_pushvalue(L, 2);
	ref = luaL_ref(L, LUA_REGISTRYINDEX);
	pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
	info = g_new(hook_info, 1);
	info->state = L;
	info->ref = ref;
	info->hook = hexchat_hook_print(ph, event, pri, api_print_closure, info);
	u = lua_newuserdata(L, sizeof(hook_info *));
	*u = info;
	luaL_newmetatable(L, "hook");
	lua_setmetatable(L, -2);
	register_hook(info);
	return 1;
}