Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/OOVPADatabase/D3D8/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -5308,17 +5308,22 @@ OOVPA_SIG_MATCH(
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
3911)
OOVPA_SIG_MATCH(

{ 0x00, 0x81 },
{ 0x10, 0x0F },
{ 0x11, 0xB6 },
{ 0x12, 0x75 },
{ 0x13, 0x0D },
{ 0x14, 0x8A },
{ 0x15, 0x9E },
{ 0x40, 0xF6 },
{ 0x4F, 0x84 },
{ 0x75, 0x15 },
// sub esp, 0x___ (always 0x1A0)
OV_MATCH(0x00, 0x81, 0xEC),

// mov ebp, [esp + param_1]
OV_MATCH(0x08, 0x8B, 0xAC, 0x24),

// movzx esi, [ebp + 0x0D]
OV_MATCH(0x10, 0x0F, 0xB6, 0x75, 0x0D),
// mov bl, [esi + 0x____]
OV_MATCH(0x14, 0x8A, 0x9E),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);

Expand Down
18 changes: 0 additions & 18 deletions src/OOVPADatabase/D3D8/4034.inl
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,6 @@ OOVPA_SIG_MATCH(
//
);

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
4034)
OOVPA_SIG_MATCH(

{ 0x1E, 0x57 },
{ 0x3E, 0xF6 },
{ 0x5E, 0xEB },
{ 0x7E, 0x00 },
{ 0x9E, 0x10 },
{ 0xBE, 0x24 },
{ 0xDE, 0x22 },
{ 0xFE, 0x14 },
//
);

// ******************************************************************
// * D3DDevice_DrawIndexedVertices
// ******************************************************************
Expand Down
25 changes: 16 additions & 9 deletions src/OOVPADatabase/D3D8/4627.inl
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,22 @@ OOVPA_SIG_MATCH(
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
4627)
OOVPA_SIG_MATCH(

{ 0x1E, 0x57 },
{ 0x3E, 0xF6 },
{ 0x5E, 0x00 },
{ 0x7E, 0x01 },
{ 0x9E, 0x00 },
{ 0xBE, 0x0C },
{ 0xDE, 0xF7 },
{ 0xFE, 0x00 },
// sub esp, 0x___ (always 0x194)
OV_MATCH(0x00, 0x81, 0xEC),

// mov eax, [esp + param_1]
OV_MATCH(0x06, 0x8B, 0x84, 0x24),

// movzx ebp, [eax + 0x0D]
OV_MATCH(0x0F, 0x0F, 0xB6, 0x68, 0x0D),
// mov bl, [ebp + 0x____]
OV_MATCH(0x13, 0x8A, 0x9D),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);

Expand Down
23 changes: 15 additions & 8 deletions src/OOVPADatabase/D3D8/5120.inl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ OOVPA_SIG_MATCH(
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
5120)
OOVPA_SIG_MATCH(
// sub esp, 0x__ (always 0x34)
OV_MATCH(0x00, 0x83, 0xEC),

{ 0x1E, 0xE1 },
{ 0x42, 0x84 },
{ 0x5E, 0x24 },
{ 0x7E, 0x8B },
{ 0x9E, 0x1C },
{ 0xBE, 0x00 },
{ 0xDE, 0xBD },
{ 0xFE, 0x4C },
// mov eax, [esp + param_1]
OV_MATCH(0x03, 0x8B, 0x44, 0x24),

// movzx ebp, [eax + 0x0D]
OV_MATCH(0x09, 0x0F, 0xB6, 0x68, 0x0D),
// mov bl, [ebp + 0x____]
OV_MATCH(0x0D, 0x8A, 0x9D),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);
27 changes: 27 additions & 0 deletions src/OOVPADatabase/D3D8LTCG/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1495,3 +1495,30 @@ OOVPA_SIG_MATCH(
OV_MATCH(0x30, 0x57),
//
);

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
// Test case:
// Bruce Lee: QOD (4432)
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
3911)
OOVPA_SIG_MATCH(
// sub esp, 0x___ (always 0x1A0)
OV_MATCH(0x00, 0x81, 0xEC),

// mov ebp, [esp + param_1]
OV_MATCH(0x08, 0x8B, 0xAC, 0x24),

// movzx esi, [ebp + 0x0D]
OV_MATCH(0x13, 0x0F, 0xB6, 0x75, 0x0D),
// mov bl, [esi + 0x____]
OV_MATCH(0x17, 0x8A, 0x9E),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);
63 changes: 48 additions & 15 deletions src/OOVPADatabase/D3D8LTCG/4627.inl
Original file line number Diff line number Diff line change
Expand Up @@ -284,24 +284,57 @@ OOVPA_SIG_MATCH(
//
);

//******************************************************************
//* D3DDevice_CopyRects
//******************************************************************
//81EC940100008B842498
// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
// Test case:
// DDS9 (4928)
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
1036)
4627)
OOVPA_SIG_MATCH(
// sub esp, 0x___ (always 0x194)
OV_MATCH(0x00, 0x81, 0xEC),

// mov esi, [esp + param_1]
OV_MATCH(0x09, 0x8B, 0xB4, 0x24),
// movzx edx, [esi + 0x0D]
OV_MATCH(0x10, 0x0F, 0xB6, 0x56, 0x0D),
// mov bl, [edx + 0x____]
OV_MATCH(0x14, 0x8A, 0x9A),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);

{ 0x00, 0x81 },
{ 0x01, 0xEC },
{ 0x02, 0x94 },
{ 0x03, 0x01 },
{ 0x04, 0x00 },
{ 0x05, 0x00 },
{ 0x06, 0x8B },
{ 0x07, 0x84 },
{ 0x08, 0x24 },
{ 0x09, 0x98 },
// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
// TODO: May could be lower down to 3911 as the 4627+ is very
// similar to 3911+ assembly instructions structure.
// Test case:
// Rally Fusion : Race Of Champions (4928)
// Enter The Matrix (5344)
// The Italian Job (5344)
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
4628)
OOVPA_SIG_MATCH(
// mov edx, [esp + param_1]
OV_MATCH(0x00, 0x8B, 0x54, 0x24, 0x04),
// mov ecx, [edx + 0x10]
OV_MATCH(0x04, 0x8B, 0x4A, 0x10),
// sub esp, 0x___ (always 0x194 or 0x34 for 5120 and later)
// offset 0x07 will have 0x81 for 4627 until 5120 and later has 0x83.
OV_MATCH(0x08, 0xEC),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);

Expand Down
21 changes: 0 additions & 21 deletions src/OOVPADatabase/D3D8LTCG/4928.inl
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
// SPDX-License-Identifier: ODbL-1.0

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
//81EC940100005355568B
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
1048)
OOVPA_SIG_MATCH(

{ 0x00, 0x81 },
{ 0x01, 0xEC },
{ 0x02, 0x94 },
{ 0x03, 0x01 },
{ 0x04, 0x00 },
{ 0x05, 0x00 },
{ 0x06, 0x53 },
{ 0x07, 0x55 },
{ 0x08, 0x56 },
{ 0x09, 0x8B },
//
);

// ******************************************************************
// * D3DDevice_CreateTexture2
// ******************************************************************
Expand Down
50 changes: 50 additions & 0 deletions src/OOVPADatabase/D3D8LTCG/5120.inl
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,53 @@ OOVPA_SIG_MATCH(
{ 0x19, 0x4E },
//
);

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
5120)
OOVPA_SIG_MATCH(
// sub esp, 0x___ (always 0x34)
OV_MATCH(0x00, 0x83, 0xEC),

// mov esi, [esp + param_1]
OV_MATCH(0x06, 0x8B, 0x74, 0x24),
// movzx ebp, [esi + 0x0D]
OV_MATCH(0x0A, 0x0F, 0xB6, 0x6E, 0x0D),
// mov bl, [ebp + 0x____]
OV_MATCH(0x0E, 0x8A, 0x9D),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
// Test case:
// Freaky Flyers (5455)
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
5121)
OOVPA_SIG_MATCH(
// sub esp, 0x___ (always 0x34)
OV_MATCH(0x00, 0x83, 0xEC),

// mov esi, [esp + param_1]
OV_MATCH(0x06, 0x8B, 0x74, 0x24),
// movzx ebp, [esi + 0x0D]
OV_MATCH(0x0A, 0x0F, 0xB6, 0x6E, 0x0D),
// movzx eax, [ebp + 0x____]
OV_MATCH(0x0E, 0x0F, 0xB6, 0x85),

// Few instructions later will always have
// shr e__, 0x3
// and e__, 0x7
// except above instructions could not be added into the signature
// because of the offset changing over time.
//
);
22 changes: 0 additions & 22 deletions src/OOVPADatabase/D3D8LTCG/5455.inl
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
// SPDX-License-Identifier: ODbL-1.0

// ******************************************************************
// * D3DDevice_CopyRects
// ******************************************************************
//83EC345355568B7424440F
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_CopyRects,
1024)
OOVPA_SIG_MATCH(

{ 0x00, 0x83 },
{ 0x01, 0xEC },
{ 0x02, 0x34 },
{ 0x03, 0x53 },
{ 0x04, 0x55 },
{ 0x05, 0x56 },
{ 0x06, 0x8B },
{ 0x07, 0x74 },
{ 0x08, 0x24 },
{ 0x09, 0x44 },
{ 0x0A, 0x0F },
//
);

// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG_OOVPA.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static OOVPATable D3D8LTCG_OOVPA_Table[] = {
REGISTER_OOVPAS(SYM_FUN(D3DDevice_Clear, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Count), PARAM(psh, pRects), PARAM(psh, Flags), PARAM(psh, Color), PARAM(psh, Z), PARAM(psh, Stencil))),
SYM_SIG(1024, 1036)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_CopyRects, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, pSourceSurface), PARAM(psh, pSourceRectsArray), PARAM(psh, cRects), PARAM(psh, pDestinationSurface), PARAM(psh, pDestPointsArray))),
SYM_SIG(1024, 1036, 1048)),
SYM_SIG(3911, 4627, 4628, 5120, 5121)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_CreateCubeTexture, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, EdgeLength), PARAM(psh, Levels), PARAM(psh, Usage), PARAM(psh, Format), PARAM(psh, Pool), PARAM(psh, ppCubeTexture))),
SYM_SIG(4432)),
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_CreateCubeTexture, CALL(unk), STACK(4), PARAMS(PARAM(eax, EdgeLength), PARAM(psh, Levels), PARAM(edx, Usage), PARAM(ecx, Format), PARAM(psh, Pool), PARAM(edi, ppCubeTexture))),
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8_OOVPA.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static OOVPATable D3D8_OOVPA_Table[] = {
REGISTER_OOVPAS(SYM_FUN(D3DDevice_Clear, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Count), PARAM(psh, pRects), PARAM(psh, Flags), PARAM(psh, Color), PARAM(psh, Z), PARAM(psh, Stencil))),
SYM_SIG(3911, 4034)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_CopyRects, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, pSourceSurface), PARAM(psh, pSourceRectsArray), PARAM(psh, cRects), PARAM(psh, pDestinationSurface), PARAM(psh, pDestPointsArray))),
SYM_SIG(3911, 4034, 4627, 5120)),
SYM_SIG(3911, 4627, 5120)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_CreateCubeTexture, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, EdgeLength), PARAM(psh, Levels), PARAM(psh, Usage), PARAM(psh, Format), PARAM(psh, Pool), PARAM(psh, ppCubeTexture))),
SYM_SIG(3911, 4627)),
REGISTER_OOVPAS(SYM_FUN(D3DDevice_CreateImageSurface, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Width), PARAM(psh, Height), PARAM(psh, Format), PARAM(psh, ppBackBuffer))),
Expand Down
Loading