Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2015, 13:56
bridgeic bridgeic is offline
Friend
 
Join Date: Jun 2012
Posts: 90
Rept. Given: 7
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 6 Posts
bridgeic Reputation: 3
Arrow When use "vendor defined encryption routines", how to set daemon related part?

When use "vendor defined encryption routines" reference article below, how to set daemon related part (I mean make the daemon file has the encryption routines also)? Which file should be modified?

http://www.woodmann.com/crackz/Tutorials/Amante1.htm

I try settings below, can be compiled, but when use the generated daemon 'blendered' to start license below, it reports error below, any friend can give some suggestion?

Invalid license key (inconsistent encryption code for "f1"

i86_n3\makefile
blenderd.exe : lmrand1.exe lsvendor.obj lmappfil.obj
$(LD) $(LFLAGS) /out:$*.exe lsvendor.obj lm_new.obj lmappfil.obj \
$(DAEMON_LIBS) $(CLIBS)

machind\lmappfil.c
#include <stdio.h>
#if (defined( __STDC__) || defined(_WINDOWS)) && !defined(apollo)
#include <stdlib.h>
#endif
#include <time.h>
#include "lmclient.h"
#include "lm_code.h"
#include "lm_attr.h"
/* LM_CODE(site_code, ENCRYPTION_SEED1, ENCRYPTION_SEED2, VENDOR_KEY1, */
/* VENDOR_KEY2, VENDOR_KEY3, VENDOR_KEY4, VENDOR_KEY5); */

/* My vendor defined encryption routine */
char *my_crypt(LM_HANDLE *lm_job, CONFIG *conf, char *sdate, VENDORCODE *key)
{
char *lic_key;
char *modify_key(char *); // prototype

lc_set_attr(lm_job, LM_A_USER_CRYPT, (LM_A_VAL_TYPE)0);
lic_key = lc_crypt(lm_job, conf, sdate, key); // This is the normal way to get the license key
lc_set_attr(lm_job, LM_A_USER_CRYPT,(LM_A_VAL_TYPE)my_crypt);

/* modify the license-key */

return(modify_key(lic_key));
}

char *modify_key(char *key)
{
return ("123456789123"); // just return a constant string
// This function could contain a really complicated algorithm
// to change the normal license key in some way
// but who cares.
}

machind\lsvendor.c

/* Vendor encryption routine */
extern char *my_crypt(LM_HANDLE *, CONFIG *, char *, VENDORCODE *); // prototype for my encryption function
char *(*ls_user_crypt)() = my_crypt;
Reply With Quote
  #2  
Old 01-21-2015, 03:41
nikkapedd nikkapedd is offline
VIP
 
Join Date: Mar 2011
Location: ::Bratva::
Posts: 276
Rept. Given: 275
Rept. Rcvd 151 Times in 65 Posts
Thanks Given: 204
Thanks Rcvd at 276 Times in 112 Posts
nikkapedd Reputation: 100-199 nikkapedd Reputation: 100-199
bridgeic, what are you looking for..?? Are you trying to build a vendor with the crypt filtres...???? The thing is a little hard than is wrote in the Amante1 old article.. And i strongly suggest you to read carefully the flexlm programmes guide.. Here a little thing that comes after you build your magic 3 seed filtrers

Code:
The tool also generates 2 source files, which you must *never edit*:
lmappfil.c: must be linked into vendor daemon, and all applications
            calling lc_checkout().  These applications must call
                lc_set_attr(lm_job, LM_A_USER_CRYPT_FILTER,
                                        (LM_A_VAL_TYPE)user_crypt_filter);
            after lc_new_job().  Also, lsvendor.c must have
                extern void user_crypt_filter();
                void (*ls_a_user_crypt_filter)() = user_crypt_filter;

lmkeyfil.c: this must be linked into all license generators:
            makekey, lmcrypt, programs that call lc_cryptstr().
            In these programs, after lc_init(), call
                lc_set_attr(lm_job, LM_A_USER_CRYPT_FILTER_GEN,
                                (LM_A_VAL_TYPE)user_crypt_filter_gen);
This is only part....
Reply With Quote
  #3  
Old 01-21-2015, 05:59
bridgeic bridgeic is offline
Friend
 
Join Date: Jun 2012
Posts: 90
Rept. Given: 7
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 6 Posts
bridgeic Reputation: 3
Quote:
Originally Posted by nikkapedd View Post
bridgeic, what are you looking for..?? Are you trying to build a vendor with the crypt filtres...????
Hello nikkapedd,

It's not crypt_filter(xor/premute table method that I have known), but user_crypt(you can see the article I list), it's different with crypt_filter. I have generated the lmcrypt.exe successfully, but failed on right daemon generation.

I have another real case use both crypt_filter(on cvd[common vendor daemon] primary daemon) and user_crypt(on cvd secondary daemon), I want make clear about the latter one through this small demo case that Amante1 gave. I'm just so so on C program, would you please help me check how to link the user defined routine(named my_crypt that the article gave) into the daemon file 'blenderd'? What's wrong with my setting?

Last edited by bridgeic; 01-21-2015 at 06:05.
Reply With Quote
  #4  
Old 01-21-2015, 06:14
nikkapedd nikkapedd is offline
VIP
 
Join Date: Mar 2011
Location: ::Bratva::
Posts: 276
Rept. Given: 275
Rept. Rcvd 151 Times in 65 Posts
Thanks Given: 204
Thanks Rcvd at 276 Times in 112 Posts
nikkapedd Reputation: 100-199 nikkapedd Reputation: 100-199
bridgeic,i had your same problem when i builded my first crypt_filtrer daemon: lmcrypt ok, but any daemon present in the folder.. You need to look deeply inside the Visual studio log. Check also the configuration on the files in the machind folder and of course read the sdk programmes guide.. I never builded this type of vendor....
Reply With Quote
  #5  
Old 01-21-2015, 08:37
bridgeic bridgeic is offline
Friend
 
Join Date: Jun 2012
Posts: 90
Rept. Given: 7
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 6 Posts
bridgeic Reputation: 3
Quote:
Originally Posted by nikkapedd View Post
bridgeic,i had your same problem when i builded my first crypt_filtrer daemon: lmcrypt ok, but any daemon present in the folder.. You need to look deeply inside the Visual studio log. Check also the configuration on the files in the machind folder and of course read the sdk programmes guide.. I never builded this type of vendor....
Hello nikkapedd,

Yes, I will. There is few descripion in the doucment, mainly I have few knowledge and experience on c programming, so some difficult. Would you kindly help to check also if have time? thank you.
Reply With Quote
  #6  
Old 01-22-2015, 08:44
swlepus swlepus is offline
Friend
 
Join Date: Nov 2011
Posts: 23
Rept. Given: 6
Rept. Rcvd 5 Times in 2 Posts
Thanks Given: 0
Thanks Rcvd at 6 Times in 5 Posts
swlepus Reputation: 5
Yes, agree with nikkapedd. for patch the program, just patch lc_checkout.

Quote:
Originally Posted by nikkapedd View Post
bridgeic, what are you looking for..?? Are you trying to build a vendor with the crypt filtres...???? The thing is a little hard than is wrote in the Amante1 old article.. And i strongly suggest you to read carefully the flexlm programmes guide.. Here a little thing that comes after you build your magic 3 seed filtrers

Code:
The tool also generates 2 source files, which you must *never edit*:
lmappfil.c: must be linked into vendor daemon, and all applications
            calling lc_checkout().  These applications must call
                lc_set_attr(lm_job, LM_A_USER_CRYPT_FILTER,
                                        (LM_A_VAL_TYPE)user_crypt_filter);
            after lc_new_job().  Also, lsvendor.c must have
                extern void user_crypt_filter();
                void (*ls_a_user_crypt_filter)() = user_crypt_filter;

lmkeyfil.c: this must be linked into all license generators:
            makekey, lmcrypt, programs that call lc_cryptstr().
            In these programs, after lc_init(), call
                lc_set_attr(lm_job, LM_A_USER_CRYPT_FILTER_GEN,
                                (LM_A_VAL_TYPE)user_crypt_filter_gen);
This is only part....
Reply With Quote
  #7  
Old 01-22-2015, 11:35
bridgeic bridgeic is offline
Friend
 
Join Date: Jun 2012
Posts: 90
Rept. Given: 7
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 6 Posts
bridgeic Reputation: 3
Update:

After debug the created daemon 'blenderd.exe' with ollydbg, I found the possible reason as below.

I posted here use return ("123456789123") in lmappfil.c, but at my side the real value I used is return ("123456789abc"). After change it back to return ("123456789123") and recompiled, the daemon works now.

Seems the return value can only use digital number 0~9, when use "a,b,c...", it doesn't work, don't know why.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vendor Defined Host-ID rcer General Discussion 12 10-02-2018 09:00
Wlscgen: Are "Vendor Id" and "Developer Id" different ? Numega Softice General Discussion 6 02-12-2007 18:12


All times are GMT +8. The time now is 04:05.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )