Skip to content

Commit fd425f4

Browse files
authored
fixes
1 parent bca9a39 commit fd425f4

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lara/kexploit/darksword.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,10 +1515,14 @@ uint64_t ds_get_our_task(void) {
15151515

15161516
bool ds_isvalid(uint64_t value) {
15171517
if (!value) {
1518-
return NO;
1518+
return false;
15191519
}
1520-
if (VM_MIN_KERNEL_ADDRESS && VM_MAX_KERNEL_ADDRESS) {
1521-
return value >= VM_MIN_KERNEL_ADDRESS && value <= VM_MAX_KERNEL_ADDRESS;
1520+
1521+
uint16_t top_bits = (value >> 48) & 0xFFFF;
1522+
1523+
if (top_bits == 0xFFFF || top_bits == 0xFFFE) {
1524+
return true;
15221525
}
1523-
return (value & 0xffff000000000000ULL) == 0xffff000000000000ULL;
1526+
1527+
return false;
15241528
}

0 commit comments

Comments
 (0)