Skip to content

Commit

Permalink
fix: return SongsFolder reading
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD committed Mar 7, 2024
1 parent 5f86e3e commit 8dbfdb5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packages/tosu/src/entities/AllTimesData/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class AllTimesData extends AbstractEntity {
menuModsPtr,
chatCheckerAddr,
skinDataAddr,
settingsClassAddr,
configurationAddr,
bindingsAddr,
canRunSlowlyAddr,
Expand All @@ -137,6 +138,7 @@ export class AllTimesData extends AbstractEntity {
'menuModsPtr',
'chatCheckerAddr',
'skinDataAddr',
'settingsClassAddr',
'configurationAddr',
'bindingsAddr',
'canRunSlowlyAddr',
Expand Down Expand Up @@ -164,6 +166,13 @@ export class AllTimesData extends AbstractEntity {
this.IsWatchingReplay = process.readByte(
process.readInt(canRunSlowlyAddr + 0x46)
);
this.SongsFolder = process.readSharpString(
process.readInt(
process.readInt(
process.readInt(settingsClassAddr + 0x8) + 0xb8
) + 0x4
)
);

// this.updateConfigState(
// process,
Expand Down
9 changes: 6 additions & 3 deletions packages/tosu/src/objects/instanceManager/osuInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const SCAN_PATTERNS: {
skinDataAddr: {
pattern: '74 2C 85 FF 75 28 A1 ?? ?? ?? ?? 8D 15'
},
settingsClassAddr: {
pattern: '83 E0 20 85 C0 7E 2F'
},
configurationAddr: {
pattern: '7E 07 8D 65 F8 5E 5F 5D C3 E8',
offset: -0xd
Expand Down Expand Up @@ -252,14 +255,14 @@ export class OsuInstance {
settings.setGameFolder(path.join(this.path, '..'));

// condition when user have different BeatmapDirectory in osu! config
if (fs.existsSync(settings.BeatmapDirectory)) {
settings.setSongsFolder(settings.BeatmapDirectory);
if (fs.existsSync(allTimesData.SongsFolder)) {
settings.setSongsFolder(allTimesData.SongsFolder);
} else {
settings.setSongsFolder(
path.join(
this.path,
'../',
settings.BeatmapDirectory
allTimesData.SongsFolder
)
);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/tosu/src/objects/memoryPatterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface PatternData {
playTimeAddr: number;
chatCheckerAddr: number;
skinDataAddr: number;
settingsClassAddr: number;
configurationAddr: number;
bindingsAddr: number;
rulesetsAddr: number;
Expand All @@ -30,6 +31,7 @@ export class MemoryPatterns {
playTimeAddr: 0,
chatCheckerAddr: 0,
skinDataAddr: 0,
settingsClassAddr: 0,
configurationAddr: 0,
bindingsAddr: 0,
rulesetsAddr: 0,
Expand Down

0 comments on commit 8dbfdb5

Please sign in to comment.