Answer the question
In order to leave comments, you need to log in
How to intercept Java_java_lang_ClassLoader_defineClass0 from libjava.so?
Good afternoon. I am researching Linux and Java for general development for the future.
I read that you can use LD_PRELOAD
it to intercept dynamically linked functions, you just need to export them in your library and connect it with LD_PRELOAD
. And then whoever first declares the function, "that and slippers."
Decided to replace the functions Java_java_lang_ClassLoader_defineClass0
, Java_java_lang_ClassLoader_defineClass1
, Java_java_lang_ClassLoader_defineClass2
from libjava.so
. The choice is made in order to further decrypt encrypted resources. I ask you to leave this goal out of the discussion.
Well. Wrote "Hello world" in Java from three classes and one resource. Checking:
#java -cp . Main
Hello world
library run;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
procedure Java_java_lang_ClassLoader_defineClass0; cdecl; export;
begin
Writeln('LibRun Java_java_lang_ClassLoader_defineClass0');
end;
procedure Java_java_lang_ClassLoader_defineClass1; cdecl; export;
begin
Writeln('LibRun Java_java_lang_ClassLoader_defineClass1');
end;
procedure Java_java_lang_ClassLoader_defineClass2; cdecl; export;
begin
Writeln('LibRun Java_java_lang_ClassLoader_defineClass2');
end;
exports
Java_java_lang_ClassLoader_defineClass0,
Java_java_lang_ClassLoader_defineClass1,
Java_java_lang_ClassLoader_defineClass2;
initialization
Writeln('LibRun loaded');
finalization
Writeln('LibRun unloaded');
end.
LibRun Java_java_lang_ClassLoader_defineClass*
, and then an error, because my implementations do nothing. #LD_PRELOAD=/path/to/lib/librun.so java -cp . Main
LibRun loaded
Hello world
LibRun unloaded
Answer the question
In order to leave comments, you need to log in
Java loads these files via dlopen
and dlsym
, so it is not intercepted.
It needs to be intercepted dlsym
.
I read that using LD_PRELOAD you can intercept dynamically linked functions, you just need to export them in your library and connect it using LD_PRELOAD. And then whoever first declares the function, "that and slippers."
Because in the css file the path comes from the css file, there is no fonts folder in the css folder ---- specify the full path with the domain or ../
you do not have these fonts in the fonts folder!
you need what was this
and you only have this:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question