mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-28 23:50:40 +00:00
rabin2 could not detect go in macho binaries (#16993)
* rabin2 could not detect go in non-elf binaries * better comparison for go detection * updates based on suggestions by ret2libc. re-tested accordingly after updates * updates based on suggestions by ret2libc. re-tested accordingly after updates Co-authored-by: Alex Useche <alex.useche@nvisium.com>
This commit is contained in:
parent
a14f5c0777
commit
e3a289d454
@ -40,6 +40,10 @@ static bool check_swift(RBinSymbol *sym) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool check_golang(RBinSymbol *sym) {
|
||||
return !strncmp (sym->name, "go.", 3);
|
||||
}
|
||||
|
||||
static inline bool is_cxx_symbol (const char *name) {
|
||||
r_return_val_if_fail (name, false);
|
||||
if (!strncmp (name, "_Z", 2)) {
|
||||
@ -106,6 +110,10 @@ R_API int r_bin_load_languages(RBinFile *binfile) {
|
||||
return R_BIN_NM_RUST;
|
||||
}
|
||||
}
|
||||
if (check_golang (sym)) {
|
||||
info->lang = "go";
|
||||
return R_BIN_NM_GO;
|
||||
}
|
||||
if (!cantbe.swift) {
|
||||
bool hasswift = false;
|
||||
if (!swiftIsChecked) {
|
||||
@ -213,6 +221,8 @@ R_API const char *r_bin_lang_tostring(int lang) {
|
||||
switch (lang & 0xffff) {
|
||||
case R_BIN_NM_SWIFT:
|
||||
return "swift";
|
||||
case R_BIN_NM_GO:
|
||||
return "go";
|
||||
case R_BIN_NM_JAVA:
|
||||
return "java";
|
||||
case R_BIN_NM_KOTLIN:
|
||||
|
Loading…
Reference in New Issue
Block a user