Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise D3DDevice_KickOff oovpa for 5455, fit 5849 #143

Merged
merged 4 commits into from
Jul 5, 2021

Conversation

jackchentwkh
Copy link
Contributor

revise D3DDevice_KickOff oovpa for 5455
original oovpa won't fit on 5849
the newly revised oovpa is much simpler and fit for 5455~5849
verified with Otogi:5455, 5849 xdk beginpush sample.

revise D3DDevice_KickOff oovpa for 5455
original oovpa won't fit on 5849
the newly revised oovpa is much simpler and fit for 5455~5849
verified with Otogi:5455, 5849 xdk beginpush sample.
@github-actions github-actions bot added D3D8 OOVPA relative topic needs-verification Require verification before approval OOVPA Any OOVPA change relative labels Jul 4, 2021
revise to OV_MATCH(),
remove additional line
revise again, separate lines per opcode, add comment
@RadWolfie
Copy link
Member

@PatrickvL's quote:

OV_MATCH(....); // MOVC ..., ...

That's not how we do it here. See https://github.com/Cxbx-Reloaded/XbSymbolDatabase/wiki/Maintaining-OOVPAs-for-Symbol-detection#too-long-didnt-read as example reference and active OV_MATCH in the general codebase.

There are times we have a comment note on same line as OV_MATCH for any difference recongization over time is what reserved for.

@RadWolfie
Copy link
Member

Base on this signature revision, I fail to see how it can increase strength when it's using common known op code.

@RadWolfie
Copy link
Member

RadWolfie commented Jul 4, 2021

OOVPA_XREF(D3DDevice_KickOff, 5455, 1 + 12,

           XREF_D3D_CDevice_KickOff,
           XRefOne)
{
    // mov eax, XREF_D3DDEVICE
    XREF_ENTRY(0x1A, XREF_D3DDEVICE), // Derived

    // push esi
    // mov esi, ecx
    OV_MATCH(0x00, 0x56, 0x8B, 0xF1),
    // mov eax, [esi + 8]
    // test al, 0x04
    OV_MATCH(0x03, 0x8B, 0x46, 0x08, 0xA8, 0x04),

    // test ah, 0x20
    OV_MATCH(0x14, 0xF6, 0xC4, 0x20),

    // mov eax, XREF_D3DDEVICE
    OV_MATCH(0x19, 0xA1),

} OOVPA_END;

Above signature is suggestive way to safeguard false positives and use proper format in our current codebase's method.

@jackchentwkh
Copy link
Contributor Author

@RadWolfie I read your OOVPA, it's very clear and also suit 5849.
but when I use it and run with xdk beginpush sample, it won't detect the kickoff() as expected.
I have to move the
XREF_ENTRY(0x20, XREF_D3DDEVICE), // Derived
to make it work.
it's very strange.
the XREF_D3DDEVICE is indeed detected as Symbol: 0x0002f308 -> D3DDEVICE 0 which does match the disassembly code.
anyone can explain what might be wrong?

@RadWolfie
Copy link
Member

RadWolfie commented Jul 5, 2021

Actually, that was my fault. It should be offset 0x1A for XREF_D3DDEVICE address. I didn't use the hexadecimal increment process in my mind. I made a correction in my post.

revised per @RadWolfie input
also correct the offset of
XREF_ENTRY(0x1A, XREF_D3DDEVICE),
from 0x20 to 0x1A
after verification.
@jackchentwkh
Copy link
Contributor Author

Haa, I made the same mistake when I checked the code with the disassembly.
thanks a lot.

@RadWolfie RadWolfie removed the needs-verification Require verification before approval label Jul 5, 2021
Copy link
Member

@RadWolfie RadWolfie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already verified titles with 5455, 5788, and 5849 builds.

@RadWolfie RadWolfie merged commit fc3078b into Cxbx-Reloaded:master Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D8 OOVPA relative topic OOVPA Any OOVPA change relative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants