{"action":"created","comment":{"url":"https://api.github.com/repos/radare/radare2/pulls/comments/211875578","pull_request_review_id":148385378,"id":211875578,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTg3NTU3OA==","diff_hunk":"@@ -0,0 +1,73 @@\n+/* radare - LGPL - Copyright 2018 - pancake */\n+\n+#include <r_asm.h>\n+\n+R_API RAsmOp *r_asm_op_new() {\n+\treturn R_NEW0 (RAsmOp);\n+}\n+\n+R_API void r_asm_op_free(RAsmOp *op) {\n+\tr_asm_op_fini (op);\n+\tfree (op);\n+}\n+\n+R_API void r_asm_op_init(RAsmOp *op) {\n+\tmemset (op, 0, sizeof (*op));\n+}\n+\n+R_API void r_asm_op_fini(RAsmOp *op) {\n+\tr_strbuf_fini (&op->buf);\n+\tr_strbuf_fini (&op->buf_asm);\n+\tr_strbuf_fini (&op->buf_hex);\n+\tr_buf_fini (op->buf_inc);\n+}\n+\n+// accessors\n+R_API char *r_asm_op_get_hex(RAsmOp *op) {\n+\treturn r_strbuf_get (&op->buf_hex);\n+}\n+\n+R_API char *r_asm_op_get_asm(RAsmOp *op) {\n+\treturn r_strbuf_get (&op->buf_asm);\n+}\n+\n+R_API int r_asm_op_get_size(RAsmOp *op) {\n+\tif (!op) {\n+\t\treturn 1;\n+\t}\n+\tconst int len = op->size - op->payload;\n+\treturn R_MAX (1, len);\n+}\n+\n+R_API void r_asm_op_set_asm(RAsmOp *op, const char *str) {\n+\tr_strbuf_set (&op->buf_asm, str);\n+}\n+\n+R_API void r_asm_op_set_hex(RAsmOp *op, const char *str) {\n+\tr_strbuf_set (&op->buf_hex, str);\n+\tut8 *bin = (ut8*)strdup (str);\n+\tif (bin) {\n+\t\tint len = r_hex_str2bin (str, bin);\n+\t\tif (len > 0) {\n+\t\t\tr_strbuf_setbin (&op->buf, bin, len);\n+\t\t}\n+\t\tfree (bin);\n+\t}\n+}\n+\n+R_API void r_asm_op_set_hexbuf(RAsmOp *op, const ut8 *buf, int len) {\n+\tchar *hex = malloc (len * 4);\n+\tif (hex) {\n+\t\tr_hex_bin2str (buf, len, hex);\n+\t\tr_asm_op_set_hex (op, hex);\n+\t\tfree (hex);\n+\t}\n+\t// TODO: update the op->buf too?","path":"libr/asm/op.c","position":65,"original_position":65,"commit_id":"762ea6e98809d2615b94649ddd930349969116c6","original_commit_id":"762ea6e98809d2615b94649ddd930349969116c6","user":{"login":"ret2libc","id":562321,"node_id":"MDQ6VXNlcjU2MjMyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/562321?v=4","gravatar_id":"","url":"https://api.github.com/users/ret2libc","html_url":"https://github.com/ret2libc","followers_url":"https://api.github.com/users/ret2libc/followers","following_url":"https://api.github.com/users/ret2libc/following{/other_user}","gists_url":"https://api.github.com/users/ret2libc/gists{/gist_id}","starred_url":"https://api.github.com/users/ret2libc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ret2libc/subscriptions","organizations_url":"https://api.github.com/users/ret2libc/orgs","repos_url":"https://api.github.com/users/ret2libc/repos","events_url":"https://api.github.com/users/ret2libc/events{/privacy}","received_events_url":"https://api.github.com/users/ret2libc/received_events","type":"User","site_admin":false},"body":"Remove this comment. Op->buf is already set by op_set_hex","created_at":"2018-08-22T08:49:01Z","updated_at":"2018-08-22T08:56:05Z","html_url":"https://github.com/radare/radare2/pull/11151#discussion_r211875578","pull_request_url":"https://api.github.com/repos/radare/radare2/pulls/11151","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments/211875578"},"html":{"href":"https://github.com/radare/radare2/pull/11151#discussion_r211875578"},"pull_request":{"href":"https://api.github.com/repos/radare/radare2/pulls/11151"}}},"pull_request":{"url":"https://api.github.com/repos/radare/radare2/pulls/11151","id":209365330,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzY1MzMw","html_url":"https://github.com/radare/radare2/pull/11151","diff_url":"https://github.com/radare/radare2/pull/11151.diff","patch_url":"https://github.com/radare/radare2/pull/11151.patch","issue_url":"https://api.github.com/repos/radare/radare2/issues/11151","number":11151,"state":"open","locked":false,"title":"RAsmOp.buf* now uses RStrBuf instead of static buffers, big refactor, fixed on bugs in the way","user":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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":"","created_at":"2018-08-19T15:25:57Z","updated_at":"2018-08-22T08:56:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d092778ad1b206562b2334a73d0e182a739af6f9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/radare/radare2/milestones/31","html_url":"https://github.com/radare/radare2/milestone/31","labels_url":"https://api.github.com/repos/radare/radare2/milestones/31/labels","id":3073181,"node_id":"MDk6TWlsZXN0b25lMzA3MzE4MQ==","number":31,"title":"2.9.0 - pre-r2con","description":"","creator":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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},"open_issues":135,"closed_issues":56,"state":"open","created_at":"2018-01-29T22:51:46Z","updated_at":"2018-08-22T00:54:56Z","due_on":"2018-09-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/radare/radare2/pulls/11151/commits","review_comments_url":"https://api.github.com/repos/radare/radare2/pulls/11151/comments","review_comment_url":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radare/radare2/issues/11151/comments","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/762ea6e98809d2615b94649ddd930349969116c6","head":{"label":"radare:asmop-strbuf3","ref":"asmop-strbuf3","sha":"762ea6e98809d2615b94649ddd930349969116c6","user":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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":4869294,"node_id":"MDEwOlJlcG9zaXRvcnk0ODY5Mjk0","name":"radare2","full_name":"radare/radare2","owner":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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","description":"unix-like reverse engineering framework and commandline tools security","fork":false,"url":"https://api.github.com/repos/radare/radare2","forks_url":"https://api.github.com/repos/radare/radare2/forks","keys_url":"https://api.github.com/repos/radare/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2/teams","hooks_url":"https://api.github.com/repos/radare/radare2/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2/events","assignees_url":"https://api.github.com/repos/radare/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2/tags","blobs_url":"https://api.github.com/repos/radare/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2/languages","stargazers_url":"https://api.github.com/repos/radare/radare2/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2/subscription","commits_url":"https://api.github.com/repos/radare/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2/merges","archive_url":"https://api.github.com/repos/radare/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2/downloads","issues_url":"https://api.github.com/repos/radare/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2/deployments","created_at":"2012-07-03T07:42:26Z","updated_at":"2018-08-22T08:00:00Z","pushed_at":"2018-08-22T06:58:19Z","git_url":"git://github.com/radare/radare2.git","ssh_url":"git@github.com:radare/radare2.git","clone_url":"https://github.com/radare/radare2.git","svn_url":"https://github.com/radare/radare2","homepage":"http://www.radare.org/","size":88626,"stargazers_count":8025,"watchers_count":8025,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1571,"mirror_url":null,"archived":false,"open_issues_count":979,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":1571,"open_issues":979,"watchers":8025,"default_branch":"master"}},"base":{"label":"radare:master","ref":"master","sha":"8f11d01937a896df1ffab9eb45807ea3c6cac96a","user":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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":4869294,"node_id":"MDEwOlJlcG9zaXRvcnk0ODY5Mjk0","name":"radare2","full_name":"radare/radare2","owner":{"login":"radare","id":917142,"node_id":"MDQ6VXNlcjkxNzE0Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/917142?v=4","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","description":"unix-like reverse engineering framework and commandline tools security","fork":false,"url":"https://api.github.com/repos/radare/radare2","forks_url":"https://api.github.com/repos/radare/radare2/forks","keys_url":"https://api.github.com/repos/radare/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2/teams","hooks_url":"https://api.github.com/repos/radare/radare2/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2/events","assignees_url":"https://api.github.com/repos/radare/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2/tags","blobs_url":"https://api.github.com/repos/radare/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2/languages","stargazers_url":"https://api.github.com/repos/radare/radare2/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2/subscription","commits_url":"https://api.github.com/repos/radare/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2/merges","archive_url":"https://api.github.com/repos/radare/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2/downloads","issues_url":"https://api.github.com/repos/radare/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2/deployments","created_at":"2012-07-03T07:42:26Z","updated_at":"2018-08-22T08:00:00Z","pushed_at":"2018-08-22T06:58:19Z","git_url":"git://github.com/radare/radare2.git","ssh_url":"git@github.com:radare/radare2.git","clone_url":"https://github.com/radare/radare2.git","svn_url":"https://github.com/radare/radare2","homepage":"http://www.radare.org/","size":88626,"stargazers_count":8025,"watchers_count":8025,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1571,"mirror_url":null,"archived":false,"open_issues_count":979,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":1571,"open_issues":979,"watchers":8025,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/11151"},"html":{"href":"https://github.com/radare/radare2/pull/11151"},"issue":{"href":"https://api.github.com/repos/radare/radare2/issues/11151"},"comments":{"href":"https://api.github.com/repos/radare/radare2/issues/11151/comments"},"review_comments":{"href":"https://api.github.com/repos/radare/radare2/pulls/11151/comments"},"review_comment":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radare/radare2/pulls/11151/commits"},"statuses":{"href":"https://api.github.com/repos/radare/radare2/statuses/762ea6e98809d2615b94649ddd930349969116c6"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ret2libc"}}