Skip to content

Commit

Permalink
Add test case for mov reg, imm64 but it already worked, bug fixed man…
Browse files Browse the repository at this point in the history
…y years ago. (#117)
  • Loading branch information
jaykrell authored Sep 2, 2020
1 parent 244b243 commit 5f674df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions samples/disas/disas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,26 @@ int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmd
(void)hinst;
(void)lpszCmdLine;
(void)nCmdShow;

// Bug report, but it works here.
// 07ff8`4b783054 49ba 70b3d93a d40fb998 mov r10,98B90FD43AD9B370h
//
{
static const UCHAR mov_r10_imm64[] = {0x49, 0xba, 1, 2, 3, 4, 5, 6, 7, 8 };

PVOID const after = DetourCopyInstructionX64(0, 0, const_cast<PUCHAR>(mov_r10_imm64), 0, 0);

if (after != &mov_r10_imm64 + 1)
{
printf("mov_r10_imm64 failed, expected:%p vs. got:%p\n", &mov_r10_imm64 + 1, after);
if (IsDebuggerPresent())
{
__debugbreak();
DetourCopyInstructionX64(0, 0, const_cast<PUCHAR>(mov_r10_imm64), 0, 0);
}
return 1;
}
}

#ifdef DETOURS_IA64
// First we check the pre-canned TestCodes from disasm.asm
Expand Down

0 comments on commit 5f674df

Please sign in to comment.