You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to fix an issue where several methods won't be found by frida-java-bridge, I noticed that DebugSymbol.findFunctionsMatching("*") would not return anything, when attached to the same Java process a second time.
Issue reproduction
To reproduce, the following sample UI application can be used.
HelloWorldGui.java
importjavax.swing.*;
publicclassHelloWorldGUI {
publicstaticvoidmain(String[] args) {
// Create the GUI on the Event Dispatch ThreadSwingUtilities.invokeLater(() -> createAndShowGUI());
}
privatestaticvoidcreateAndShowGUI() {
// Create and set up the windowJFrameframe = newJFrame("Hello World GUI");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create and set up the content paneJLabellabel = newJLabel("Hello, World!");
frame.getContentPane().add(label);
// Display the windowframe.pack();
frame.setLocationRelativeTo(null); // Center the windowframe.setVisible(true);
}
}
Running it with OpenJDK 17 on Windows (also make sure the debug symbols (pdb's) are placed next to the binaries)
C:\jdk-17.0.11+9\bin\java.exe HelloWorldGUI.java
Attach to the process using Frida, run DebugSymbol.findFunctionsMatching("*"), this should result in a large list of ptr's. If not, the debug symbols are likely missing.
Detach frida
Reattach frida and run DebugSymbol.findFunctionsMatching("*"). BUG HERE The list is now empty.
Additional investigation
I've attempted to manually run SymCleanup from Frida, but this doen not appear to help
This change will make the `jvm.js` code be able to bridge Java OpenJDK 17 on Windows. This was tested on Windows 10, using `jdk-17.0.11+9` from https://learn.microsoft.com/en-gb/java/openjdk/download and the separately downloaded and extracted debug symbols.
The code is not pretty, but I've tried to keep as close to the original as possible.
Note the bug that I discovered while performing the tests; frida/frida-gum#811. This means that the target process needs to be restarted after detaching Frida, for the Java bridge (resolving of Symbols) to work.
This code currently does not work with OpenJDK21!
This code requires the 'manual' placement of the debug symbols, otherwise `jvm.ts` will be unable to find the functions it requires.
This change will make the jvm.js code be able to bridge Java OpenJDK 17
on Windows. This was tested on Windows 10, using jdk-17.0.11+9 from
https://learn.microsoft.com/en-gb/java/openjdk/download and the
separately downloaded and extracted debug symbols.
The code is not pretty, but I've tried to keep it as close to the
original as possible.
Note that I discovered a bug while performing the tests;
frida/frida-gum#811. This means that the
target process needs to be restarted after detaching Frida, for the Java
bridge (resolving of Symbols) to work.
This code currently does not work with OpenJDK21!
This code requires the 'manual' placement of the debug symbols,
otherwise jvm.js will be unable to find the functions it requires.
Issue description
I was looking fixing the debugging of Windows based Java applications, using OpenJDK from Microsoft and the debugging symbols, available here; https://learn.microsoft.com/en-gb/java/openjdk/download.
While attempting to fix an issue where several methods won't be found by
frida-java-bridge
, I noticed thatDebugSymbol.findFunctionsMatching("*")
would not return anything, when attached to the same Java process a second time.Issue reproduction
HelloWorldGui.java
pdb
's) are placed next to the binaries)Attach to the process using Frida, run
DebugSymbol.findFunctionsMatching("*")
, this should result in a large list of ptr's. If not, the debug symbols are likely missing.Detach frida
Reattach frida and run
DebugSymbol.findFunctionsMatching("*")
. BUG HERE The list is now empty.Additional investigation
SymCleanup
from Frida, but this doen not appear to helpThe text was updated successfully, but these errors were encountered: