From 280f044c805165f63462416bb32fdb2ea936c87d Mon Sep 17 00:00:00 2001 From: EpicPlayerA10 Date: Tue, 15 Oct 2024 16:36:56 +0200 Subject: [PATCH] small fix to HP888PackerTransformer and show full exception on catch --- .../core/other/impl/hp888/HP888PackerTransformer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deobfuscator-transformers/src/main/java/uwu/narumi/deobfuscator/core/other/impl/hp888/HP888PackerTransformer.java b/deobfuscator-transformers/src/main/java/uwu/narumi/deobfuscator/core/other/impl/hp888/HP888PackerTransformer.java index d8e0e70..a25394c 100644 --- a/deobfuscator-transformers/src/main/java/uwu/narumi/deobfuscator/core/other/impl/hp888/HP888PackerTransformer.java +++ b/deobfuscator-transformers/src/main/java/uwu/narumi/deobfuscator/core/other/impl/hp888/HP888PackerTransformer.java @@ -53,17 +53,18 @@ protected void transform() throws Exception { cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(Base64.getDecoder().decode(key.get()), "AES")); context().getFiles().forEach((file, bytes) -> { if (file.endsWith(encryptedClassFilesSuffix)) { - String cleanFileName = file.replace(encryptedClassFilesSuffix, "").replace(".", "/"); filesToRemove.add(file); + + String className = file.replace(encryptedClassFilesSuffix, "").replace(".", "/"); try { // Decrypt! byte[] decrypted = cipher.doFinal(bytes); // Load class - newClasses.put(cleanFileName, ClassHelper.loadUnknownClass(cleanFileName, decrypted, ClassReader.SKIP_FRAMES)); + newClasses.put(className, ClassHelper.loadUnknownClass(className + ".class", decrypted, ClassReader.SKIP_FRAMES)); markChange(); } catch (Exception e) { - LOGGER.error(e); + throw new RuntimeException("Failed to decrypt class: " + className, e); } } });