Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
- ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
- System.out.println("Attempting to redefine " + className);
- File file = new File(String.format("C:\\Users\\midni\\Desktop\\dump\\%s.class", className));
- if(file.exists())
- file.delete();
- file.getParentFile().mkdirs();
- try(FileOutputStream fos = new FileOutputStream(file)) {
- fos.write(classfileBuffer);
- fos.flush();
- fos.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement