-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add command to generate coredump in MACH0 or ELF #4124
Comments
I'm interested to work on this but need to be pointed in the right direction, should the implementation to generate the core dumps depend on gathering information collectively from the os (aka /proc on linux for elf coredumps) in addition to the r2_debug api? or should the os be used to auto generat coredumps through signals such as SIGABRT/SIGHUP etc..? or should the implementation be left up to the backend debugger, for example use "generate-core-file" if gdb was specified as a backend? |
The implementation of this must follow different approaches, but focusing on a if the system provides a generic way to create a core file:
if not, just go for the generic way:
I think its safe to go this way, but maybe we can generate a core file in I think windows and linux ( and haikuOS ) provide system primitives to after this, the generic way to generate a core file depends on the file format Right now RBin have support for creating tiny binaries, but this is not enough For iOS, just download http://www.newosxbook.com/files/procexp.tgz?v099 and Actually r2 is able to dump and restore memory and registers using the Some related links: https://people.redhat.com/anderson/extensions/gcore.c https://docs.oracle.com/cd/E19424-01/820-4814/gegxx/ http://osxbook.com/book/bonus/chapter8/core/ http://osxbook.com/book/bonus/chapter8/core/download/gcore-1.3.tar.gz Once we are able to generate core files, it will be great if we can add
|
I was reading this links
And the code for generating the core files in OSX needs superuser privileges. Does the debug plugin has those privileges? I have never written a debugger before, so I can't tell for sure. |
you need the same permissions than for debugging, aka signing the binary or be root on osx, or add entitlements and be root on ios
|
A function for generating the core for mach0 binaries
only works if it's run with sudo privileges, even if the binary is signed. Should I add a check for superuser privileges and refuse to run in case of not superuser? I don't know what's the prefered way to handle this situations. I'm using El Capitan, maybe in older versions of OSX this function doesn't require superuser privileges. I don't know that either. |
The important part is to make it work. Being root or not is something that can be solved later, and i dont get why do you need to use that api
|
The header of the corefile (acording to http://osxbook.com/book/bonus/chapter8/core/) needs the cpu type and subtype. To obtain that info the function is needed. I could be wrong, but that's the conclusion I reach. |
you can get this info by parsing the header in memory, to create the core file you just need to read memory and enumerate the maps which is already done.
|
Support for mach0 is working (lacks thread support), so, let's move this issue for 0.10.3 and cleanup a bit to clarify whats missing.. |
I'm working on "Generate ELF coredumps on Linux/BSD", hope to have something useful next week |
Awesome! Looking forward your pr
|
Hi! I was quite busy this week, so I couldn't go much further, but I started to do some things: It's still incomplete, but I hope the next days to do a long jump ;) |
Cool!
|
I'm still moving forward! I'm able to dump all the load sections(without 2016-04-20 18:48 GMT+02:00 radare [email protected]:
|
awesome! :D
|
@leberus ping |
I did a pull request. I wrote there what is still missing too. I was half of the last week on holidays so I didn't have so much time. |
Awesome ! |
code is merged, need to port to BSD and add support for threads |
ping @leberus any will to continue working on this? |
Yep! Sorry for the lateness. I started today porting the code to ARM, El dia 15/08/2016 21:02, "radare" [email protected] va escriure:
|
Awesome, thats probably a bit late for 0.10.5, but will fit perfectly in the next release with time for review and such. that’s great to hear that :) thanks, looking forward your PR!
|
Hi :) So far seems to work. The only thing I don't like is that every map is being dumped because /proc/[pid]/smaps on ARM platform doesn't provide VmFlags field, so I need to add another way to check if a map should be dumped or not. Once this is done, I'll be ready for the PR :D
|
yay :D that looks good! good luck finding those vmflags :)
|
I think it's ready for the PR. I will push my code and compile it and try it with my i386 and x86_64 to see that my changes didn't break anything. Then I'll go ahead and do the PR. PD: I've added a fix-up for issue #5540 because the commit there wouldn't be useful. |
cool! looking forward to review that pr |
So, finally here it is: #5549 ;) 2016-08-17 12:48 GMT+02:00 radare [email protected]:
|
Yay :) merged because it looks good and doesnt breaks anything. Just some questions:
Thanks!
|
Hey!
I'm not sure if this is the place or not, but I'd like to talk about http://radare.org/gsoc/2016/ideas.html#title_10 It'd be of my interest, and I'd like to give it a try :) |
@leberus come to telegram/irc and one of our RSoC students working on this task, so you both can cooperate: http://radare.today/posts/RSoC%202016%20progress/ |
@XVilka I'm not a student, may I work on it anyway? I'm already on irc. Should I talk with Rakholia Jenish directly? or do you have a procotol for this? Thanks in advance |
@leberus we don't have a special protocol for that :) Of course you can talk to him directly. We have a dedicated group in telegram for this project though. |
@XVilka ah ok, then I'll try to join it! (soz, was a misunderstood) |
@leberus ping us in #radare telegram channel and someone will invite you into this radare2-kernel chat. |
how do you ping? i got nothing :P anyway, im there
|
status of pendings ticks to be done here? any wip development? |
ping |
after Christmas I'll try to make it work on BSD (got no time now) |
cool!
… On 14 Dec 2016, at 12:56, leberus ***@***.***> wrote:
after Christmas I'll try to make it work on BSD (got no time now)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#4124 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA3-ljrs28tm2CsFwxfjyYo2gtR8eon9ks5rH9mDgaJpZM4Hc_qU>.
|
@leberus can you update the issue with the current state of the things? |
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions. |
related #152
The text was updated successfully, but these errors were encountered: