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

A strange behavior in the ShowSegmentRegs option. #44

Open
singlefreshBird opened this issue Apr 28, 2024 · 0 comments
Open

A strange behavior in the ShowSegmentRegs option. #44

singlefreshBird opened this issue Apr 28, 2024 · 0 comments

Comments

@singlefreshBird
Copy link

My code:

/*
 * mov rax,qword ptr ds:[2D40D36016C]
 * mov qword ptr ds:[2D4127C48A2],rax
 * lea rdx,qword ptr ds:[2D40DB7449C]
*/
unsigned char Ins[]="\x48\x8B\x05\x65\x01\x00\x00\x48\x89\x05\x94\x48\x46\x05\x48\x8D\x15\x87\x44\x81\x00";
DISASM disAsm = {0};
int len;
unsigned char* pEnd = Ins + Size;

disAsm.VirtualAddr = 0x18100000000;
disAsm.EIP = (UInt64)Ins;
disAsm.Archi = 0x40;		// 0x40 = x64,0x20 = x86
disAsm.Options = MasmSyntax | ShowSegmentRegs  | PrefixedNumeral;

while (!disAsm.Error)
{
disAsm.SecurityBlock = (UInt64)(pEnd - disAsm.EIP);
if (disAsm.SecurityBlock <= 0) break;

len = Disasm(&disAsm);

switch (disAsm.Error)
{
case OUT_OF_BLOCK:
	break;
case UNKNOWN_OPCODE:
	printf("%s \n", &disAsm.CompleteInstr);
	disAsm.EIP += 1;
	disAsm.Error = 0;
	break;
default:
	
	printf("%s \n", &disAsm.CompleteInstr);
	disAsm.EIP += len;
	break;
}
}

Output:

mov rax, qword ptr ??:[0x000001810000016C]
mov qword ptr ??:[0x000001810546489B], rax
lea rdx, qword ptr ??:[0x000001810081448E]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant