{"action":"created","issue":{"url":"https://api.github.com/repos/frida/frida/issues/660","repository_url":"https://api.github.com/repos/frida/frida","labels_url":"https://api.github.com/repos/frida/frida/issues/660/labels{/name}","comments_url":"https://api.github.com/repos/frida/frida/issues/660/comments","events_url":"https://api.github.com/repos/frida/frida/issues/660/events","html_url":"https://github.com/frida/frida/issues/660","id":367248747,"node_id":"MDU6SXNzdWUzNjcyNDg3NDc=","number":660,"title":"[Android native ] How to replace the new value in struct?","user":{"login":"henrytom1703","id":38415727,"node_id":"MDQ6VXNlcjM4NDE1NzI3","avatar_url":"https://avatars1.githubusercontent.com/u/38415727?v=4","gravatar_id":"","url":"https://api.github.com/users/henrytom1703","html_url":"https://github.com/henrytom1703","followers_url":"https://api.github.com/users/henrytom1703/followers","following_url":"https://api.github.com/users/henrytom1703/following{/other_user}","gists_url":"https://api.github.com/users/henrytom1703/gists{/gist_id}","starred_url":"https://api.github.com/users/henrytom1703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrytom1703/subscriptions","organizations_url":"https://api.github.com/users/henrytom1703/orgs","repos_url":"https://api.github.com/users/henrytom1703/repos","events_url":"https://api.github.com/users/henrytom1703/events{/privacy}","received_events_url":"https://api.github.com/users/henrytom1703/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-05T14:59:39Z","updated_at":"2018-10-05T17:58:27Z","closed_at":null,"author_association":"NONE","body":"Hello guys.\r\nI want replace  the new value in struct below? Anyone, Could you help me do it?\r\nThanks.\r\n```\r\nstruct info{\r\n  char name[50];\r\n  char address[50];\r\n};\r\n\r\nint getInfo(struct info* __finfo);\r\n\r\nvar getInfoPtr = Module.findExportByName(\"libnative.so\", \"getInfo\");\r\nvar getInfo = new NativeFunction(getInfoPtr, 'int', ['pointer']);\r\nInterceptor.replace(getInfoPtr, new NativeCallback(function (infoPtr) {\r\n   //how to replace name, address\r\n    return getInfo(infoPtr);\r\n},'int', ['pointer']));\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/frida/frida/issues/comments/427449345","html_url":"https://github.com/frida/frida/issues/660#issuecomment-427449345","issue_url":"https://api.github.com/repos/frida/frida/issues/660","id":427449345,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzQ0OTM0NQ==","user":{"login":"henrytom1703","id":38415727,"node_id":"MDQ6VXNlcjM4NDE1NzI3","avatar_url":"https://avatars1.githubusercontent.com/u/38415727?v=4","gravatar_id":"","url":"https://api.github.com/users/henrytom1703","html_url":"https://github.com/henrytom1703","followers_url":"https://api.github.com/users/henrytom1703/followers","following_url":"https://api.github.com/users/henrytom1703/following{/other_user}","gists_url":"https://api.github.com/users/henrytom1703/gists{/gist_id}","starred_url":"https://api.github.com/users/henrytom1703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrytom1703/subscriptions","organizations_url":"https://api.github.com/users/henrytom1703/orgs","repos_url":"https://api.github.com/users/henrytom1703/repos","events_url":"https://api.github.com/users/henrytom1703/events{/privacy}","received_events_url":"https://api.github.com/users/henrytom1703/received_events","type":"User","site_admin":false},"created_at":"2018-10-05T17:58:27Z","updated_at":"2018-10-05T17:58:27Z","author_association":"NONE","body":"Hi @mohe2015 \r\nIf the struct has 4 properties then code will be same below, right?:\r\n Memory.writeUtf8String(args[0], \"thefirststring\");\r\n Memory.writeUtf8String(new NativePointer(args[0]).add(50), \"thesecondstring\");\r\nMemory.writeUtf8String(new NativePointer(args[0]).add(50 * 2), \"third\");\r\nMemory.writeUtf8String(new NativePointer(args[0]).add(50 * 3), \"four\");\r\nThanks\r\n"}}
{"actor":{"display_login":"henrytom1703"}}