当前位置: 首页>>代码示例>>Java>>正文


Java Hooks类代码示例

本文整理汇总了Java中org.frustra.filament.Hooks的典型用法代码示例。如果您正苦于以下问题:Java Hooks类的具体用法?Java Hooks怎么用?Java Hooks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Hooks类属于org.frustra.filament包,在下文中一共展示了Hooks类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: complete

import org.frustra.filament.Hooks; //导入依赖的package包/类
public void complete(FilamentClassNode node, MethodNode m) {
	// Loop through the bytecode instructions inside the main function
	AbstractInsnNode insn = m.instructions.getFirst();
	while (insn != null) {
		
		// Look for any method call instructions
		if (insn instanceof MethodInsnNode) {
			MethodInsnNode insn2 = (MethodInsnNode) insn;
			
			// Find the first method call pointing to within ExampleC
			if (insn2.owner.equals(Type.getInternalName(ExampleC.class))) {
				// Store the target method as ExampleC.printOne for the injector to use
				Hooks.set("ExampleC.printOne", HookUtil.getMethodNode(insn2.owner, insn2.name, insn2.desc));
				return;
			}
			
		}
		
		insn = insn.getNext();
	}
}
 
开发者ID:xthexder,项目名称:HackingJava,代码行数:22,代码来源:HookC.java

示例2: main

import org.frustra.filament.Hooks; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	// Load the obfuscated examples package so we can modify the bytecode
	loader.loadPackage("com.shopify.examples.obf");
	
	// Load a hook to identify the printOne method for the injector
	Hooks.load("com.shopify.examples.hooks");
	
	// Register the injector we're going to be using on our example
	Injectors.register("com.shopify.examples.injectors");
	
	// Run the program with the modified bytecode
	Class<?> cls = loader.loadClass(ExampleC.class.getName());
	Method entryPoint = cls.getDeclaredMethod("main", new Class[] {String[].class});
	entryPoint.invoke(null, new Object[] {args});
}
 
开发者ID:xthexder,项目名称:HackingJava,代码行数:16,代码来源:HackC.java

示例3: matches

import org.frustra.filament.Hooks; //导入依赖的package包/类
/**
 * Check if this class matches a specified class hook.
 * 
 * @param hook a class hook to compare
 * @return <code>true</code> if the classes have the same name and package
 * @throws BadHookException if the specified hook is undefined or is the wrong type
 * @see Hooks
 */
public boolean matches(String hook) throws BadHookException {
	FilamentClassNode node = Hooks.getClass(hook);
	return this.equals(node);
}
 
开发者ID:xthexder,项目名称:filament,代码行数:13,代码来源:FilamentClassNode.java


注:本文中的org.frustra.filament.Hooks类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。