-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RzArch and plugins #4656
base: dev
Are you sure you want to change the base?
RzArch and plugins #4656
Conversation
fc9dec1
to
24f9882
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One big thing is missing in here - a target description, e.g.
typedef struct {
char *arch;
char *cpu;
ut16 bits;
} RzArchTarget;
This is where we can pack also the "features", e.g. particular ISA features or anything like that. Maybe also have a separate address_width
member, e.g. see function rz_analysis_get_address_bits()
librz/include/rz_arch.h
Outdated
} RzArchPlugin; | ||
|
||
typedef struct rz_arch_t { | ||
RzPVector /*<RzArchPlugin*>*/ *plugins; | ||
HtSP /*<char*, RzConfig*>*/ plugins_config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a plugin-specific configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added quite some stuff which probably shouldn't be done in the first implementation.
I think necessary is though:
- The
RzArchPacket
/RzArchInsn
distinction. - Starting enums always with
invalid = 0
to prevent false positives.
bool (*init)(RZ_NONNULL RzConfig *config); ///< Global constructor for the plugin to fill the configuration values. | ||
bool (*fini)(); ///< Global destructor for the plugin | ||
bool (*can_xcode_in)(RZ_NONNULL RzArchXCodeMember input); ///< Returns true if the plugin can support the given RzArchXCodeMember in input. | ||
bool (*can_xcode_out)(RZ_NONNULL RzArchXCodeMember output); ///< Returns true if the plugin can support the given RzArchXCodeMember in ouput. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An can_xcode_transform
would be nice. To test if the plugin supports a given in/out
combination. Because can_xcode_in() && can_xcode_out() == true
but context_xcode(in, out)
could be unsupported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this is an issue because we can define the transform, for example:
asm > details
could become internally (in rzarch not plugins) asm > bytes > details
.
If we allow to query for specific properties via |
86ee203
to
4da3252
Compare
This comment was marked as resolved.
This comment was marked as resolved.
RzBuffer is more versatile.
The xcode function is actually from bytes -> asm/packet etc. The RzBuffer is just the vehicle to provide the bytes.
4da3252
to
6594a29
Compare
Your checklist for this pull request
Detailed description
Initial proposal and conversion of all the RzAsm/RzAnalysis plugins towards the unified RzArch* structures
Partially addresses #4334