
gargan
Members-
Posts
27 -
Joined
-
Last visited
Everything posted by gargan
-
problem fix thanks for you awesome help!
-
And I have a error without eclipse, with the reobuscate class: 48:12 [iNFOS] [sTDERR] Exception in thread "Skin downloader: http://antibiotique.perso.sfr.fr/skins/gargan.png" java.lang.NoSuchFieldError: imageHeight [00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ImageBufferDownload.func_78432_a(SourceFile:15) [00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ThreadDownloadImageDataINNER1.run(SourceFile:76)
-
Oh my god AMAZING! It works! Thanks a lot for your help! thanks to you I can fix all errors! http://img15.hostingpics.net/thumbs/mini_74611620140709001037.png[/img] But it I reobfbuscate I will have error no? For instance toInjectAreaOpaque2.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageHeight", "I")); will don't work because the obuscate name of ImageBufferDownload it's bfn?
-
Y Yes but aload 0 is alredy before bipush All my problem come to targetnode affectation and bipush index. I have resolved this problem What there are two opcode -1? In my eclipse plugin bytecode outline I see one opcode FRAME SAME? Sorry I don't think to translate my comments I have finish to patch the function... AND I HAVE A ERROR :'( The crash report http://pastebin.com/7yvyMShG obviously there is a cast problem. My code: http://pastebin.com/0TXer5jp I lose hope...
-
I used System.print.out to debug and I have two opcode -1 so I correct the bipush_index + 3 and bipush_index + 4 to bipush_index + 5 and bipush_index + 6 I have also change the loop for targetNode affectation http://pastebin.com/LpfdgKxt But I have the same error I didn't saw you reply I correct this
-
Ok! Before to try to do the condition I try to change this.imageWidth = 64; this.imageHeight = 32; to this.imageWidth = par1BufferedImage.getWidth(); this.imageHeight = par1BufferedImage.getHeight(); So It's the bytecode of the vanilla function: http://pastebin.com/3WZ3yfnc And I do this: http://pastebin.com/tcXz3uZx But I have a crash http://pastebin.com/35umU3Tm I don't understand why!
-
Ok But I need label to add condition if(this.imageHeight != this.imageWidth/2){ return null; } with the opcode IFNONNULL no ? Or I must use LINENUMBER? And what is FRAME SAME ? the bytecode of "this.imageWidth = par1BufferedImage.getWidth();" : mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/image/BufferedImage", "getWidth", "()I", false); mv.visitFieldInsn(PUTFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageWidth", "I"); Why there is ALOAD 0? It serve no purpose!
-
I have get the bytecodes of class modified function http://pastebin.com/kjL7Hc5P vanilla function http://pastebin.com/cVMswNWq But what it's L0 L1 L2... I believe that is the line but they don't is on the good order
-
I have the vanilla class ImageBufferDownload and I want to transform the vanilla function parseUserSkin (http://pastebin.com/E9burVR4) to http://pastebin.com/TSinTCsA. So I try to change line to line like in the tutorial. But here, I have a lot of change. I think this method isn't feasible in this case. I looked for a other method to change the function. I think to do this: remove all instruction in parseUserSkin and, instead of instruction add a call to a static function. But I can't do this beacause in parseUserSkin I need to call functions and change field witch are in ImageBufferDownload
-
I try to patch the class line to line like in this tutorial http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editingbut i have almost all the line to change is very laborious! How can do this differently? I think delete all the instruction and call a function like I have do to the getSkin function but I cant because I need to change field and call metho of the class ImageBufferDownload
-
Yes but i must use what method of the asm library to do that?
-
I want to rewrite parseUserSkin to support the hd. I think the most easy is to do this: - I will delete all the the instructions - I add a call to a method - I rewrite parseUserSkin in this method But, to do this, I need to access to the field and change their value So I think use fieldvisitor to have the value of the field but I don't know how change the value and call functions in ImageBufferDownload.
-
I can get the field with field visitor but how change the fields? And how call a method like hastransparence since a other class with asm?
-
Ok so I will to change to patch only parseskin. I have a problem to optifine: We don't see the skin when optifine is installed. do you know why? And how access to the field imageheight et imagewidht with asm?
-
Yes but the class is replaced with ASM thank's to the method patchJar. It's not good?
-
Thanks a lot It's working!
-
But i know what I do and It work perfectly in eclipse SkinClassTransformer http://pastebin.com/Tm6HXd6N SkinDummyContainer http://pastebin.com/bkMD0QMF SkinFMLLoadingPlugin http://pastebin.com/LXL0vT4i PlayerCustom http://pastebin.com/XiNXsb8R ImageBufferDowload http://pastebin.com/u7HrdK9k I think that it is the reobsbuscate whitch don't work
-
Hi! I have done a mod to replace skin and cape with the hd support. It work perfectly in eclipse but I have always the same error when I run minecraft Forge normally, there is a crash: [00:16:33 INFO]: Client> 2014-07-06 00:16:33 [iNFOS] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main} [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* INSIDE OBFUSCATED AbstractClientPlayer TRANSFORMER ABOUT TO PATCH: beu [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: <init> Desc:(Labw;Ljava/lang/String;)V [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: l Desc:()V [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: p Desc:()Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: q Desc:()Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: r Desc:()Lbjo; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: s Desc:()Lbjo; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: b Desc:(Lbjo;Ljava/lang/String;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;Lbjo;Lbfi;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: d Desc:(Ljava/lang/String;)Ljava/lang/String; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target method1! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method1 Complete! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: e Desc:(Ljava/lang/String;)Ljava/lang/String; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target2 method! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method2 Complete! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [GRAVE] [ForgeModLoader] Unable to launch [00:16:36 INFO]: Client> java.lang.reflect.InvocationTargetException [00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [00:16:36 INFO]: Client> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [00:16:36 INFO]: Client> at java.lang.reflect.Method.invoke(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.main(Launch.java:27) [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP [00:16:36 INFO]: Client> at net.minecraft.client.main.Main.main(SourceFile:37) [00:16:36 INFO]: Client> ... 6 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 7 more [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method) [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178) [00:16:36 INFO]: Client> ... 9 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityPlayerSP [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 13 more [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/AbstractClientPlayer [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method) [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178) [00:16:36 INFO]: Client> ... 15 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.AbstractClientPlayer [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 19 more [00:16:36 INFO]: Client> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: bic [00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.ClassNode.accept(Unknown Source) [00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.patchClassASM(SkinClassTransformer.java:157) [00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.transform(SkinClassTransformer.java:30) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) [00:16:36 INFO]: Client> ... 21 more [00:16:36 INFO]: Game ended with no troubles detected (exit code 0) I suppose that src are not obsfuscated but I don't understand why!
-
Thank you very much! I hesitated when I wrote imports, but I thought that was good EventBus Forge
-
Hi! I try to create a coremod but, when I start minecraft I have this error message: Mod pickandcraft has been disabled through configuration I have though add registerBus but i have still this error. Moreover I can't add Override anotation because "The method registerBus(EventBus, LoadController) of type SkinDummyContainer must override or implement a supertype method". I have look and the method registerBus is in DummyContainer! My IFMLLoadingPlugin is referencing the true ModContainer. package fr.lefgolas.pickandcraft; import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.EventBus; import cpw.mods.fml.common.registry.GameRegistry; public class SkinDummyContainer extends DummyModContainer { public SkinDummyContainer() { super(new ModMetadata()); ModMetadata meta = getMetadata(); meta.modId = "skincustom"; meta.name = "Skin Custom"; meta.version = "1.0"; //String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion); meta.credits = "gargan"; meta.authorList = Arrays.asList("gargan"); meta.description = "Créer votre skin et uploader le ici: http://publicite-influence.olympe.in/"; meta.url = "http://publicite-influence.olympe.in/"; meta.updateUrl = ""; meta.screenshots = new String[0]; meta.logoFile = ""; } @Instance("SkinCustom") public static SkinDummyContainer instance; public static Block blockEvan; @EventHandler public void preInit(FMLPreInitializationEvent event) { } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { } @Override public boolean registerBus(EventBus bus, LoadController controller) { bus.register(this); return true; } }
-
I feel so stupid... tanks you very much!
-
No, I want also patch getSkinUrl! More over the library is complicated for that i want do! And i want patch other functions. This is why I want understand why ASM don't work I would like use ASM because is most simple.
-
Yes I trying to patch getSkinUrl and getCapeUrl package fr.lefgolas.pickandcraft; import static org.objectweb.asm.Opcodes.ARETURN; import static org.objectweb.asm.Opcodes.ALOAD; import static org.objectweb.asm.Opcodes.INVOKESTATIC; import java.util.Iterator; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.VarInsnNode; public class SkinClassTransformer implements net.minecraft.launchwrapper.IClassTransformer { @Override public byte[] transform(String arg0, String arg1, byte[] arg2) { //on cherche la classe qui nous interressent. On gère les deux cas: si elle est "obscurcie" ou pas if (arg0.equals("beu")) { System.out.println("********* INSIDE OBFUSCATED AbstractClientPlayer TRANSFORMER ABOUT TO PATCH: " + arg0); return patchClassASM(arg0, arg2, true); } if (arg0.equals("net.minecraft.client.entity.AbstractClientPlayer")) { System.out.println("********* INSIDE AbstractClientPlayer TRANSFORMER ABOUT TO PATCH: " + arg0); return patchClassASM(arg0, arg2, false); } return arg2; } public byte[] patchClassASM(String name, byte[] bytes, boolean obfuscated) { String targetMethod1Name = "", targetMethod2Name = ""; boolean ok1 = false, ok2 = false; if(obfuscated == true) { targetMethod1Name ="d"; targetMethod2Name = "e"; } else { targetMethod1Name ="getSkinUrl"; targetMethod2Name = "getCapeUrl"; } //on prépare la manipulation ClassNode classNode = new ClassNode(); ClassReader classReader = new ClassReader(bytes); classReader.accept(classNode, 0); //Maintenant, on boucle sur toutes les méthodes déclarées dans la classe jusqu'à trouver la/les methode(s) cible(s) Iterator<MethodNode> methods = classNode.methods.iterator(); while(methods.hasNext()) { MethodNode m = methods.next(); System.out.println("********* Method Name: "+m.name + " Desc:" + m.desc); //On vérifie si il s'agit de la méthode cible et si elle a la même signature (plus de détail ici: http://journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/method.html) if ((m.name.equals(targetMethod1Name) && m.desc.equals("(Ljava/lang/String;)Ljava/lang/String;"))) { System.out.println("********* Inside target method1!"); //on créer une liste d'instruction pour invoquer une méthode statique InsnList toInject = new InsnList(); toInject.add(new VarInsnNode(ALOAD, 0)); //new MethodInsnNode(on déclare le type de la méthode, "le chemin de la classe", "le nom de la méthode", "sa signature") toInject.add(new MethodInsnNode(INVOKESTATIC, "fr.lefgolas.pickandcraft/PlayerCustom", "getURLSkinCustom", "(Ljava/lang/String;)Ljava/lang/String;")); toInject.add(new InsnNode(ARETURN)); // on remplace les instructions déjà présente dans la méthode par notre liste d'instruction m.instructions = toInject; ok1 = true; System.out.println("Patching Method1 Complete!"); } else if ((m.name.equals(targetMethod2Name) && m.desc.equals("(Ljava/lang/String;)Ljava/lang/String;"))) { System.out.println("********* Inside target2 method!"); InsnList toInject = new InsnList(); toInject.add(new VarInsnNode(ALOAD, 0)); toInject.add(new MethodInsnNode(INVOKESTATIC, "fr.lefgolas.pickandcraft/PlayerCustom", "getURLCapeCustom", "(Ljava/lang/String;)Ljava/lang/String;")); toInject.add(new InsnNode(ARETURN)); // on remplace les instructions déjà présente dans la méthode par notre liste d'instruction m.instructions = toInject; ok2 = true; System.out.println("Patching Method2 Complete!"); } if(ok1 && ok2) break; } //on finit la manipulation ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES); classNode.accept(writer); return writer.toByteArray(); } }
-
Hi! I try add a invocation's method with ASM in AbstractPlayer. This work perfect in 1.6.4 but it's illegal in 1.7.2. I have a error: according to forge I modify the vanilla class! But i can do this differently! Sorry for my english i don't speak very well english
-
AMAZING!! It work! Moreover, thanks to you I have understand a little how work the JVM. My problem is resolve!