kokolihapihvi / RockSniffer

RockSniffer application
MIT License
77 stars 29 forks source link

sniffing seems fine but not updating #2

Closed Friedfisch closed 6 years ago

Friedfisch commented 6 years ago

since i got 24gb ram its not working anymore at all, what do you need to check that out? just saying "in menu", "in song", etc but not updating files, even with latest release version - or how can i help out? win10 latest, rs latest. i have (atm) no idea about screwing around with memory :D last time was in like 1994.. aka crash pc in 2 seconds :d and no cdlc stuff

kokolihapihvi commented 6 years ago

Hey

First of all try a new clean version of it, and verify that you have the latest version (currently 0.1.1) Run it, then start a song in-game, then check the files. If the output files are still blank, try enabling some debug options in config/debug.json, namely the song details one, and restart the program. It should then print song details in the console as it reads them. You could also check if the addons are working by opening one of them in a browser.

It's probably getting memory readouts correctly as the states are being printed into the console.

Also note that when restarting, it won't be able to pick up from mid song, you'll have to return back to the menus for it to catch up.

Friedfisch commented 6 years ago

Hey, worked on saturday just without doing anything, today its broken again. :D Is there an option to enable logfile - whatever screenshot will just do i guess? Not sure what exactly that means (i enabled debug for songdetails and hirc, the other debug things all look fine to me): hirc

kokolihapihvi commented 6 years ago

That looks like normal output to me... Just to clarify, it worked fine until you increased your computers memory to 24Gb? Could you test if it starts working consistently when you reduce the amount of memory?

Friedfisch commented 6 years ago

No, it "feels" like it is just working less often. Sometimes a reboot worked out, sometimes not - its pretty much random. VS2017 CE seems to compile it and run it in debug mode - i guess i have a shot at it. :)

Friedfisch commented 6 years ago

var handles = CustomAPI.GetHandles(rsProcess); This returns an empty list ("sometimes" it works) and therefore filename of psarc ends up being empty string (instead of null), afterwards dlcFile != null check overwrites everything with empty/broken data. The question is "why" :D Tried x86 and x64 builds, both the same. Something in customapi.cs in that for loop at ~line 64 is throwing away all handles hmhm, OR the lstHandles are incomplete for whatever reason.

kokolihapihvi commented 6 years ago

The bit you are looking at there is the file handle querying, first it gets a list of all handles on the system, then it filters them down to handles that belong to the process, then it further filters them down to file handles, after that it will run some regex on the filepaths to see if they are dlc files. This is how RockSniffer determines the current dlc file that is being accessed by rocksmith.

This is the first routine I implemented, and I don't exactly remember the details, but if you figure out a problem somewhere in there, feel free to submit a pull request.

It can return an empty list if rocksmith is currently not accessing any dlc file. You can use windows resource monitor to see all handles that belong to rocksmith.

Friedfisch commented 6 years ago

After reading too much and trying out c# examples and even check current code against API doc i finally managed to crash PC. :D I "guess" maybe its int vs uint somewhere but no clue at all. This "if (shHandle.ProcessID != process.Id) continue;" never matches and all the shHandlePids are way smaller than rsPid (which matches resource monitor) - i even tried to just add them all and let 'em load which crashes the toolkit dll on pipes or whatever. Intersting thing about returning ALL handles: the actual dlc handle was in the list (program was able to resolve filename).

Friedfisch commented 6 years ago

Short update: works fine if i start it first - not sure if chatty or obs or java in general breaks it for me.

kokolihapihvi commented 6 years ago

Can you verify that the issue still exists with version 0.1.2_PR2 (the latest commit)?

Other programs shouldn't interfere with the program.

Friedfisch commented 6 years ago

Latest version is having that access violation (from Issue#3) as soon as RS is running.

kokolihapihvi commented 6 years ago

I'm reasonably confident that is issue is also fixed by the newest release, and I'm closing this issue. If not, feel free to reopen or create a new issue.