diff --git a/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index 92fd797d..9c3641d3 100644 --- a/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -833,10 +833,7 @@ public class BytecodeViewer { } else if (fn.endsWith(".class")) { try { byte[] bytes = JarUtils.getBytes(new FileInputStream(f)); - String cafebabe = String.format("%02X", bytes[0]) - + String.format("%02X", bytes[1]) - + String.format("%02X", bytes[2]) - + String.format("%02X", bytes[3]); + String cafebabe = String.format("%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3]); if(cafebabe.toLowerCase().equals("cafebabe")) { final ClassNode cn = JarUtils.getNode(bytes); diff --git a/src/the/bytecode/club/bytecodeviewer/JarUtils.java b/src/the/bytecode/club/bytecodeviewer/JarUtils.java index 21f5d537..d9df2540 100644 --- a/src/the/bytecode/club/bytecodeviewer/JarUtils.java +++ b/src/the/bytecode/club/bytecodeviewer/JarUtils.java @@ -104,10 +104,7 @@ public class JarUtils { final String name = entry.getName(); if (name.endsWith(".class")) { byte[] bytes = getBytes(jis); - String cafebabe = String.format("%02X", bytes[0]) - + String.format("%02X", bytes[1]) - + String.format("%02X", bytes[2]) - + String.format("%02X", bytes[3]); + String cafebabe = String.format("%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3]); if(cafebabe.toLowerCase().equals("cafebabe")) { try { final ClassNode cn = getNode(bytes);