summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile14
-rw-r--r--README.md69
-rw-r--r--control11
-rw-r--r--main.c6
-rw-r--r--pokemem.desktop8
6 files changed, 109 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 968adff..8135688 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@ tags
TAGS
*.swp
pokemem
+\#*\#
+*.deb
diff --git a/Makefile b/Makefile
index e77e7c1..7f80cd7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,23 @@ DEBUG_CFLAGS=$(ALL_CFLAGS) -DDEBUG -O0 -g
RELEASE_CFLAGS=$(ALL_CFLAGS) -Ofast -g
PROFILE_CFLAGS=$(ALL_CFLAGS) -Ofast -g -DPROFILE=1
NAME=pokemem
+INSTALL_BIN_DIR=/usr/bin
+GLOBAL_DATA_DIR=/usr/share/pokemem
$(NAME): *.[ch]
$(CC) main.c -o $(NAME) $(DEBUG_CFLAGS)
release: *.[ch]
$(CC) main.c -o $(NAME) $(RELEASE_CFLAGS)
clean:
rm -f $(NAME)
+pokemem.deb: release
+ rm -rf /tmp/pokemem
+ mkdir -p /tmp/pokemem/DEBIAN
+ mkdir -p /tmp/pokemem$(INSTALL_BIN_DIR)
+ mkdir -p /tmp/pokemem$(GLOBAL_DATA_DIR)
+ mkdir -p /tmp/pokemem/usr/share/applications
+ cp pokemem.desktop /tmp/pokemem/usr/share/applications
+ cp pokemem /tmp/pokemem$(INSTALL_BIN_DIR)/
+ cp -r ui.glade /tmp/pokemem$(GLOBAL_DATA_DIR)/
+ cp control /tmp/pokemem/DEBIAN
+ dpkg-deb --build /tmp/pokemem
+ mv /tmp/pokemem.deb ./
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0845f7c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,69 @@
+# pokemem
+
+A (Linux-only) tool for locating and modifying values in memory.
+
+## Installation
+
+You can get a .deb file from https://github.com/pommicket/pokemem/releases
+
+## How to use
+
+Disclaimer: This might not always work! If it doesn't, you might have gotten the wrong
+data type, or it could be stored in a special way, or it could have
+moved around in memory during the search. It's possible that there's nothing
+you can do (with this tool at least) to pin down the location of the value.
+
+1. Find the PID of the process you're interested in with a task manager,
+or `pidof <process_name>`. This should be some number, like 18035.
+2. Select a data type. If you're not sure what data type to pick:
+For websites, it's usually (but not always)
+64-bit floating-point that you want, and for non-web applications,
+it's probably 32-bit signed integer.
+3. Make sure that the value is in memory (i.e. have whatever
+tab you need open, etc.).
+4. Click "Begin search"
+5. Enter the current value, and click update/press enter. Repeat until the number of
+candidates isn't going down any further (it should be probably between 1 and 20).
+6. (Optional) Turn on auto-refresh, change stuff around,
+and watch to see if you've got the right value.
+7. Either double click on a value to change it, or use the box
+at the bottom to change all candidates at once.
+8. If you want to do another search, click "Stop", then "Begin search" again.
+
+## Compiling from source
+
+Run `make` for a debug build, and `make release` for a release build,
+or `make pokemem.deb` to build the .deb file.
+
+## Report a bug
+
+Bugs can be reported to pommicket at pommicket.com
+
+## License
+
+```
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>
+```
diff --git a/control b/control
new file mode 100644
index 0000000..b9e1710
--- /dev/null
+++ b/control
@@ -0,0 +1,11 @@
+Package: pokemem
+Version: 1.0
+Section: utils
+Priority: optional
+Architecture: amd64
+Essential: no
+Maintainer: Pommicket <pommicket@gmail.com>
+Description: A utility for finding and editing values in a process' memory.
+Installed-Size: 152
+Depends: libgtk-3-0
+Homepage: https://github.com/pommicket/pokemem
diff --git a/main.c b/main.c
index 4056276..c4d592b 100644
--- a/main.c
+++ b/main.c
@@ -728,10 +728,14 @@ G_MODULE_EXPORT void memfile_do_write_candidates(GtkWidget *_widget, gpointer us
}
static void on_activate(GtkApplication *app, gpointer user_data) {
+ char const *glade_file = "ui.glade";
+ if (access(glade_file, F_OK) != 0) {
+ glade_file = "/usr/share/pokemem/ui.glade";
+ }
State *state = user_data;
GError *error = NULL;
GtkBuilder *builder = gtk_builder_new();
- if (!gtk_builder_add_from_file(builder, "ui.glade", &error)) {
+ if (!gtk_builder_add_from_file(builder, glade_file, &error)) {
g_printerr("Error loading UI: %s\n", error->message);
g_clear_error(&error);
exit(EXIT_FAILURE);
diff --git a/pokemem.desktop b/pokemem.desktop
new file mode 100644
index 0000000..f4ee261
--- /dev/null
+++ b/pokemem.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Name=pokemem
+Comment=A utility for finding and editing values in a process' memory.
+Exec=pokemem
+Terminal=false
+Categories=Utility;Debugger;