mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
WIP: Add asserts for segment overrides
This commit is contained in:
parent
addadb2a2d
commit
483ce75769
@ -815,6 +815,7 @@ auto TranslateCode(u08* runtime_address, u64 context_base) -> PS4_SYSV_ABI u64 (
|
|||||||
bool UsesFlags = false;
|
bool UsesFlags = false;
|
||||||
|
|
||||||
if (instruction.info.meta.branch_type != ZYDIS_BRANCH_TYPE_NONE) {
|
if (instruction.info.meta.branch_type != ZYDIS_BRANCH_TYPE_NONE) {
|
||||||
|
assert((instruction.info.attributes & (ZYDIS_ATTRIB_HAS_SEGMENT_FS | ZYDIS_ATTRIB_HAS_SEGMENT_GS)) == 0);
|
||||||
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL || instruction.info.mnemonic == ZYDIS_MNEMONIC_JMP) {
|
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL || instruction.info.mnemonic == ZYDIS_MNEMONIC_JMP) {
|
||||||
|
|
||||||
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL) {
|
if (instruction.info.mnemonic == ZYDIS_MNEMONIC_CALL) {
|
||||||
@ -957,6 +958,8 @@ auto TranslateCode(u08* runtime_address, u64 context_base) -> PS4_SYSV_ABI u64 (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
assert((instruction.info.attributes & (ZYDIS_ATTRIB_HAS_SEGMENT_FS | ZYDIS_ATTRIB_HAS_SEGMENT_GS)) == 0);
|
||||||
|
|
||||||
for (int i = 0; i < instruction.info.operand_count; i++) {
|
for (int i = 0; i < instruction.info.operand_count; i++) {
|
||||||
auto operand = &instruction.operands[i];
|
auto operand = &instruction.operands[i];
|
||||||
if (operand->type == ZYDIS_OPERAND_TYPE_REGISTER) {
|
if (operand->type == ZYDIS_OPERAND_TYPE_REGISTER) {
|
||||||
|
Loading…
Reference in New Issue
Block a user