Skip to content

Commit d765fb3

Browse files
committed
feat: add postProcessBytes for ByteBuddyShellGenerator
1 parent 6a8dbe3 commit d765fb3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

generator/src/main/java/com/reajason/javaweb/memshell/generator/ByteBuddyShellGenerator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ protected ByteBuddyShellGenerator(ShellConfig shellConfig, T shellToolConfig) {
2323

2424
protected abstract DynamicType.Builder<?> getBuilder();
2525

26+
protected byte[] postProcessBytes(byte[] classBytes) {
27+
return classBytes;
28+
}
29+
2630
@Override
2731
public byte[] getBytes() {
2832
DynamicType.Builder<?> builder = getBuilder();
@@ -42,7 +46,8 @@ public byte[] getBytes() {
4246
.visit(new TargetJreVersionVisitorWrapper(shellConfig.getTargetJreVersion()));
4347

4448
try (DynamicType.Unloaded<?> unloaded = builder.make()) {
45-
return ProcessorRegistry.applyByteProcessors(unloaded.getBytes(), shellConfig, shellToolConfig);
49+
byte[] bytes = postProcessBytes(unloaded.getBytes());
50+
return ProcessorRegistry.applyByteProcessors(bytes, shellConfig, shellToolConfig);
4651
}
4752
}
4853
}

0 commit comments

Comments
 (0)