{"action":"closed","issue":{"url":"https://api.github.com/repos/Sogomn/Ratty/issues/9","repository_url":"https://api.github.com/repos/Sogomn/Ratty","labels_url":"https://api.github.com/repos/Sogomn/Ratty/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/Sogomn/Ratty/issues/9/comments","events_url":"https://api.github.com/repos/Sogomn/Ratty/issues/9/events","html_url":"https://github.com/Sogomn/Ratty/issues/9","id":161967436,"number":9,"title":"Feature: Jar injector.","user":{"login":"pj1234678","id":13920460,"avatar_url":"https://avatars.githubusercontent.com/u/13920460?v=3","gravatar_id":"","url":"https://api.github.com/users/pj1234678","html_url":"https://github.com/pj1234678","followers_url":"https://api.github.com/users/pj1234678/followers","following_url":"https://api.github.com/users/pj1234678/following{/other_user}","gists_url":"https://api.github.com/users/pj1234678/gists{/gist_id}","starred_url":"https://api.github.com/users/pj1234678/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pj1234678/subscriptions","organizations_url":"https://api.github.com/users/pj1234678/orgs","repos_url":"https://api.github.com/users/pj1234678/repos","events_url":"https://api.github.com/users/pj1234678/events{/privacy}","received_events_url":"https://api.github.com/users/pj1234678/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Sogomn/Ratty/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-23T16:34:03Z","updated_at":"2016-07-27T15:16:33Z","closed_at":"2016-07-27T15:16:33Z","body":"What if we implement this code to inject jars into memory.\r\n```\r\n\r\nJarFile jarFile = new JarFile(pathToJar);\r\nEnumeration<JarEntry> e = jarFile.entries();\r\n\r\nURL[] urls = { new URL(\"jar:file:\" + pathToJar+\"!/\") };\r\nURLClassLoader cl = URLClassLoader.newInstance(urls);\r\n\r\nwhile (e.hasMoreElements()) {\r\n    JarEntry je = e.nextElement();\r\n    if(je.isDirectory() || !je.getName().endsWith(\".class\")){\r\n        continue;\r\n    }\r\n    // -6 because of .class\r\n    String className = je.getName().substring(0,je.getName().length()-6);\r\n    className = className.replace('/', '.');\r\n    Class c = cl.loadClass(className);\r\n\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"Sogomn"}}