{"action":"created","comment":{"url":"https://api.github.com/repos/radare/radare2-extras/pulls/comments/85079257","pull_request_review_id":5814739,"id":85079257,"diff_hunk":"@@ -1,371 +1,281 @@\n-/* radare - LGPL - Copyright 2015 - Dāvis */\n+/*\n+ *\tFile Name: mdmp.c\n+ *\tProject: Radare2\n+ *\n+ *\tCopyright: 2016. LGPL. All right reserved.\n+ *\n+ *\tNOTE:\n+ *\t\t1. TODO: Perform full parsing of MDMP!\n+ */\n+\n+/*******************************************************************************\n+ *\tIncludes\n+ ******************************************************************************/\n+\n #include <r_util.h>\n \n #include \"mdmp.h\"\n \n-struct r_bin_mdmp_obj *r_bin_mdmp_new_buf(struct r_buf_t *buf) {\n-\tstruct r_bin_mdmp_obj *obj = R_NEW0(struct r_bin_mdmp_obj);\n-\tif (!obj) return NULL;\n-\tobj->b = r_buf_new_with_buf (buf);\n-\tif (!obj->b) {\n-\t\teprintf (\"r_bin_mdmp_new_buf: r_buf_new_with_buf failed\\n\");\n-\t\tr_bin_mdmp_free (obj);\n-\t\treturn NULL;\n-\t}\n-\tobj->kv = sdb_new0 ();\n-\tif (!r_bin_mdmp_init (obj)) {\n-\t\tr_bin_mdmp_free (obj);\n-\t\treturn NULL;\n-\t}\n-\treturn obj;\n-}\n-\n-void r_bin_mdmp_free(struct r_bin_mdmp_obj *obj) {\n-\tif (!obj) return;\n-\tr_bin_mdmp_destroy_lists(obj);\n-\tobj->system_info = NULL;\n-\tobj->hdr = NULL;\n-\tif (obj->kv) {\n-\t\tsdb_free (obj->kv);\n-\t\tobj->kv = NULL;\n-\t}\n-\tif (obj->b) {\n-\t\tr_buf_free (obj->b);\n-\t\tobj->b = NULL;\n-\t}\n-\tfree (obj);\n-}\n+/*******************************************************************************","path":"libr/bin/format/mdmp/mdmp.c","position":52,"original_position":52,"commit_id":"83edddb49908b1975124fa075bbd8bf568349f3e","original_commit_id":"83edddb49908b1975124fa075bbd8bf568349f3e","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"body":"same goes here","created_at":"2016-10-26T09:10:15Z","updated_at":"2016-10-26T09:10:15Z","html_url":"https://github.com/radare/radare2-extras/pull/72#discussion_r85079257","pull_request_url":"https://api.github.com/repos/radare/radare2-extras/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/comments/85079257"},"html":{"href":"https://github.com/radare/radare2-extras/pull/72#discussion_r85079257"},"pull_request":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/radare/radare2-extras/pulls/72","id":90760483,"html_url":"https://github.com/radare/radare2-extras/pull/72","diff_url":"https://github.com/radare/radare2-extras/pull/72.diff","patch_url":"https://github.com/radare/radare2-extras/pull/72.patch","issue_url":"https://api.github.com/repos/radare/radare2-extras/issues/72","number":72,"state":"open","locked":false,"title":"Rework of the mdmp plugin","user":{"login":"AlexKornitzer","id":2750747,"avatar_url":"https://avatars.githubusercontent.com/u/2750747?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKornitzer","html_url":"https://github.com/AlexKornitzer","followers_url":"https://api.github.com/users/AlexKornitzer/followers","following_url":"https://api.github.com/users/AlexKornitzer/following{/other_user}","gists_url":"https://api.github.com/users/AlexKornitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKornitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKornitzer/subscriptions","organizations_url":"https://api.github.com/users/AlexKornitzer/orgs","repos_url":"https://api.github.com/users/AlexKornitzer/repos","events_url":"https://api.github.com/users/AlexKornitzer/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKornitzer/received_events","type":"User","site_admin":false},"body":"The previous implementation of the MDMP plugin was missing certain functionality required for useful analysis within radare2. So I spent the weekend reworking/reimplementing the plugin.\r\n\r\nMajor changes:\r\n\r\n- Refactored the code to remove unnecessary type definitions and converted to snake_case to match the rest of the project.\r\n- Updated the Sections section to map the physical address to the correct location in the MDMP file if present (i.e. full dumps). If not present the paddr is set to 0.\r\n\r\n```\r\nidx=00 vaddr=0xff7b0000 paddr=0x018825a8 sz=929792 vsz=929792 perm=----- name=C:_Windows_System32_calc.exe\r\nidx=01 vaddr=0x77720000 paddr=0x016d25a8 sz=1744896 vsz=1744896 perm=----- name=C:_Windows_System32_ntdll.dll\r\nidx=02 vaddr=0x77500000 paddr=0x014b95a8 sz=1175552 vsz=1175552 perm=----- name=C:_Windows_System32_kernel32.dll\r\n[snip]\r\nidx=25 vaddr=0x7fefd2b0000 paddr=0x01fd95a8 sz=61440 vsz=61440 perm=----- name=C:_Windows_System32_CRYPTBASE.dll\r\nidx=26 vaddr=0x7fefddb0000 paddr=0x022b25a8 sz=626688 vsz=626688 perm=----- name=C:_Windows_System32_clbcatq.dll\r\nidx=27 vaddr=0x7fef62b0000 paddr=0x019655a8 sz=344064 vsz=344064 perm=----- name=C:_Windows_System32_oleacc.dll\r\n```\r\n\r\n- Made use of the Memory section to store all memory mappings found within the MDMP file. Again used the paddr to display the location of the memory within the file.\r\n\r\n```\r\n0x00110000 +0x1000 ---- paddr=0x000b55a8 RAM\r\n0x00120000 +0xa000 ---- paddr=0x000b65a8 RAM\r\n0x00130000 +0x2000 ---- paddr=0x000c05a8 RAM\r\n0x00140000 +0xa000 ---- paddr=0x000c25a8 RAM\r\n0x00150000 +0xa000 ---- paddr=0x000cc5a8 RAM\r\n0x00160000 +0x10000 ---- paddr=0x000d65a8 RAM\r\n...\r\n```\r\n\r\nIssues:\r\n- Searching or analysing the memory within the MDMP file is not possible without setting `io.va=false`.\r\n- The `r_str_utf16_to_utf8()` function seems to remove `\\` characters?\r\n\r\nTODO:\r\n- Full Parsing - Currently parsing is only performed to depth one if the data is not going to be presented in radare2.\r\n- Find a way to present the debugging information to the radare2 debugger.\r\n- Add non-standard streams.\r\n- Test on more dumps than just basic/full of calc.exe\r\n\r\nFinal Notes: Hopefully I have not done anything too catastrophic to this plugin, and that people will find the changes useful. If any bugs are encountered from the implementation send them my way.","created_at":"2016-10-25T08:28:24Z","updated_at":"2016-10-26T09:10:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26263f601dab5ce9b83387260acf306ef085d351","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/radare/radare2-extras/pulls/72/commits","review_comments_url":"https://api.github.com/repos/radare/radare2-extras/pulls/72/comments","review_comment_url":"https://api.github.com/repos/radare/radare2-extras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radare/radare2-extras/issues/72/comments","statuses_url":"https://api.github.com/repos/radare/radare2-extras/statuses/83edddb49908b1975124fa075bbd8bf568349f3e","head":{"label":"AlexKornitzer:mdmp","ref":"mdmp","sha":"83edddb49908b1975124fa075bbd8bf568349f3e","user":{"login":"AlexKornitzer","id":2750747,"avatar_url":"https://avatars.githubusercontent.com/u/2750747?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKornitzer","html_url":"https://github.com/AlexKornitzer","followers_url":"https://api.github.com/users/AlexKornitzer/followers","following_url":"https://api.github.com/users/AlexKornitzer/following{/other_user}","gists_url":"https://api.github.com/users/AlexKornitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKornitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKornitzer/subscriptions","organizations_url":"https://api.github.com/users/AlexKornitzer/orgs","repos_url":"https://api.github.com/users/AlexKornitzer/repos","events_url":"https://api.github.com/users/AlexKornitzer/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKornitzer/received_events","type":"User","site_admin":false},"repo":{"id":71788760,"name":"radare2-extras","full_name":"AlexKornitzer/radare2-extras","owner":{"login":"AlexKornitzer","id":2750747,"avatar_url":"https://avatars.githubusercontent.com/u/2750747?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKornitzer","html_url":"https://github.com/AlexKornitzer","followers_url":"https://api.github.com/users/AlexKornitzer/followers","following_url":"https://api.github.com/users/AlexKornitzer/following{/other_user}","gists_url":"https://api.github.com/users/AlexKornitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKornitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKornitzer/subscriptions","organizations_url":"https://api.github.com/users/AlexKornitzer/orgs","repos_url":"https://api.github.com/users/AlexKornitzer/repos","events_url":"https://api.github.com/users/AlexKornitzer/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKornitzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexKornitzer/radare2-extras","description":"Source graveyard and random candy for radare2","fork":true,"url":"https://api.github.com/repos/AlexKornitzer/radare2-extras","forks_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/forks","keys_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/teams","hooks_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/hooks","issue_events_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/issues/events{/number}","events_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/events","assignees_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/assignees{/user}","branches_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/branches{/branch}","tags_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/tags","blobs_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/languages","stargazers_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/stargazers","contributors_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/contributors","subscribers_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/subscribers","subscription_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/subscription","commits_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/contents/{+path}","compare_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/merges","archive_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/downloads","issues_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/issues{/number}","pulls_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/labels{/name}","releases_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/releases{/id}","deployments_url":"https://api.github.com/repos/AlexKornitzer/radare2-extras/deployments","created_at":"2016-10-24T12:53:19Z","updated_at":"2016-10-24T12:53:23Z","pushed_at":"2016-10-25T13:18:44Z","git_url":"git://github.com/AlexKornitzer/radare2-extras.git","ssh_url":"git@github.com:AlexKornitzer/radare2-extras.git","clone_url":"https://github.com/AlexKornitzer/radare2-extras.git","svn_url":"https://github.com/AlexKornitzer/radare2-extras","homepage":"http://www.radare.org/","size":2025,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"radare:master","ref":"master","sha":"26e5afb8b91e6afa719bf1baca236f624b4eb86d","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"repo":{"id":5411297,"name":"radare2-extras","full_name":"radare/radare2-extras","owner":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radare/radare2-extras","description":"Source graveyard and random candy for radare2","fork":false,"url":"https://api.github.com/repos/radare/radare2-extras","forks_url":"https://api.github.com/repos/radare/radare2-extras/forks","keys_url":"https://api.github.com/repos/radare/radare2-extras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2-extras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2-extras/teams","hooks_url":"https://api.github.com/repos/radare/radare2-extras/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2-extras/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2-extras/events","assignees_url":"https://api.github.com/repos/radare/radare2-extras/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2-extras/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2-extras/tags","blobs_url":"https://api.github.com/repos/radare/radare2-extras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2-extras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2-extras/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2-extras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2-extras/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2-extras/languages","stargazers_url":"https://api.github.com/repos/radare/radare2-extras/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2-extras/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2-extras/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2-extras/subscription","commits_url":"https://api.github.com/repos/radare/radare2-extras/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2-extras/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2-extras/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2-extras/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2-extras/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2-extras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2-extras/merges","archive_url":"https://api.github.com/repos/radare/radare2-extras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2-extras/downloads","issues_url":"https://api.github.com/repos/radare/radare2-extras/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2-extras/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2-extras/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2-extras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2-extras/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2-extras/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2-extras/deployments","created_at":"2012-08-14T10:22:09Z","updated_at":"2016-10-24T11:07:04Z","pushed_at":"2016-10-25T13:18:44Z","git_url":"git://github.com/radare/radare2-extras.git","ssh_url":"git@github.com:radare/radare2-extras.git","clone_url":"https://github.com/radare/radare2-extras.git","svn_url":"https://github.com/radare/radare2-extras","homepage":"http://www.radare.org/","size":7447,"stargazers_count":42,"watchers_count":42,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":25,"forks":36,"open_issues":25,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/72"},"html":{"href":"https://github.com/radare/radare2-extras/pull/72"},"issue":{"href":"https://api.github.com/repos/radare/radare2-extras/issues/72"},"comments":{"href":"https://api.github.com/repos/radare/radare2-extras/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radare/radare2-extras/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/radare/radare2-extras/statuses/83edddb49908b1975124fa075bbd8bf568349f3e"}}}}
{"actor":{"display_login":"radare"}}