Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for SHA384 and SHA512 hash algorithms to the radare2 muta plugin system. The changes include new plugin implementations, build system integration, and an unrelated cleanup in the coresymbolication module.
- Implements SHA384 and SHA512 hash plugins following the existing pattern from SHA1/SHA256
- Integrates the new plugins into the build system and plugin registry
- Removes unused
r_hash.hinclude and improves condition check in coresymbolication.c
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libr/muta/p/muta_sha512.c | New SHA512 hash plugin implementation |
| libr/muta/p/muta_sha384.c | New SHA384 hash plugin implementation with missing includes |
| libr/muta/p/sha512.mk | Build configuration for SHA512 plugin with incorrect structure |
| libr/muta/p/sha384.mk | Build configuration for SHA384 plugin with incorrect structure |
| libr/muta/p/Makefile | Adds includes for the new SHA384 and SHA512 makefiles |
| libr/include/r_muta.h | Declares the new plugin extern variables |
| dist/plugins-cfg/plugins.def.cfg | Registers the new plugins in the default configuration |
| libr/bin/format/mach0/coresymbolication.c | Removes unused include and improves condition check |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SHARED_SHA384=$(SHLIBDIR)$(LDFLAGS) $(LIBOBJ) | ||
|
|
||
| TARGET_SHA384=muta_sha384.${EXT_SO} | ||
|
|
||
| all: $(TARGET_SHA384) | ||
|
|
||
| $(TARGET_SHA384): $(OBJ_SHA384) | ||
| $(CC) $(call libname,muta_sha384) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SHA384} ${OBJ_SHA384} | ||
|
|
||
| clean:: | ||
| rm -f *.o *.${EXT_SO} *.a |
There was a problem hiding this comment.
Missing SRC_SHA384 variable usage and incorrect structure. The new sha384.mk file doesn't follow the established pattern used by other hash plugins. Compared to sha256.mk and sha1.mk, this file includes extra unused lines (lines 2, 5, 9, 14-15) and is missing the ALL_TARGETS variable that is used in all other .mk files to properly register the target.
| SHARED_SHA384=$(SHLIBDIR)$(LDFLAGS) $(LIBOBJ) | |
| TARGET_SHA384=muta_sha384.${EXT_SO} | |
| all: $(TARGET_SHA384) | |
| $(TARGET_SHA384): $(OBJ_SHA384) | |
| $(CC) $(call libname,muta_sha384) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SHA384} ${OBJ_SHA384} | |
| clean:: | |
| rm -f *.o *.${EXT_SO} *.a | |
| ALL_TARGETS+=muta_sha384.${EXT_SO} |
| @@ -0,0 +1,37 @@ | |||
| /* radare - LGPL - Copyright 2024-2026 - pancake */ | |||
|
|
|||
There was a problem hiding this comment.
Missing required includes. The file uses RHash type and related functions but doesn't include <r_lib.h> and <r_hash.h>. These includes are present in all similar hash plugin implementations (sha1, sha256, md5) and are necessary for the code to compile.
| #include <r_lib.h> | |
| #include <r_hash.h> |
| SRC_SHA512=muta_sha512.c | ||
|
|
||
| STATIC_OBJ+=${OBJ_SHA512} | ||
| SHARED_SHA512=$(SHLIBDIR)$(LDFLAGS) $(LIBOBJ) | ||
|
|
||
| TARGET_SHA512=muta_sha512.${EXT_SO} | ||
|
|
||
| all: $(TARGET_SHA512) | ||
|
|
||
| $(TARGET_SHA512): $(OBJ_SHA512) | ||
| $(CC) $(call libname,muta_sha512) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SHA512} ${OBJ_SHA512} | ||
|
|
||
| clean:: | ||
| rm -f *.o *.${EXT_SO} *.a |
There was a problem hiding this comment.
Missing SRC_SHA512 variable usage and incorrect structure. The new sha512.mk file doesn't follow the established pattern used by other hash plugins. Compared to sha256.mk and sha1.mk, this file includes extra unused lines (lines 2, 5, 9, 14-15) and is missing the ALL_TARGETS variable that is used in all other .mk files to properly register the target.
| SRC_SHA512=muta_sha512.c | |
| STATIC_OBJ+=${OBJ_SHA512} | |
| SHARED_SHA512=$(SHLIBDIR)$(LDFLAGS) $(LIBOBJ) | |
| TARGET_SHA512=muta_sha512.${EXT_SO} | |
| all: $(TARGET_SHA512) | |
| $(TARGET_SHA512): $(OBJ_SHA512) | |
| $(CC) $(call libname,muta_sha512) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SHA512} ${OBJ_SHA512} | |
| clean:: | |
| rm -f *.o *.${EXT_SO} *.a | |
| STATIC_OBJ+=${OBJ_SHA512} | |
| TARGET_SHA512=muta_sha512.${EXT_SO} | |
| ALL_TARGETS+=${TARGET_SHA512} | |
| $(TARGET_SHA512): $(OBJ_SHA512) | |
| $(CC) $(call libname,muta_sha512) ${LDFLAGS} ${CFLAGS} -o ${TARGET_SHA512} ${OBJ_SHA512} |
Description