mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-14 16:59:08 +00:00
Fix #8573 - Detect D's main
This commit is contained in:
parent
e36248e9d3
commit
aa3eb6a9ad
@ -2309,6 +2309,10 @@ ut64 MACH0_(get_main)(struct MACH0_(obj_t)* bin) {
|
||||
}
|
||||
for (i = 0; !symbols[i].last; i++) {
|
||||
const char *name = symbols[i].name;
|
||||
if (!strcmp (name, "__Dmain")) {
|
||||
addr = symbols[i].addr;
|
||||
break;
|
||||
}
|
||||
if (strstr (name, "4main") && !strstr (name, "STATIC")) {
|
||||
addr = symbols[i].addr;
|
||||
break;
|
||||
|
@ -744,8 +744,9 @@ static RBinAddr* binsym(RBinFile *arch, int sym) {
|
||||
switch (sym) {
|
||||
case R_BIN_SYM_MAIN:
|
||||
addr = MACH0_(get_main) (arch->o->bin_obj);
|
||||
if (!addr || !(ret = R_NEW0 (RBinAddr)))
|
||||
if (!addr || !(ret = R_NEW0 (RBinAddr))) {
|
||||
return NULL;
|
||||
}
|
||||
//if (arch->o->info && arch->o->info->bits == 16) {
|
||||
// align for thumb
|
||||
ret->vaddr = ((addr >>1)<<1);
|
||||
|
Loading…
Reference in New Issue
Block a user