Comments (7)
from rz-ghidra.
Updated, but I haven't tested this arch because I don't know anything about it.
Also for now you have to set r2ghidra.lang
to the id you want manually, so please send a pr with the respective entries here: https://github.com/radareorg/r2ghidra-dec/blob/master/src/R2Architecture.cpp#L16
from rz-ghidra.
Did that change, shows up on the pdgs
listing, but:
Ghidra Decompiler Error: Could not match asm.arch sh32 to sleigh arch.
Since AFAIK all SuperH's are 32 bits, r2 maps it as sh so it kinda breaks your scheme... I'm debating myself on whether to add this weird case on r2ghidra-dec, i.e sth like (pseudocode):
(...)
std::string SleighIdFromCore(RCore *core)
{
const char *arch = r_config_get(core->config, "asm.arch");
bool be = r_config_get_i(core->config, "cfg.bigendian") != 0;
ut64 bits = r_config_get_i(core->config, "asm.bits");
string flavor = string("default");
auto arch_it = arch_map.find(arch + to_string(bits));
if(arch_it == arch_map.end())
throw LowlevelError("Could not match asm.arch " + std::string(arch) + to_string(bits) + " to sleigh arch.");
if (!arch_it->second.compare("ARM")) {
flavor = string("v7");
bits = 32;
}
if (!arch_it->second.compare("superh")) {
arch_it = arch_map.find(arch);
bits = 32;
}
if (!arch_it->second.compare("superh4")) {
arch_it = arch_map.find(arch);
bits = 32;
}
Or "uniformize" it on @radare so that asm.arch
becomes sh32
(unsure about how many third party r2pipes, anal & co would that break though).
from rz-ghidra.
Yes what is currently done is simply concatenating the arch from r2 with the bits and mapping that, which is hacky and planned to be changed, that's how sh32
is generated from sh
. So for now, just adding an entry using sh32
as the key to arch_map
should work.
from rz-ghidra.
I see, but not exactly as it turns out:
$ git diff
diff --git a/src/R2Architecture.cpp b/src/R2Architecture.cpp
index fc88e79..acc5af2 100644
--- a/src/R2Architecture.cpp
+++ b/src/R2Architecture.cpp
@@ -31,6 +31,8 @@ static const std::map<std::string, std::string> arch_map = {
{ "ppc64", "PowerPC" } ,
{ "sparc32", "sparc" } ,
{ "sparc64", "sparc" } ,
+ { "superh4", "sh32" } ,
+ { "superh", "sh32" } ,
{ "msp43016", "TI_MSP430" } ,
{ "m68k32", "68000" } ,
};
Leads to:
[0x08000040]> pdg
Ghidra Decompiler Error: Could not match asm.arch sh32 to sleigh arch.
[0x08000040]>
from rz-ghidra.
It's the other way around. It should be something like { "sh32", "SuperH4" }
from rz-ghidra.
Handling on PR #41, closing.
from rz-ghidra.
Related Issues (20)
- Cannot build cutter plugin "Could not find a package configuration file provided by 'Cutter'" HOT 4
- [Build Error] Use of undeclared identifier 'rz_bin_object_get_string_at' HOT 4
- Tailjmps to reloc targets are decompiled until infinity HOT 2
- Deb package to integrate rz-ghidra in Kali HOT 2
- Build fails with `-mcrc32` HOT 1
- Support Tricore HOT 1
- Cutter plugin throws a CMake Error
- Caching decompiler output HOT 1
- Make less changes to the ghidra source code HOT 1
- AnnotateVariable() method doesn't find the correct reference offset for global variables HOT 5
- Ghidra Decompiler Error: Symbol method.public.Hello.void_say extends beyond the end of the address space
- Compilation errors while building Docker image
- install/usr/include/librz/rz_list.h:5:10: fatal error: ht_pp.h: No such file or directory #47 247.9 #include <ht_pp.h> #47 247.9 ^~~~~~~~~ HOT 3
- Bad function argument handling for arm thumb binaries
- Cutter plugin fails to build on macOS
- src/RizinUtils.h:14:48: error: 'RzListIter' {aka 'struct rz_list_iter_t'} has no member named 'n' HOT 4
- failed to build on gentoo HOT 1
- Support V850
- Failed to build with rizin 0.6.3 on MacOS HOT 2
- Fix `test/db/extras/ghidra typedef` test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rz-ghidra.