Skip to content

YYToolkit fails to look up rooms in 2024.2+ VM #67

@Archie-osu

Description

@Archie-osu

YYToolkit fails to find the array used in Room_Data in 2024.2+ VM runners.
The problem is in multiple places at once:

First up, YYTK::VM::GmpFindRoomData should contain the following check (might also wanna include in YYC if applicable):

// Reject stupidity like mov reg, [reg] - we have to have displacement
if (!mov_instruction.operands[1].mem.disp.has_displacement)
	return AURIE_INVALID_SIGNATURE;

Next up, it's possible this pattern repeats multiple times, such as in the current 2024.2.0.163 runner:

; pattern 1, not it
mov r9, [rcx] ; doesn't have displacement, is rejected by proposed check
mov rax, cs:qword_140DB0C08 
test rax, rax
jz short loc_14028A05A

; pattern 2, actually it
mov rax, cs:qword_140B62330 ; the actual array, has displacement
mov rbx, [rax+rbx*8]
test rbx, rbx
jz short loc_14028A0C1

The current behavior of VM::GmpFindRoomData is to trust the first mnemonic pattern match as the correct one, which isn't true here.

Metadata

Metadata

Assignees

Labels

vm onlyThis issue only exists in VM runners

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions