Ciremun / freedom

osu! difficulty changer & bot
MIT License
105 stars 27 forks source link

doesn't inject no matter what #58

Closed BloxburgTP closed 1 year ago

BloxburgTP commented 1 year ago

I have tried running freedom.exe by itself as well as injecting the two dlls with a separate dll injector and nothing works.

Ciremun commented 1 year ago

@BloxburgTP maybe this helps https://github.com/Ciremun/freedom/issues/55#issuecomment-1304557643 or maybe not, I can't reproduce the issue, so the only way is debugging on your own, I'm sorry.

Ciremun commented 1 year ago

@BloxburgTP also only freedom.dll should be injected, it loads prejit.dll to precompile C# methods

BloxburgTP commented 1 year ago

So I compiled the latest build into an exe, am I just drag and dropping the freedom.dll into that exe? also the exe when launched is just a blank window and immediately closes + I have no overlay on

Ciremun commented 1 year ago

@BloxburgTP so, if you would like to debug it, then try these things: https://github.com/Ciremun/freedom/issues/55#issuecomment-1304556938 also drag and drop freedom.dll onto freedom.exe just passes the dll path as first argument of the injector, but the first argument is the target process name, so it's better to run injector from the console (cmd.exe)

BloxburgTP commented 1 year ago

do I just do 'freedom.exe' in cmd? where do I pass in freedom.dll

Ciremun commented 1 year ago

@BloxburgTP according to this piece of code https://github.com/Ciremun/freedom/blob/da6387d91f680602860ddef9992e84a68a88335b/injector.cpp#L35-L45 target process name is argv[1] and dll path is argv[2], if no args provided the default values are: osu!.exe and freedom.dll from injector's folder

Ciremun commented 1 year ago

it should work with cmd and without it

BloxburgTP commented 1 year ago

so the menu should pop up as soon as I run freedom.exe?

Ciremun commented 1 year ago

@BloxburgTP after running .exe and making the game window 'visible', the menu appears in-game, as an overlay, top-left corner - screenshot

BloxburgTP commented 1 year ago

alright I got it working now but the menu makes my osu crash once I try to edit any options

Ciremun commented 1 year ago

@BloxburgTP does changing the font size of the ui menu ("Other" tab) also cause crash? if it does, check if pressing F11 key crashes too

BloxburgTP commented 1 year ago

I can't get to the other tab because it freezes and crashes once I right click the menu. The game also crashes when I press f11 after injecting and not touching the menu

Ciremun commented 1 year ago

so crashes happen no matter what? that makes me think it has to do with memory scan I should add error checking for this function https://github.com/Ciremun/freedom/blob/da6387d91f680602860ddef9992e84a68a88335b/freedom/detours.cpp#L175 I managed to reproduce crash with access violation (caused by binding_manager), but it's rare on my setups

Ciremun commented 1 year ago

if you can build it you may try commenting out some of find_code_start calls until maybe something works https://github.com/Ciremun/freedom/blob/da6387d91f680602860ddef9992e84a68a88335b/freedom/detours.cpp#L143-L153 also comment out this line because osu_manager is taken from clr, not from scanning https://github.com/Ciremun/freedom/blob/da6387d91f680602860ddef9992e84a68a88335b/freedom/detours.cpp#L298

BloxburgTP commented 1 year ago

alright, so I edit out some values and it seems to not crash anymore, but the relax, aimbot tabs are red. this happened before I commented out any lines

Ciremun commented 1 year ago

so, my assumption is that i need better signatures, we could also try avoiding memory scan to assure thats the case

Ciremun commented 1 year ago

thanks for the help! much appreciated!

BloxburgTP commented 1 year ago

alright but is there a reason for the tabs being red? I cannot click on them either

Ciremun commented 1 year ago

its some sort of error handling i did, means offsets were not found (assembly opcodes), offsets needed to hook certain events, like beatmap loading, and it looks for pointers in assembly

Ciremun commented 1 year ago

in case of aimbot and relax, the beatmap onload offset is checked https://github.com/Ciremun/freedom/blob/da6387d91f680602860ddef9992e84a68a88335b/freedom/ui.cpp#L122-L123

Ciremun commented 1 year ago

so, my assumption is that i need better signatures, we could also try avoiding memory scan to assure thats the case

https://github.com/Ciremun/freedom/releases/tag/v0.81 @BloxburgTP updated clr method names to avoid memory scan, also added error handling for binding manager, maybe it doesn't crash now?

BloxburgTP commented 1 year ago

niceee, it works now thank you so much for the help

Ciremun commented 1 year ago

@BloxburgTP it will break after another osu! update, unfortunately, I have to fix signatures or keep method names up to date it seems, so it's a temporary solution