Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find out which map is currently being played in osu!?
#1
Hello!
I hope this isn't wrong here.
Anyways, I've been working on my own relax bot for osu! as well, like many others do, just for the fun of it.
But I've run into a problem now: How do I find out which beatmap is currently being played?
I mean, I could let the user select it himself in the bot. That works just fine, but it's just not what I really want, it's plainly annoying, and other people got it to work proberly as well, right? Also, it would need a GUI which isn't really advantageous for staying undetected after all.
I've heard people analyze the window title, but there was a problem, too:
Some maps it's exactly the same so you can't differentiate between them just based on that. An example would be the insane difficulty on these two maps. one two
Quote:osu!  - Wake Up, Girls! - Tachiagare! (TV Size) [Insane]
Then I've had the idea to look for the BeatmapID or the BeatmapSetID within the running osu!-process, but to no avail. Maybe I'm just too stupid for that, but a friend of mine didn't have any success either so I guess that doesn't work after all. If it's is indeed possible and I did something wrong I'd really appreciate if somebody could help me out there.
I didn't find anything, searching for the name of the map either.
Anyways, I've run out of ideas. How can you find out which specific beatmap is being played right now? Or is it impossible and you have to guess between the possibilities? Kappa
Thank you! Smile
Reply
#2
You could read the notes from memory, like kev does, but that's rather advanced. Most bots use the window title. If duplicate maps is such a problem for you, you can prompt the user to select the right one.
Reply
#3
(01-10-2016, 04:39 AM)JustM3 Wrote: You could read the notes from memory, like kev does, but that's rather advanced. Most bots use the window title. If duplicate maps is such a problem for you, you can prompt the user to select the right one.

Thanks for the reply. I'll try to search them in the memory, but I'll probably fail miserably. Big Grin
Otherwise I'll try your second idea. That doesn't sound too bad after all and is definitely feasable for me. Smile
Reply
#4
(01-10-2016, 04:58 AM)xeddda Wrote:
(01-10-2016, 04:39 AM)JustM3 Wrote: You could read the notes from memory, like kev does, but that's rather advanced. Most bots use the window title. If duplicate maps is such a problem for you, you can prompt the user to select the right one.

Thanks for the reply. I'll try to search them in the memory, but I'll probably fail miserably. Big Grin
Otherwise I'll try your second idea. That doesn't sound too bad after all and is definitely feasable for me. Smile
Okay, if you have any more questions, feel free to ask Smile
Reply
#5
You can also use the MD5 of the .osu file along with a list of MD5 - .osuFilepath pairs to find it quickly and avoid naming conflicts.
xor ecx, ecx
mul ecx
push ecx
push 0x68732f2f
push 0x6e69622f
mov ebx, esp
mov al, 11
int 0x80


Reply
#6
(01-10-2016, 05:46 AM)JustM3 Wrote:
(01-10-2016, 04:58 AM)xeddda Wrote:
(01-10-2016, 04:39 AM)JustM3 Wrote: You could read the notes from memory, like kev does, but that's rather advanced. Most bots use the window title. If duplicate maps is such a problem for you, you can prompt the user to select the right one.

Thanks for the reply. I'll try to search them in the memory, but I'll probably fail miserably. Big Grin
Otherwise I'll try your second idea. That doesn't sound too bad after all and is definitely feasable for me. Smile
Okay, if you have any more questions, feel free to ask Smile

Okay, thank you. Big Grin
I have trouble locating the notes in memory. I mean, I know that it isn't easy but do you know how I could find them?
I've only been using Cheat Engine so far but I'm not really sure how that could be used for this efficiently.
I could imagine that it would be possible to use some kind of native debugger and set some WinApi breakpoint to find out when a file is opened, namely the beatmap file, and then look how the data is processed and where it ends up to be used to play.
But I have virtually no experience with such programs, nor am I confident in my ability to analyze the code sufficiently to a degree that would allow me to find the place the data ends at.
That's how it is. Well, maybe this project just isn't something I should be doing yet with the amount of experience I have. :/
Reply
#7
(01-10-2016, 06:46 AM)xeddda Wrote:
(01-10-2016, 05:46 AM)JustM3 Wrote:
(01-10-2016, 04:58 AM)xeddda Wrote:
(01-10-2016, 04:39 AM)JustM3 Wrote: You could read the notes from memory, like kev does, but that's rather advanced. Most bots use the window title. If duplicate maps is such a problem for you, you can prompt the user to select the right one.

Thanks for the reply. I'll try to search them in the memory, but I'll probably fail miserably. Big Grin
Otherwise I'll try your second idea. That doesn't sound too bad after all and is definitely feasable for me. Smile
Okay, if you have any more questions, feel free to ask Smile

Okay, thank you. Big Grin
I have trouble locating the notes in memory. I mean, I know that it isn't easy but do you know how I could find them?
I've only been using Cheat Engine so far but I'm not really sure how that could be used for this efficiently.
I could imagine that it would be possible to use some kind of native debugger and set some WinApi breakpoint to find out when a file is opened, namely the beatmap file, and then look how the data is processed and where it ends up to be used to play.
But I have virtually no experience with such programs, nor am I confident in my ability to analyze the code sufficiently to a degree that would allow me to find the place the data ends at.
That's how it is. Well, maybe this project just isn't something I should be doing yet with the amount of experience I have. :/

Using a debugger for this is overkill, especially if you don't have experience with them, I suppose you could use Proccess Monitor from SysInternals if you wanted too look at any api calls made by osu! but it probably wont help as much as you think, try looking for individual notes by searching for their coordinates using CE or find the MD5 of the current map and all of the note info will probably be near it in memory. If none of that works for you and you dont want to read the notes from the .osu files another thing to try would be finding a copy of osu that was decompiled or decompiling it yourself if you can manage and look how osu loads beatmaps and how it stores them. For example, if all of the note data is stored in a list and that list is part of a class called "Beatmap" or something, instead of finding the notes search for something else that would be easier to find like the MD5 or song name maybe. Then learn how different data structures are stored in memory in c# and you should be able to figure out more or less how beatmaps are stored in memory.
xor ecx, ecx
mul ecx
push ecx
push 0x68732f2f
push 0x6e69622f
mov ebx, esp
mov al, 11
int 0x80


Reply
#8
(01-10-2016, 06:57 AM)Phyxie~ Wrote: Using a debugger for this is overkill, especially if you don't have experience with them, I suppose you could use Proccess Monitor from SysInternals if you wanted too look at any api calls made by osu! but it probably wont help as much as you think, try looking for individual notes by searching for their coordinates using CE or find the MD5 of the current map and all of the note info will probably be near it in memory. If none of that works for you and you dont want to read the notes from the .osu files another thing to try would be finding a copy of osu that was decompiled or decompiling it yourself if you can manage and look how osu loads beatmaps and how it stores them. For example, if all of the note data is stored in a list and that list is part of a class called "Beatmap" or something, instead of finding the notes search for something else that would be easier to find like the MD5 or song name maybe. Then learn how different data structures are stored in memory in c# and you should be able to figure out more or less how beatmaps are stored in memory.
Thank you. I've actually found the content of the map file before it's parsed by osu! in it's memory. It's only there for some seconds when you start a new song, but I guess it's a step in the right direction. I only have to find a way to always find the information automatically or where it's put to be used later. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)