miasm icon indicating copy to clipboard operation
miasm copied to clipboard

Cache addr_to_cacheblocks doesn't take SMC into account

Open nofiv opened this issue 5 years ago • 0 comments

Cache addr_to_cacheblocks doesn't take SMC into account. After rediscovering a modified block it uses the old one and leads to a DriftException. For example a hash of block data could be calculated and taken into account with the address to prevent this issue. Example raising the exception:

int main(int argc, char **argv)
{
	__asm {
		push ebx
		mov ebx, 10
		push eax
		jmp self_mod
		loop:
		call abc
		abc:
		pop eax
		add eax, 7
		mov BYTE PTR [eax], 0x4B  # assemble dec ebx
		self_mod:
		inc ebx
		jnz loop
		pop eax  # restore
		pop ebx
	}
	return 0;
}

nofiv avatar Aug 31 '20 03:08 nofiv