This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyClassGeneratorByASM { | |
public static void main(String[] args) throws IOException { | |
System.out.println(); | |
ClassWriter classWriter = new ClassWriter(0); | |
// 通过visit方法确定类的头部信息 | |
classWriter.visit(Opcodes.V1_7,// java版本 | |
Opcodes.ACC_PUBLIC,// 类修饰符 | |
"Programmer", // 类的全限定名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserServiceImpl { | |
public void add() { | |
System.out.println("This is add service"); | |
} | |
public void delete(int id) { | |
System.out.println("This is delete service?delete " + id); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Service { | |
//目标方法 | |
public abstract void add(); | |
} | |
class UserServiceImpl implements Service { | |
public void add() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Subject { | |
void request(); | |
} | |
class RealSubject implements Subject { | |
public void request() { | |
System.out.println("RealSubject"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
NewerOlder