diff options
Diffstat (limited to 'sysutils/scanmem/files')
-rw-r--r-- | sysutils/scanmem/files/patch-common.h | 22 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-gui-GameConqueror.py | 28 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-gui-gameconqueror.in | 15 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-handlers.c | 12 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-interrupt.h | 11 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-maps.c | 30 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-ptrace.c | 52 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-scanroutines.c | 20 | ||||
-rw-r--r-- | sysutils/scanmem/files/patch-targetmem.h | 11 |
9 files changed, 201 insertions, 0 deletions
diff --git a/sysutils/scanmem/files/patch-common.h b/sysutils/scanmem/files/patch-common.h new file mode 100644 index 000000000000..99e55ac377fe --- /dev/null +++ b/sysutils/scanmem/files/patch-common.h @@ -0,0 +1,22 @@ +--- common.h.orig 2017-10-13 21:53:16 UTC ++++ common.h +@@ -28,7 +28,9 @@ + + /* from string.h in glibc for Android/BSD */ + #ifndef strdupa ++# ifdef HAVE_ALLOCA_H + # include <alloca.h> ++# endif + # include <string.h> + # define strdupa(s) \ + ({ \ +@@ -40,7 +42,9 @@ + #endif + + #ifndef strndupa ++# ifdef HAVE_ALLOCA_H + # include <alloca.h> ++# endif + # include <string.h> + # define strndupa(s, n) \ + ({ \ diff --git a/sysutils/scanmem/files/patch-gui-GameConqueror.py b/sysutils/scanmem/files/patch-gui-GameConqueror.py new file mode 100644 index 000000000000..0a0e560bfff9 --- /dev/null +++ b/sysutils/scanmem/files/patch-gui-GameConqueror.py @@ -0,0 +1,28 @@ +--- gui/GameConqueror.py.orig 2017-10-13 21:53:16 UTC ++++ gui/GameConqueror.py +@@ -909,7 +909,7 @@ class GameConqueror(): + + def get_process_list(self): + plist = [] +- for proc in os.popen('ps -wweo pid=,user:16=,command= --sort=-pid').readlines(): ++ for proc in reversed(os.popen('ps -axww -o pid= -o user= -o command=').readlines()): + (pid, user, pname) = [tok.strip() for tok in proc.split(None, 2)] + plist.append((int(pid), user, pname)) + return plist +@@ -942,7 +942,7 @@ class GameConqueror(): + self.cheatlist_liststore[i][1] = False + + def read_maps(self): +- lines = open('/proc/%d/maps' % (self.pid,)).readlines() ++ lines = open('/compat/linux/proc/%d/maps' % (self.pid,)).readlines() + self.maps = [] + for l in lines: + item = {} +@@ -1190,7 +1190,6 @@ if __name__ == '__main__': + args = parser.parse_args() + + # Init application +- GObject.threads_init() + Gdk.threads_init() + gc_instance = GameConqueror() + diff --git a/sysutils/scanmem/files/patch-gui-gameconqueror.in b/sysutils/scanmem/files/patch-gui-gameconqueror.in new file mode 100644 index 000000000000..c6e528dd84f8 --- /dev/null +++ b/sysutils/scanmem/files/patch-gui-gameconqueror.in @@ -0,0 +1,15 @@ +--- gui/gameconqueror.in.orig 2017-10-13 21:53:16 UTC ++++ gui/gameconqueror.in +@@ -1,10 +1,5 @@ +-#!/bin/bash ++#!/bin/sh + + DATADIR=@PKGDATADIR@ + +-PKEXEC=$(command -v "pkexec") +-if [ -n "$PKEXEC" ]; then +- $PKEXEC $DATADIR/GameConqueror.py "$@" +-else +- echo "install policykit!" +-fi ++exec "$DATADIR/GameConqueror.py" "$@" diff --git a/sysutils/scanmem/files/patch-handlers.c b/sysutils/scanmem/files/patch-handlers.c new file mode 100644 index 000000000000..7a0b6e899ece --- /dev/null +++ b/sysutils/scanmem/files/patch-handlers.c @@ -0,0 +1,12 @@ +--- handlers.c.orig 2017-10-13 21:53:16 UTC ++++ handlers.c +@@ -38,7 +38,9 @@ + #include <signal.h> + #include <assert.h> + #include <setjmp.h> ++#ifdef HAVE_ALLOCA_H + #include <alloca.h> ++#endif + #include <strings.h> + #include <string.h> + #include <stdbool.h> diff --git a/sysutils/scanmem/files/patch-interrupt.h b/sysutils/scanmem/files/patch-interrupt.h new file mode 100644 index 000000000000..b9ed48a2fc06 --- /dev/null +++ b/sysutils/scanmem/files/patch-interrupt.h @@ -0,0 +1,11 @@ +--- interrupt.h.orig 2017-10-13 21:53:16 UTC ++++ interrupt.h +@@ -30,7 +30,7 @@ + /* small header file to manage interrupted commands */ + + static sigjmp_buf jmpbuf; /* used when aborting a command due to an interrupt */ +-static sighandler_t oldsig; /* reinstalled before longjmp */ ++static sig_t oldsig; /* reinstalled before longjmp */ + static unsigned intused; + + /* signal handler used to handle an interrupt during commands */ diff --git a/sysutils/scanmem/files/patch-maps.c b/sysutils/scanmem/files/patch-maps.c new file mode 100644 index 000000000000..689513281c75 --- /dev/null +++ b/sysutils/scanmem/files/patch-maps.c @@ -0,0 +1,30 @@ +--- maps.c.orig 2017-10-13 21:53:16 UTC ++++ maps.c +@@ -31,7 +31,9 @@ + #include <stddef.h> + #include <stdlib.h> + #include <string.h> ++#ifdef HAVE_ALLOCA_H + #include <alloca.h> ++#endif + #include <stdbool.h> + #include <unistd.h> + +@@ -62,7 +64,7 @@ bool sm_readmaps(pid_t target, list_t *regions, region + return false; + + /* construct the maps filename */ +- snprintf(name, sizeof(name), "/proc/%u/maps", target); ++ snprintf(name, sizeof(name), "/compat/linux/proc/%u/maps", target); + + /* attempt to open the maps file */ + if ((maps = fopen(name, "r")) == NULL) { +@@ -73,7 +75,7 @@ bool sm_readmaps(pid_t target, list_t *regions, region + show_info("maps file located at %s opened.\n", name); + + /* get executable name */ +- snprintf(exelink, sizeof(exelink), "/proc/%u/exe", target); ++ snprintf(exelink, sizeof(exelink), "/compat/linux/proc/%u/exe", target); + linkbuf_size = readlink(exelink, exename, MAX_LINKBUF_SIZE - 1); + if (linkbuf_size > 0) + { diff --git a/sysutils/scanmem/files/patch-ptrace.c b/sysutils/scanmem/files/patch-ptrace.c new file mode 100644 index 000000000000..b22f53a6a2ea --- /dev/null +++ b/sysutils/scanmem/files/patch-ptrace.c @@ -0,0 +1,52 @@ +--- ptrace.c.orig 2017-10-13 21:53:16 UTC ++++ ptrace.c +@@ -25,11 +25,13 @@ + + #include "config.h" + ++#if 0 + /* for pread */ + # ifdef _XOPEN_SOURCE + # undef _XOPEN_SOURCE + # endif + # define _XOPEN_SOURCE 500 ++#endif + + #include <time.h> + #include <sys/types.h> +@@ -406,7 +408,7 @@ bool sm_checkmatches(globals_t *vars, + return sm_detach(vars->target); + } + +-/* read region using /proc/pid/mem */ ++/* read region using /compat/linux/proc/pid/mem */ + static inline ssize_t readregion(pid_t target, void *buf, size_t count, unsigned long offset) + { + char mem[32]; +@@ -414,7 +416,7 @@ static inline ssize_t readregion(pid_t target, void *b + ssize_t len; + + /* print the path to mem file */ +- snprintf(mem, sizeof(mem), "/proc/%d/mem", target); ++ snprintf(mem, sizeof(mem), "/compat/linux/proc/%d/mem", target); + + /* attempt to open the file */ + if ((fd = open(mem, O_RDONLY)) == -1) { +@@ -650,7 +652,7 @@ bool sm_setaddr(pid_t target, void *addr, const value_ + return false; + } + +- /* TODO: may use /proc/<pid>/mem here */ ++ /* TODO: may use /compat/linux/proc/<pid>/mem here */ + for (i = 0; i < sizeof(uint64_t)/sizeof(long); i++) + { + if (ptrace(PTRACE_POKEDATA, target, addr + i*sizeof(long), memarray[i]) == -1L) { +@@ -704,7 +706,7 @@ bool sm_read_array(pid_t target, const void *addr, cha + #endif + } + +-/* TODO: may use /proc/<pid>/mem here */ ++/* TODO: may use /compat/linux/proc/<pid>/mem here */ + bool sm_write_array(pid_t target, void *addr, const void *data, int len) + { + int i,j; diff --git a/sysutils/scanmem/files/patch-scanroutines.c b/sysutils/scanmem/files/patch-scanroutines.c new file mode 100644 index 000000000000..373a310f3393 --- /dev/null +++ b/sysutils/scanmem/files/patch-scanroutines.c @@ -0,0 +1,20 @@ +--- scanroutines.c.orig 2017-10-13 21:53:16 UTC ++++ scanroutines.c +@@ -369,7 +369,7 @@ extern inline unsigned int scan_routine_BYTEARRAY_EQUA + { + const uint8_t *bytes_array = user_value->bytearray_value; + const wildcard_t *wildcards_array = user_value->wildcard_value; +- uint length = user_value->flags; ++ unsigned int length = user_value->flags; + if (memlength < length || + *((uint64_t*)bytes_array) != (memory_ptr->uint64_value & *((uint64_t*)wildcards_array))) + { +@@ -470,7 +470,7 @@ DEFINE_BYTEARRAY_SMALLOOP_EQUALTO_ROUTINE(56) + extern inline unsigned int scan_routine_STRING_EQUALTO SCAN_ROUTINE_ARGUMENTS + { + const char *scan_string = user_value->string_value; +- uint length = user_value->flags; ++ unsigned int length = user_value->flags; + if(memlength < length || + memory_ptr->int64_value != *((int64_t*)scan_string)) + { diff --git a/sysutils/scanmem/files/patch-targetmem.h b/sysutils/scanmem/files/patch-targetmem.h new file mode 100644 index 000000000000..b206889a7c92 --- /dev/null +++ b/sysutils/scanmem/files/patch-targetmem.h @@ -0,0 +1,11 @@ +--- targetmem.h.orig 2017-10-13 21:53:16 UTC ++++ targetmem.h +@@ -257,7 +257,7 @@ static inline value_t + data_to_val_aux (const matches_and_old_values_swath *swath, + size_t index, size_t swath_length) + { +- uint i; ++ unsigned int i; + value_t val; + size_t max_bytes = swath_length - index; + |