summary refs log tree commit diff stats
path: root/results/scraper/fex/3675
diff options
context:
space:
mode:
Diffstat (limited to 'results/scraper/fex/3675')
-rw-r--r--results/scraper/fex/367533
1 files changed, 33 insertions, 0 deletions
diff --git a/results/scraper/fex/3675 b/results/scraper/fex/3675
new file mode 100644
index 000000000..2a4727877
--- /dev/null
+++ b/results/scraper/fex/3675
@@ -0,0 +1,33 @@
+Sifu and RDR break FEX's SMC tracking logic
+Both Sifu and RDR break FEX's SMC tracking logic due to the ordering it does mprotects in. Nailed down where it is happening, now I just need to fix it.

+

+small unittest which reproduces without running the full game.

+```cpp

+#include <cstdint>

+#include <sys/mman.h>

+#include <unistd.h>

+#include <sys/syscall.h>

+

+int main() {

+

+  // Original:

+  // Base: 0x6ffffc0b8000

+  // PtrHigh: 0x6ffffc0be000 (+0x6000)

+  // PtrLow: 0x6ffffc0bd000 (+0x5000)

+  const uint64_t PtrBase = 0x10'0000;

+  const uint64_t PtrLow = PtrBase + 0x1000;

+  const uint64_t PtrLowSize = 0x2000;

+  const uint64_t PtrHigh = PtrBase + 0x2000;

+  const uint64_t PtrHighSize = 0x1000;

+  const uint64_t TotalSize = PtrHigh + 0x1000 - PtrBase;

+

+  (void)mmap((void*)PtrBase, TotalSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);

+

+  // Order matters.

+  mprotect((void*)PtrHigh, PtrHighSize, PROT_READ);

+  mprotect((void*)PtrLow, PtrLowSize, PROT_READ);

+

+  ::syscall(SYS_exit_group, 0);

+  return 0;

+}

+```
\ No newline at end of file