Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
100 views

So I am trying to add information about locals I use. The current way I am trying to achieve it - is: methodVisitor = classWriter.visitMethod(ACC_PUBLIC | ACC_STATIC, "something", "()V&...
Gleb's user avatar
  • 258
0 votes
1 answer
60 views

I have a perplexing problem. We use run-time created codec:s for message en- and decoding. The original authors has long since left the building. I've been asked to add some rather simple ...
Erik's user avatar
  • 2,071
0 votes
2 answers
70 views

Hi I'm trying to build a trace agent where app agent propagates the origin application name across the multiple network calls using the HTTPUrlConnection. So far, I was able to invoke the Advice ...
Jay_ran's user avatar
0 votes
0 answers
21 views

I have this custom gradle plugin to replace the implementation of a class. When I build the apk I do see that the original class is modified as expected. However, the class packaged in the apk is ...
rysv's user avatar
  • 3,532
0 votes
0 answers
99 views

I’m Trying to Intercept Some Methods Using the Byte-Buddy Android Gradle Plugin I want to intercept some methods using the Byte-Buddy Android Gradle plugin. Here are the versions I am using: • Java ...
Engin Kadir Şahin's user avatar
0 votes
1 answer
88 views

I am playing with Java bytecode generation (using Clojure with https://github.com/jgpc42/insn), Currently I am trying to generate a bytecode for a nested for loop, bellow is the relevant part of the ...
Édipo Féderle's user avatar
1 vote
1 answer
569 views

As shown in the following figure, a custom Java agent package is added to the JVM options -javaagent:/usr/local/maven/apache-maven-3.6.3/repository/com/graviton/Probe-Agent/1.0-SNAPSHOT/Probe-Agent-1....
Photon's user avatar
  • 29
-1 votes
1 answer
135 views

I have code that attempts to redefine a class at runtime using a ClassFileTransformer and an instance of Instrumentation. However, I've noticed that the transform method of ClassFileTransformer fails ...
crazycat256's user avatar
0 votes
1 answer
122 views

I am writing a term paper for the university. The task is to write two programs, one of which collects some information, signs it with a digital key, and saves the encrypted data and the key to ...
Артем Лебідь's user avatar
0 votes
2 answers
162 views

I'm currently working on a project where I generate Java bytecode from my own intermediate representation using the ASM library. For some methods in my code, I already have pre-calculated values for ...
Volodya Lombrozo's user avatar
-1 votes
1 answer
99 views

It seems that ASM ClassWriter does not preserve the order of entries in the constant pool. For example, consider the following code snippet: @Test void hashShouldBeSame() throws IOException, ...
AMAN SHARMA's user avatar
-1 votes
1 answer
288 views

I'm currently trying to edit the bytecode of a java class after it has been loaded by the JVM. I use Java 8 and ASM 5.0.3. I can't change the command line or the JVM arguments. Here is a minimal ...
crazycat256's user avatar
0 votes
2 answers
176 views

for example:I want to change LocalDateTime.now() return result in non-production enviroment, I am trying to invoke the following code,but error occors: @Test public void test3() { ...
yicai.liu's user avatar
1 vote
2 answers
113 views

I'am working in a Transparent Dirty Detection Agent (tdd-agent). It work really well redefining the target classes to implement the setDirty()/isDirty() and set it when it detect a putfield, but I ...
Marcelo D. Ré's user avatar
1 vote
1 answer
193 views

I am currently utilizing org.objectweb.asm.util.CheckClassAdapter for bytecode verification in my Java project. However, I've observed that this class prints errors to stderr instead of throwing ...
Volodya Lombrozo's user avatar
1 vote
0 answers
150 views

I'm trying to replace methods in a class with their counterparts in a subpackage, if they exist. For example, if I have a class "name.package.ClassName" and I want to replace its methods ...
LostInCode-dvp's user avatar
0 votes
1 answer
138 views

I am a bit new to the Java ecosystem. I am reading the ASM way (in this doc https://www.baeldung.com/java-asm ) to do Java instrumentation. And I don't know when ASM changes the byte code, to be ...
maki's user avatar
  • 640
0 votes
0 answers
140 views

In past versions of the bytecode manipulation framework Mixin, there was a method called prepareConfigs(MixinEnvironment). A nonstandard, but very commonly-used, way to bootstrap Mixins at a certain ...
ABadHaiku's user avatar
  • 119
0 votes
1 answer
269 views

public class TestException extends Exception { public TestException(String msg) { super("This is the message: " + msg); } } The above code is compiled to: public class ...
Irfan Latif's user avatar
0 votes
1 answer
452 views

I'm trying to parse bytecode from Java 16 (bytecode version 60) using the ObjectWeb ASM. I've written the following code: @Test void parseBytecode() { try (InputStream stream = this.getClass() ...
Volodya Lombrozo's user avatar
0 votes
0 answers
92 views

I am trying to make a class loader which transforms the class bytes of the class being loaded using some kind of class transformer. Suppose I have the following code: static class Test { void foo(); ...
asdafadsfadsfdaf's user avatar
2 votes
1 answer
126 views

After carefully reading JVMS §4.10.2.2, I noticed the following paragraph: If corresponding values are both array reference types, then their dimensions are examined. If the array types have the same ...
Johannes Kuhn's user avatar
1 vote
1 answer
143 views

SampleClass has a field, that is annotated with MyAnnotation. I can detect that MyAnnotation is present on the field name using ASM visitor pattern, but unsure how to check if @NotNull is part of ...
bobbyrne01's user avatar
  • 6,833
1 vote
1 answer
104 views

There are a number of tools(e.g. JavaAssist, ASM) to re-generate bytecodes at runtime for various purposes. One case is Application permformance Management(APM), which provides agents to rewrite ...
shijie xu's user avatar
  • 2,107
0 votes
0 answers
91 views

I am trying to make something similar to Mixins (from the Minecraft mod loader Fabric) and what I made so far seems to work (doesn't throw any errors, I don't know how else to check), but I got stuck ...
Qweru's user avatar
  • 46
0 votes
1 answer
125 views

I hava a question about the iload instruction of jasmin. Is it correct to do iload 1 or it has to be iload_1? Or when is a number between 1 and 3 we have to use the '' and the others we have to not ...
João Reis's user avatar
2 votes
1 answer
257 views

I'm trying to check how many times a constant is used in the given classes. My idea is to first use ClassReader.accept(ClassVisitor, ...) to visit the class, and then declare a methodVisitor for each ...
Zihe Ji's user avatar
  • 21
1 vote
0 answers
59 views

I am wondering what to do to take a deeper insight into the execution flow when running a test unit. For example, below should be a body of a test unit. A.methodA(1,2,false); B b = new B("foo&...
castysishi's user avatar
0 votes
1 answer
355 views

I am trying to figure out how ASM works, with the help of A Guide to Java Bytecode Manipulation with ASM. I followed the tutorial and created an 'extra' static field for the Integer class. Here is the ...
Jacob van Lingen's user avatar
0 votes
1 answer
78 views

I'm writing a security-boosted Java program that uses ASM tool to add some hooks into JRE classes. The hooks will then call my method to make some rule checks. But the odd thing is, the hooks in JRE ...
Red Ad's user avatar
  • 13
0 votes
0 answers
409 views

I have code to insert instructions into the constructor of a class from a third party library (okhttp3.OkHttpClient in this case). Disassembled class shows the added line. However, I am not sure how ...
rysv's user avatar
  • 3,532
0 votes
1 answer
694 views

I am trying to instrument OkHttpClient builder class. However, I am not able to create ClassReader in the first place. import org.objectweb.asm.ClassReader; ... // this works meaning dependency from ...
rysv's user avatar
  • 3,532
0 votes
1 answer
505 views

I want to inject some code into an existing class/method. But I am unable to get the classloader to "find" the class in order to use the modified byte code. MyClassInjector.java import org....
rysv's user avatar
  • 3,532
2 votes
1 answer
271 views

I have a problem with method override checks. I can detect simple override relations, but if the parent class has generics and the abstract method uses type parameters (return value/args), my code ...
Andrey Tarasov's user avatar
1 vote
2 answers
216 views

How to extract method raw bytes using ASM ? I need a map of method signatures* and raw bytes ClassReader classReader = new ClassReader(artifact.getInputStream(jarEntry)); classReader.accept(new ...
James W.'s user avatar
  • 3,085
2 votes
1 answer
170 views

I'm doing instrumentation for java code with ASM library. I want to surround a method body with a try-catch block, which doesn't interrupt the origianl method execution. However, when I use ...
a stand-out flamingo's user avatar
0 votes
1 answer
658 views

I am trying to generate Java bytecode using the Java Asm library (I am basically trying to create yet another JVM programming language) Here is the code I am compiling float f = 2f float f2 = new ...
Tambapps's user avatar
1 vote
1 answer
295 views

I'm writing a compiler that generates JVM byte code, using the ASM library for the backend. It will be desirable to output debug information, so that stack traces can show source code locations where ...
rwallace's user avatar
  • 34.1k
4 votes
1 answer
113 views

I'm writing a compiler that outputs JVM byte code, and using ASM 9.4 for the backend. This works fine, but I am puzzled about one particular quirk. I'm specifying COMPUTE_FRAMES to automatically ...
rwallace's user avatar
  • 34.1k
1 vote
1 answer
1k views

I'm trying to understand ASM and am currently stuck at chapter 2.2.4 in the handbook. This should be a simple Java question though. The example code I'm trying to understand has this line in it called ...
Bimi124's user avatar
  • 46
0 votes
1 answer
267 views

I've been trying to instrument branch-related code using ASM lib in java. Suppose this is a period of code I want to instrument: if (true) { System.out.println("true"); ...
a stand-out flamingo's user avatar
0 votes
1 answer
107 views

I have the following inheritance structure: SomeModel implements Entity, and SomeModelQueryRepo has 2 methods that return SomeModel: get given an Id, and get returning all SomeModels in the repo. For ...
Vivere's user avatar
  • 2,340
0 votes
0 answers
570 views

I'm using a plugin for Eclipse (WindowBuilder) in my RCP application based on Eclipse. Since a few versions this plugin doesn't work anymore in my RCP setup. In Eclipse however there is no problem. It ...
Marcel's user avatar
  • 522
2 votes
1 answer
256 views

What I did is to instrument java classes at runtime to warp the whole method with a big try-catch block, and then rethrow the exception in the catch block if any exception is caught. I use a Premain ...
Instein's user avatar
  • 3,694
0 votes
0 answers
258 views

Firstly, this question is more like a general question than a specific technical problem. I'm doing a research project, where I need to record all the possible values of public static fields during ...
Instein's user avatar
  • 3,694
2 votes
1 answer
199 views

I am only reading bytecode not overwrite, which one I should use: public MethodVisitor visitMethod(...) { return new MyMethodVisitor(Opcodes.ASM9, super.visitMethod(...)); } or public ...
muzaffer kadir belen's user avatar
3 votes
1 answer
163 views

As the code shows below: public class Main implements MainInter{ public static void main(String[] args) { List<String> s = new ArrayList<>(); DClassFather var = new ...
buriedpot's user avatar
1 vote
0 answers
804 views

I am able to instrument a boat load of my own classes and some third party libraries. But, when I want to load java/lang/Thread (need the thread id and name to link parent thread and child threads), ...
Arun J's user avatar
  • 557
0 votes
1 answer
180 views

I'm trying to add to user bytecode from a premain method that adds certain information in String form to a list whenever a new line number node is encountered, although when I run the agent and ...
Flipz's user avatar
  • 33
1 vote
0 answers
147 views

I am trying to write a program that observes the execution of a simple multithreaded user program and returns a queue structure detailing the order in which the user program's threads worked through ...
WobbleMeister's user avatar

1
2 3 4 5
17