#bytecode injection library

1 messages · Page 1 of 1 (latest)

wise solar
#

a little library that facilitates the injection of hooks into apps (without cooperation on the part of the host app)

https://github.com/PoetryHack/PoetryHook

there are examples in the example submodule

i am hoping for a bit of a code review; there's a lot of terrible code but i am hoping someone can give broader feedback about overall design rather than specific implementation details

😃

GitHub

putting java bytecode where it isn't wanted. Contribute to PoetryHack/PoetryHook development by creating an account on GitHub.

wicked zincBOT
#

<@&987246883653156906> please have a look, thanks.

wise solar
#

the internal code and a large amount of the annotations aren't commented very well yet so ping me if you have questions :)

worn ingot
#

what is your goal with this and how does it differ from sponge mixin?

wise solar
#

sponge mixin is dependent on the classloader used by the host app to either be the system classloader or cooperate with the injection process

#

among other issues, that one stands out

#

as for the goal idk why not lol

wise solar
wise solar
charred mantle
#
    int match_opcode() default -1;

    boolean match_after() default false;

    //MATCH_METHOD
    Class<?> method_class() default void.class;

    String method_name() default "";

    Class<?>[] method_parameters() default {};
#

mm

#

interesting

wise solar
#

ngl i don't think i made that part

charred mantle
#

who did?

wise solar
#

the other author

#

it should be commented

#

what file is that

#

Matcher.java

#

yea that class is annotated with the author

#

i am majorsopa the other is sootysplash

wise solar
#

i didn't do the matching implementation but a lot of the basis for this project i wrote

#

and then sootysplash refactored it to use annotations etc

charred mantle
#

well the naming scheme is closer to_python than toJava

#

and its not much documentation for what is neccesarily a pretty deep mechanism

proud sequoia
#

yea they must have been dreaming of python

wise solar
#

yea idk why it's named like that ngl

charred mantle
#

the fuck is match_opcode, for instance

wise solar
#

it matches an opcode

#

idk how else to describe it

proud sequoia
wise solar
#

well what else do u want me to say

charred mantle
#

what is it matching it for?

#

to go on a date?

wise solar
#

do you want an answer or to be silly

charred mantle
#

am I swiping right on invokedynamic

proud sequoia
charred mantle
#

i understand that it is gonna use a bytecode for something

wise solar
#

and again as i originally said i don't really care about linting the code as much as overall design feedback

charred mantle
wise solar
charred mantle
#
/**
 * @author majorsopa
 * @author sootysplash
 * @since 1.0.0
 */
public enum InjectLocation {
    // majorsopa start
    HEAD,
    TAIL,
    // majorsopa end
    // sootysplash start
    MATCH_METHOD,
    MATCH_TYPE,
    MATCH_FIELD
    // sootysplash end
}
#

ay yes, // sootysplash start

#

this is how i know that these 3 injection locations are by sootysplash

wise solar
#

that is annotating the code for who did what because we extracted it from a private repo and git blame wouldn't know that 😃

charred mantle
wise solar
#

we both do

#

but anyways

#

that is so completely irrelevant

proud sequoia
wise solar
#

please read the message i sent about 30 seconds ago

#

thank you

proud sequoia
#

welp

wicked zincBOT
#

@wise solar

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

wise solar
#

.