Сейчас на форуме: (+5 невидимых)

 eXeL@B —› WorldWide —› Flexlm 11.9 in jar
Посл.ответ Сообщение

Ранг: 1.4 (гость)
Активность: 0=0
Статус: Участник

Создано: 22 октября 2014 16:40 · Поправил: mrvanity
· Личное сообщение · #1

Hello guys.
I am soory but i dont know any russian

I have an application that is written in Java and protected with flexlm.
The jar is not obfuscated.I can see the code in Java Decompiler without a problem.
At the installation the program installs a 10 days demo license.Besides the time limit, the demo is with limited functionality. (cant print etc)
The target (jar and license) is this
Code:
  1. http://multiupload.biz/2cv1z2zao614/target_MultiUpload.biz.zip.html


There are resources about flexlm but very little about flexlm with java. ( i found only 3-4 topics.One of them in this forum)

i see that the flexlm version is 11.9 in FlexlmConstants

Code:
  1. public abstract interface FlexlmConstants
  2. {
  3.   public static final byte FLEXLM_VERSION = 11;
  4.   public static final byte FLEXLM_REVISION = 9;

I could not find VendorKeys, EncryptionSeed and CRO Keys in jar file.
What i realized is that i have to patch the pubkeyVerify function in com/macrovision/flexlm/lictext/Prikey.class to always return true.
This is PriKey.class

Code:
  1. package com.macrovision.flexlm.lictext;
  2.  
  3. import com.certicom.ecc.jcae.Certicom;
  4. import com.certicom.ecc.scheme.ECDSA;
  5. import com.certicom.ecc.system.SystemConfig;
  6. import com.certicom.ecc.util.Conversion;
  7. import com.macrovision.flexlm.FlexlmConstants;
  8. import com.macrovision.flexlm.FlexlmException;
  9. import com.macrovision.flexlm.VendorInfo;
  10. import java.io.PrintStream;
  11. import java.security.InvalidKeyException;
  12. import java.security.KeyFactory;
  13. import java.security.NoSuchAlgorithmException;
  14. import java.security.NoSuchProviderException;
  15. import java.security.PublicKey;
  16. import java.security.Security;
  17. import java.security.Signature;
  18. import java.security.SignatureException;
  19. import java.security.spec.InvalidKeySpecException;
  20. import java.security.spec.X509EncodedKeySpec;
  21. import javax.security.spec.ECRawPublicKeySpec;
  22. import javax.security.spec.F2mParameterSpec;
  23.  
  24. public class PriKey
  25.   implements FlexlmConstants
  26. {
  27.   static final String CVSId = "$Id";
  28.   protected static String certicomName;
  29.   protected static final String signatureAlgorithmName = "ECDSA";
  30.  
  31.   public static boolean pubkeyVerify(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, VendorInfo paramVendorInfo, int paramInt)
  32.     throws FlexlmException
  33.   {
  34.     System.setProperty("JDK_1_3_Compatibility", "YES");
  35.     String str1 = initCerticom();
  36.     if (str1 == null)
  37.       throw new FlexlmException(-514, 4026);
  38.     SystemConfig localSystemConfig = SystemConfig.getConfig();
  39.     localSystemConfig.setConformance(16);
  40.     localSystemConfig.setPtCompression(2);
  41.     localSystemConfig.setFormat(10);
  42.     switch (paramInt)
  43.     {
  44.     case 2:
  45.       break;
  46.     case 3:
  47.       localSystemConfig.setCurve("sect163k1");
  48.       break;
  49.     case 4:
  50.       localSystemConfig.setCurve("sect239k1");
  51.       break;
  52.     default:
  53.       throw new FlexlmException(-515, 4027);
  54.     }
  55.     PublicKey localPublicKey1 = paramVendorInfo.getPublicKey(paramInt);
  56.     if (localPublicKey1 == null)
  57.       throw new FlexlmException(-515, 4028);
  58.     byte[] arrayOfByte = localPublicKey1.getEncoded();
  59.     PublicKey localPublicKey2 = null;
  60.     ECRawPublicKeySpec localECRawPublicKeySpec = null;
  61.     X509EncodedKeySpec localX509EncodedKeySpec = null;
  62.     boolean bool;
  63.     try
  64.     {
  65.       KeyFactory localKeyFactory = KeyFactory.getInstance("ECDSA");
  66.       if (paramInt == 2)
  67.       {
  68.         ECDSA.setThreadOldHashTruncate(true);
  69.         int[] arrayOfInt = { 9 };
  70.         String str2 = "1.3.132.0.4";
  71.         F2mParameterSpec localF2mParameterSpec = new F2mParameterSpec(Conversion.HexString2OS("3088250ca6e7c7fe649ce85820f7"), Conversion.HexString2OS("e8bee4d3e2260744188be0e9c723"), Conversion.HexString2OS("10e723ab14d696e6768756151756febf8fcb49a9"), Conversion.HexString2OS("9d73616f35f4ab1407d73562c10f"), Conversion.HexString2OS("a52830277958ee84d1315ed31886"), Conversion.HexString2OS("100000000000000d9ccec8a39e56f"), 2, 113, arrayOfInt, str2);
  72.         localECRawPublicKeySpec = new ECRawPublicKeySpec(arrayOfByte, localF2mParameterSpec);
  73.         localPublicKey2 = localKeyFactory.generatePublic(localECRawPublicKeySpec);
  74.       }
  75.       else
  76.       {
  77.         localX509EncodedKeySpec = new X509EncodedKeySpec(arrayOfByte);
  78.         localPublicKey2 = localKeyFactory.generatePublic(localX509EncodedKeySpec);
  79.       }
  80.       Signature localSignature = Signature.getInstance("ECDSA", str1);
  81.       localSignature.initVerify(localPublicKey2);
  82.       localSignature.update(paramArrayOfByte1);
  83.       bool = localSignature.verify(paramArrayOfByte2);
  84.     }
  85.     catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
  86.     {
  87.       throw new FlexlmException(-515, 4029);
  88.     }
  89.     catch (InvalidKeySpecException localInvalidKeySpecException)
  90.     {
  91.       throw new FlexlmException(-515, 4030);
  92.     }
  93.     catch (InvalidKeyException localInvalidKeyException)
  94.     {
  95.       throw new FlexlmException(-515, 4031);
  96.     }
  97.     catch (NoSuchProviderException localNoSuchProviderException)
  98.     {
  99.       throw new FlexlmException(-515, 4032);
  100.     }
  101.     catch (SignatureException localSignatureException)
  102.     {
  103.       throw new FlexlmException(-515, 4033);
  104.     }
  105.     return bool;
  106.   }
  107.  
  108.   protected static String initCerticom()
  109.   {
  110.     if (certicomName != null)
  111.       return certicomName;
  112.     Certicom localCerticom = new Certicom();
  113.     if (Security.addProvider(localCerticom) < 0);
  114.     certicomName = localCerticom.getName();
  115.     return certicomName;
  116.   }
  117.  
  118.   public static void printBytes(byte[] paramArrayOfByte)
  119.   {
  120.     for (int i = 0; i < paramArrayOfByte.length; i++)
  121.     {
  122.       System.out.print(Integer.toString(paramArrayOfByte[i] & 0xFF, 16));
  123.       System.out.print(" ");
  124.     }
  125.   }
  126.  
  127.   public static void printBytes(String paramString, byte[] paramArrayOfByte)
  128.   {
  129.     System.out.print(paramString + " = { ");
  130.     printBytes(paramArrayOfByte);
  131.     System.out.println(" }");
  132.   }


How do i patch that damn thing?

After that i have to somehow find the VendorKeys, EncryptionSeed CRO Keys and prouce licenses with the SDK.Correct? (i have the 11.9.1 SDK)
Or do i have to replace public key?
Can i use any of the generic keygens?

Please excuse my ignorance on flexlm. I am a bit confused.
Many of the sources i read via google translate.

My regards.

Добавлено спустя 1 час 2 минуты
Turns out some parts where obfuscated

All the keys are in LicenseInfo.class
Code:
  1.   public final int[] getEncryptionSeeds() { return new int[] { -1882844923, 1133964589 };
  2.   }
  3.  
  4.   public final int[] getVendorKeys()
  5.   {
  6.     return new int[] { 1547477132, -1972564441, 2050306822, 784942483, 912796032 };
  7.   }
  8.  
  9.   public final int[] getCroKeys()
  10.   {
  11.     return new int[] { -1041356627, -166165190 };
  12.   }


So i have to patch PriKey.class (somehow) and then keygen the application using the found keys?

My regards



Ранг: 456.3 (мудрец), 340thx
Активность: 0.280.02
Статус: Участник
Android Reverser

Создано: 22 октября 2014 17:51
· Личное сообщение · #2

mrvanity
Code:
  1.  
  2.   public final String getVendorName()
  3.   {
  4.     return "orthview";
  5.   }
  6.   
  7.   public final PublicKey getPublicKey(int strength)
  8.   {
  9.     switch (strength)
  10.     {
  11.     case 2: 
  12.       return new FlexlmPublicKey(getVendorName(), "728F998157B072D7D7D7E00049C26392");
  13.     case 3: 
  14.       return new FlexlmPublicKey(getVendorName(), "719167321CEE42A56DE01BE3D07A10450AFE284287D3");
  15.     case 4: 
  16.       return new FlexlmPublicKey(getVendorName(), "72A38BA8A743464E61EED242731335CC568972000AA3745FE376410830D9AE");
  17.     }
  18.     return null;
  19.   }
  20.   
  21.   public final int[] getEncryptionSeeds()
  22.   {
  23.     return new int[] { -1882844923, 1133964589 };
  24.   }
  25.   
  26.   public final int[] getVendorKeys()
  27.   {
  28.     return new int[] { 1547477132, -1972564441, 2050306822, 784942483, 912796032 };
  29.   }
  30.   
  31.   public final int[] getCroKeys()
  32.   {
  33.     return new int[] { -1041356627, -166165190 };
  34.   }
  35.   
  36.   public final int getDefaultStrength()
  37.   {
  38.     return 4;
  39.   }


-----
SaNX



 eXeL@B —› WorldWide —› Flexlm 11.9 in jar
:: Ваш ответ
Жирный  Курсив  Подчеркнутый  Перечеркнутый  {mpf5}  Код  Вставить ссылку 
:s1: :s2: :s3: :s4: :s5: :s6: :s7: :s8: :s9: :s10: :s11: :s12: :s13: :s14: :s15: :s16:


Максимальный размер аттача: 500KB.
Ваш логин: german1505 » Выход » ЛС
   Для печати Для печати