-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update Jaguar GPU to Rizin #3
Conversation
@@ -1,9 +1,9 @@ | |||
NAME=jaguar-gpu | |||
R2_PLUGIN_PATH=$(shell r2 -hh|grep R2_LIBR_PLUGINS|awk '{print $$2}') |
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 recommend to just remove the Makefile and use Meson build, like keystone plugin: https://github.com/rizinorg/rizin-extras/blob/master/keystone/meson.build
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 have added the meson.build, which works, but I had put the plugin path manually, which is a bit clumsy. Let me know if that needs to/can be changed.
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 think @ret2libc is more qualified for this question.
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.
Yeah this is something we need to figure out... I think probably all plugins should have a meson_options.txt which allows to specify the plugins_directory, but for now I think you can use ~/.local/share/rizin/plugins
.
I'll try to think about these problems soon as i switch back to rz-pm.
@@ -1,9 +1,9 @@ | |||
NAME=jaguar-gpu | |||
R2_PLUGIN_PATH=$(shell r2 -hh|grep R2_LIBR_PLUGINS|awk '{print $$2}') |
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 think @ret2libc is more qualified for this question.
Update plugin path to ~/.local/share/rizin/plugins
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.
You can probably fold these functions in some kind of macros to reduce the same pattern again and again.
jaguar-gpu/jaguar-gpu.c
Outdated
#include <rz_asm.h> | ||
#include <rz_lib.h> | ||
|
||
static int read16_BE(const ut8 **b) { |
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.
Please use endian functions from RzUtil.
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.
Could you be a bit more specific on where to look for them?
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.
rz_endian.h
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.
Regarding that, I tried using rz_read_be16()
but doesn't seem to work.
I think, it's maybe because there's a (*b) += 2;
over here on this one.
Do you have a pointer to get around this problem?
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.
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.
Thank you!
Please take a look now. Worked fine with my test file locally.
Also, I was first motivated to do the same increment on case 38
where read16BE
was used, I didn't catch any difference in the disassembly after adding that.
Now, I am slightly confused why.
Managed to find a bin to test it. I think it's working as it should.
|
Update Jaguar GPU to Rizin.
Just renamed the r2 data structures to its Rizin equivalent, preserving the logic, in an effort to learn about plugins.
It builds and gets installed. Haven't really tested it, yet.