Skip to content

Commit f0954b7

Browse files
author
‘niuerzhuang’
committed
feature API
1 parent a7257d2 commit f0954b7

File tree

6 files changed

+3999
-3973
lines changed

6 files changed

+3999
-3973
lines changed

iast-core/dependency-reduced-pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
<include />
107107
</fileset>
108108
</copy>
109+
<copy>
110+
<fileset>
111+
<include />
112+
</fileset>
113+
</copy>
109114
</tasks>
110115
</configuration>
111116
</execution>

iast-core/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@
115115
<include name="iast-core.jar"/>
116116
</fileset>
117117
</copy>
118+
<copy todir="/var/folders/xy/xyx56h3s29z6376gvk32621h0000gn/T">
119+
<fileset dir="target/">
120+
<include name="iast-core.jar"/>
121+
</fileset>
122+
</copy>
118123
</tasks>
119124
</configuration>
120125
<goals>

iast-core/src/main/java/com/secnium/iast/core/enhance/plugins/api/SpringApplicationAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public MethodVisitor visitMethod(int access, String name, String descriptor, Str
2929
signature,
3030
exceptions);
3131
if ("run".equals(name) && Type.getArgumentTypes(descriptor).length == 1) {
32+
System.out.println(context.getClassName());
3233
// methodVisitor = new SpringApplicationAdviceAdapter(methodVisitor,
3334
// access,
3435
// name,
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
package com.secnium.iast.core.enhance.plugins.api;
22

33
import com.secnium.iast.core.enhance.IastContext;
4-
import com.secnium.iast.core.enhance.plugins.core.adapter.PropagateAdviceAdapter;
4+
import com.secnium.iast.core.enhance.plugins.AbstractAdviceAdapter;
55
import com.secnium.iast.core.handler.controller.HookType;
6+
import org.objectweb.asm.Label;
67
import org.objectweb.asm.MethodVisitor;
78

8-
public class SpringApplicationAdviceAdapter extends PropagateAdviceAdapter {
9+
public class SpringApplicationAdviceAdapter extends AbstractAdviceAdapter {
910

1011
public SpringApplicationAdviceAdapter(MethodVisitor mv, int access, String name, String desc, IastContext context, String type, String signCode) {
1112
super(mv, access, name, desc, context, type, signCode);
1213
}
1314

1415
@Override
1516
protected void before() {
17+
mark(tryLabel);
18+
mark(catchLabel);
1619
}
1720

1821
@Override
1922
protected void after(int opcode) {
2023
if (!isThrow(opcode)) {
21-
captureMethodState(opcode, HookType.PROPAGATOR.getValue(), true);
24+
Label endLabel = new Label();
25+
captureMethodState(opcode, HookType.SPRINGAPPLICATION.getValue(), true);
26+
mark(endLabel);
27+
} else {
28+
captureMethodState(opcode, HookType.SPRINGAPPLICATION.getValue(), true);
2229
}
2330
}
31+
32+
@Override
33+
public void visitMaxs(int maxStack, int maxLocals) {
34+
super.visitMaxs(maxStack, maxLocals);
35+
}
2436
}

iast-core/src/main/java/com/secnium/iast/core/handler/graphy/GraphBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import org.json.JSONObject;
1414
import org.slf4j.Logger;
1515

16+
import java.io.File;
17+
import java.io.FileWriter;
18+
import java.io.IOException;
1619
import java.lang.reflect.InvocationTargetException;
1720
import java.util.ArrayList;
1821
import java.util.List;

0 commit comments

Comments
 (0)