#1
|
|||
|
|||
Vendor Defined Host-ID
I am working on an executable which is protected by Flexlm v10.8.
I extracted enc seed 1 & 2 from the executable and build lmcrypt, but the license keys generated are invalid. So I looked at the daemon, and noticed that enc seed 1 & 2 are different' so I build lmcrypt(2) with the new seeds, but also this time license keys are invalid. I checked patching of l_ckout_string_key, and this will display the correct key@ EOFunction. License format is : FEATURE feature daemon 1.0 permanent uncounted \ HOSTID=VDH=HOSTID=VDH=104AMYXXXXXXXX SIGN=12, where "XXXXXXXX" is the serial number of the device. I then changed the license format to: FEATURE infxxxxxx_feature deamon 1.0 permanent uncounted HOSTID=DISK_SERIAL_NUM=xxxxxxxx SIGN=12, and this time lmcrypt(2) generates the correct keys. I did a little bit of reading and found that HOSTID=VDH stands for "vendor defined host-id", and that lmcrypt needs to be specifically build for this. So I followed the instructions from FLEXnet Licensing 11.4: Programming and Reference Guide for License File-based Licensing Chapter 12: Vendor-Defined Hostid Types, but when try to build lmcrypt I receive the following error: Microsoft (R) Program Maintenance Utility Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. cl /nologo /c /I..\machind /I. /MT /O1 ..\machind\lmflex.c lmflex.c LINK /nologo /NODEFAULTLIB /OPT:NOREF /out:lmflex.exe lmflex.obj vendor_hostid.obj lm_new.obj lmgr.lib libsb.lib libcrvs.lib oldnames.lib kernel32.lib user32.lib netapi32.lib advapi32.lib gdi32.lib comdlg32.lib comctl32.lib wsock32.lib libcmt.lib LINK : fatal error LNK1181: cannot open input file 'vendor_hostid.obj' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\LINK.EXE"' : return code '0x49d' Stop. C:\Flexlm\v10.8\i86_n3-10.8.6\i86_n3> What am I doing wrong? I have googled this error, but could not find a solution for info I have included a copy of my makefile below: ######################################################################### # Copyright (c) 2003-2007 Macrovision Europe Ltd. and/or Macrovision Corporation. All Rights Reserved. # This software has been provided pursuant to a License Agreement # containing restrictions on its use. This software contains # valuable trade secrets and proprietary information of # Macrovision Corporation and is protected by law. It may # not be copied or distributed in any form or medium, disclosed # to third parties, reverse engineered or used in any manner not # provided for in said License Agreement except with the prior # written authorization from Macrovision Corporation. ########################################################################## # # FLEXLM makefile for PCs # If you have a real kit, change VENDORNAME=demo below to your real # vendor daemon name # Use nmake DLL=1 for dll clients # Use nmake MD=1 for dynamic runtime library: msvcrt.lib # VENDORNAME = agilent DAEMON = $(VENDORNAME).exe SRCDIR = ..\machind !ifdef DEBUG XTRACFLAG=/Zi /Od LDFLAGS=/DEBUG CNAME=d !else XTRACFLAG = /O1 LDFLAGS = CNAME= !endif LD = LINK /nologo /NODEFAULTLIB /OPT:NOREF $(LDFLAGS) RC = RC INCFLAGS = /I$(SRCDIR) /I. !ifdef DLL LMGRNAME=10 MDNAME= DLL_FLAG=/DFLEXLM_DLL CRT_LIB=libcmt$(CNAME).lib LMNEW_OBJ=lm_new.obj LMNEW_OBJ_CLIENT= CRT_FLAG=/MT$(CNAME) !else !ifdef MD LMGRNAME=_md LMNEW_OBJ=lm_new_md.obj CRT_FLAG=/MD$(CNAME) CRT_LIB=msvcrt$(CNAME).lib LMNEW_OBJ_CLIENT=$(LMNEW_OBJ) !else LMGRNAME= CRT_FLAG=/MT$(CNAME) LMNEW_OBJ=lm_new.obj LMNEW_OBJ_CLIENT=$(LMNEW_OBJ) CRT_LIB=libcmt$(CNAME).lib !endif MDNAME=$(LMGRNAME) !endif LMGR_LIB=lmgr$(LMGRNAME).lib XTRALIB1 = oldnames.lib kernel32.lib user32.lib netapi32.lib \ advapi32.lib gdi32.lib comdlg32.lib comctl32.lib wsock32.lib XTRALIB = $(XTRALIB1) $(CRT_LIB) XTRACFLAG=$(XTRACFLAG) $(DLL_FLAG) # # Use XTRAOBJS to define your object files for vendor daemon # initialization routines, checkout filter, checkin callback, etc. # XTRAOBJS = CFLAGS_NOOPT = /nologo /c $(INCFLAGS) $(CRT_FLAG) $(XTRACFLAG) CFLAGS = $(CFLAGS_NOOPT) LMNEW_CFLAGS = /nologo /c $(INCFLAGS) $(CRT_FLAG) $(DLL_FLAG) SRCS = $(SRCDIR)\lsvendor.c EXECS = lmsimple.exe lmflex.exe lmwin.exe lmclient.exe lmcrypt.exe installs.exe vendor_hostid.obj CLIENTLIB = $(LMGR_LIB) libsb$(MDNAME).lib libcrvs$(MDNAME).lib STATIC_CLIENTLIB = lmgr$(MDNAME).lib libsb$(MDNAME).lib libcrvs$(MDNAME).lib LIBS = lmgras$(MDNAME).lib lmgrs$(MDNAME).lib $(STATIC_CLIENTLIB) DAEMONLIBS = lmgras$(MDNAME).lib lmgrs$(MDNAME).lib lmgr$(MDNAME).lib libsb$(MDNAME).lib libcrvs$(MDNAME).lib EVENTLOGMESSAGEFILE = VendorLicenseServerMsgs EVENTLOGMESSAGEFILE2 = MvsnLicenseServerMsgs all: lmwin.res \ !ifdef DLL lmgr10.dll ltclient.exe \ !endif $(EXECS) $(DAEMON) utils daemon: $(DAEMON) $(DAEMON): $(XTRAOBJS) $(DAEMONLIBS) lsvendor.obj $(SRCDIR)\lsserver.h $(LMNEW_OBJ) $(LD) /subsystem:console /out:$(DAEMON) lsvendor.obj vendor_hostid.obj $(LMNEW_OBJ) \ $(XTRAOBJS) $(DAEMONLIBS) $(CRT_LIB) $(XTRALIB1) vendor_hostid.obj: $(SRCDIR)\vendor_hostid.c $(CC) $(CFLAGS) -I../h $(SRCDIR)\vendor_hostid.c lsvendor.obj: lm_new.obj $(CC) $(CFLAGS) -I../h /Fo$@ lsrvend.c $(LMNEW_OBJ): $(SRCDIR)\lsvendor.c $(SRCDIR)\lm_code.h lmrand1 -i $(SRCDIR)\lsvendor.c $(CC) /c $(LMNEW_CFLAGS) -I../h lmcode.c $(LD) /subsystem:CONSOLE lmnewgen$(MDNAME).obj lmcode.obj \ lmgr$(MDNAME).lib libcrvs$(MDNAME).lib libsb$(MDNAME).lib $(XTRALIB1) $(CRT_LIB) /out:lmnewgen.exe if exist lm_new.c del lm_new.c lmnewgen.exe $(VENDORNAME) -o lm_new.c $(CC) $(LMNEW_CFLAGS) /Fo$(LMNEW_OBJ) lm_new.c lmcrypt.exe: $(SRCDIR)\lmcrypt.c \ $(SRCDIR)\lmclient.h $(SRCDIR)\lm_code.h $(STATIC_CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\lmcrypt.c $(LD) /out:lmcrypt.exe lmcrypt.obj vendor_hostid.obj $(STATIC_CLIENTLIB) $(XTRALIB) validdat.exe: $(SRCDIR)\validdat.c $(CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\validdat.c $(LD) /out:validdat.exe validdat.obj $(CLIENTLIB) $(XTRALIB) if exist validdat.obj del validdat.obj lmclient.exe: $(SRCDIR)\lmclient.c $(LMNEW_OBJ_CLIENT) \ $(CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\lmclient.c $(LD) /out:lmclient.exe lmclient.obj $(LMNEW_OBJ_CLIENT) $(CLIENTLIB) $(XTRALIB) if exist lmclient.obj del lmclient.obj lmsimple.exe: $(SRCDIR)\lmsimple.c $(LMNEW_OBJ_CLIENT) \ $(CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\lmsimple.c $(LD) /out:lmsimple.exe lmsimple.obj $(LMNEW_OBJ_CLIENT)\ $(CLIENTLIB) $(XTRALIB) if exist lmsimple.obj del lmsimple.obj lmwin.exe: $(SRCDIR)\lmwin.c $(LMNEW_OBJ_CLIENT) $(CC) $(CFLAGS) $(SRCDIR)\lmwin.c $(RC) $(SRCDIR)\lmwin.rc $(LD) /out:lmwin.exe lmwin.obj $(LMNEW_OBJ_CLIENT) \ $(SRCDIR)\lmwin.res $(CLIENTLIB) $(XTRALIB) if exist lmwin.obj del lmwin.obj lmflex.exe: $(SRCDIR)\lmflex.c $(LMNEW_OBJ) \ $(CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\lmflex.c $(LD) /out:lmflex.exe lmflex.obj vendor_hostid.obj $(LMNEW_OBJ_CLIENT) $(CLIENTLIB) $(XTRALIB) if exist lmflex.obj del lmflex.obj installs.exe: $(SRCDIR)\installs.c $(CC) $(CFLAGS) $(SRCDIR)\installs.c $(LD) /out:installs.exe installs.obj $(XTRALIB) if exist installs.obj del installs.obj lmwin.res: $(SRCDIR)\lmwin.rc rc /l 0x409 /r /folmwin.res $(SRCDIR)\lmwin.rc lmgr10.dll: $(LMNEW_OBJ) $(SRCDIR)\lmgr10.c $(CC) $(CFLAGS) $(SRCDIR)\lmgr10.c $(LD) /def:"$(SRCDIR)\lmgr10.def" \ /out:lmgr10.dll lmgr10.obj /implib:"lmgr10.lib" /dll \ $(LMNEW_OBJ) \ lmgr$(MDNAME).lib libsb$(MDNAME).lib libcrvs$(MDNAME).lib \ $(XTRALIB) ltclient.exe: $(SRCDIR)\ltclient.c $(LMNEW_OBJ_CLIENT) $(CC) /nologo /c $(INCFLAGS) $(CRT_FLAG) /O1 $(SRCDIR)\ltclient.c $(LD) /out:ltclient.exe ltclient.obj $(LMNEW_OBJ_CLIENT) lmgr10.lib $(XTRALIB) if exist ltclient.obj del ltclient.obj buildmsgfile:; if exist $(EVENTLOGMESSAGEFILE).dll copy $(EVENTLOGMESSAGEFILE).dll $(EVENTLOGMESSAGEFILE).dll_bak mc -u -U $(SRCDIR)\$(EVENTLOGMESSAGEFILE).mc $(RC) -r -fo $(EVENTLOGMESSAGEFILE).res $(EVENTLOGMESSAGEFILE).rc $(LD) /dll /noentry /machine:x86 /out:$(EVENTLOGMESSAGEFILE).dll $(EVENTLOGMESSAGEFILE).res if exist $(EVENTLOGMESSAGEFILE2).dll copy $(EVENTLOGMESSAGEFILE2).dll $(EVENTLOGMESSAGEFILE2).dll_bak mc -u -U $(SRCDIR)\$(EVENTLOGMESSAGEFILE2).mc $(RC) -r -fo $(EVENTLOGMESSAGEFILE2).res $(EVENTLOGMESSAGEFILE2).rc $(LD) /dll /noentry /machine:x86 /out:$(EVENTLOGMESSAGEFILE2).dll $(EVENTLOGMESSAGEFILE2).res clean:; if exist lmnewgen.obj ren lmnewgen.obj lmnewgen.sav if exist lmnewgen_md.obj ren lmnewgen_md.obj lmnewgen_md.sav if exist lmgr10.obj ren lmgr10.obj lmgr10.sav if exist *.obj del *.obj if exist lmnewgen_md.sav ren lmnewgen_md.sav lmnewgen_md.obj if exist lmnewgen.sav ren lmnewgen.sav lmnewgen.obj if exist lmgr10.sav ren lmgr10.sav lmgr10.obj if exist lmnewgen.exe del lmnewgen.exe if exist lmclient.exe del lmclient.exe if exist lmcrypt.exe del lmcrypt.exe if exist lmfeats.exe del lmfeats.exe if exist $(DAEMON) del $(DAEMON) if exist lmcode.c del lmcode.c if exist lmcode.obj del lmcode.obj if exist lm_new.c del lm_new*.c if exist lm_new.obj del lm_new*.obj if exist lsrvend.c del lsrvend.c if exist lmflex.exe del lmflex.exe if exist lmsimple.exe del lmsimple.exe if exist lmwin.exe del lmwin.exe if exist $(SRCDIR)\lmwin.res del $(SRCDIR)\lmwin.res if exist *.ilk del *.ilk if exist *.p* del *.p* if exist lmwin.res del lmwin.res if exist $(VENDORNAME)$(LMGRNAME).lib del $(VENDORNAME)$(LMGRNAME).lib if exist $(VENDORNAME).dll del $(VENDORNAME).dll if exist $(VENDORNAME).exp del $(VENDORNAME).exp if exist lmgr10.dll del lmgr10.dll if exist lmgr10.exp del lmgr10.exp if exist lmgr10.lib del lmgr10.lib if exist ltclient.* del ltclient.* if exist *.bin del *.bin if exist $(EVENTLOGMESSAGEFILE).h del $(EVENTLOGMESSAGEFILE).h if exist $(EVENTLOGMESSAGEFILE).res del $(EVENTLOGMESSAGEFILE).res if exist $(EVENTLOGMESSAGEFILE).rc del $(EVENTLOGMESSAGEFILE).rc if exist $(EVENTLOGMESSAGEFILE2).h del $(EVENTLOGMESSAGEFILE2).h if exist $(EVENTLOGMESSAGEFILE2).res del $(EVENTLOGMESSAGEFILE2).res if exist $(EVENTLOGMESSAGEFILE2).rc del $(EVENTLOGMESSAGEFILE2).rc veryclean: clean if exist lmhostid.exe del lmhostid.exe if exist lmver.exe del lmver.exe if exist lmcksum.exe del lmcksum.exe if exist lmdown.exe del lmdown.exe if exist lmremove.exe del lmremove.exe if exist lmreread.exe del lmreread.exe if exist lmswitchr.exe del lmswitchr.exe if exist lmstat.exe del lmstat.exe if exist lmborrow.exe del lmborrow.exe if exist lmdiag.exe del lmdiag.exe if exist lminstall.exe del lminstall.exe kitclean: if exist lmcode.c del lmcode.c if exist lmcode.obj del lmcode.obj if exist lmcrypt.obj del lmcrypt.obj if exist lm_new.c del lm_new.c if exist lm_new.obj del lm_new.obj if exist lmnewgen.exe del lmnewgen.exe if exist lsvendor.obj del lsvendor.obj if exist lmhostid.exe del lmhostid.exe if exist lmver.exe del lmver.exe if exist lmcksum.exe del lmcksum.exe if exist lmdown.exe del lmdown.exe if exist lmhostid.exe del lmhostid.exe if exist lminstall.exe del lminstall.exe if exist lmremove.exe del lmremove.exe if exist lmreread.exe del lmreread.exe if exist lmswitchr.exe del lmswitchr.exe if exist lmstat.exe del lmstat.exe if exist lmdiag.exe del lmdiag.exe if exist lmver.exe del lmver.exe if exist lmflex.exe del lmflex.exe if exist lmsimple.exe del lmsimple.exe if exist lmgr10.dll del lmgr10.dll if exist lmgr10.exp del lmgr10.exp if exist lmgr10.lib del lmgr10.lib if exist *.bin del *.bin if exist $(EVENTLOGMESSAGEFILE).h del $(EVENTLOGMESSAGEFILE).h if exist $(EVENTLOGMESSAGEFILE).res del $(EVENTLOGMESSAGEFILE).res if exist $(EVENTLOGMESSAGEFILE).rc del $(EVENTLOGMESSAGEFILE).rc if exist $(EVENTLOGMESSAGEFILE2).h del $(EVENTLOGMESSAGEFILE2).h if exist $(EVENTLOGMESSAGEFILE2).res del $(EVENTLOGMESSAGEFILE2).res if exist $(EVENTLOGMESSAGEFILE2).rc del $(EVENTLOGMESSAGEFILE2).rc lmcrypt.obj: $(SRCDIR)\lmcrypt.c $(SRCDIR)\lm_code.h $(SRCDIR)\lmclient.h $(CC) $(CFLAGS) $(SRCDIR)\lmcrypt.c if exist lmcrypt.exe del lmcrypt.exe utils: lmhostid.exe lmver.exe lmdown.exe lmremove.exe lmreread.exe lmswitchr.exe lmstat.exe lmdiag.exe lminstall.exe lmborrow.exe lmpath.exe lmhostid.exe: lmutil.exe copy lmutil.exe lmhostid.exe lmver.exe: lmutil.exe copy lmutil.exe lmver.exe lmdown.exe: lmutil.exe copy lmutil.exe lmdown.exe lmremove.exe: lmutil.exe copy lmutil.exe lmremove.exe lmswitchr.exe: lmutil.exe copy lmutil.exe lmswitchr.exe lmreread.exe: lmutil.exe copy lmutil.exe lmreread.exe lmstat.exe: lmutil.exe copy lmutil.exe lmstat.exe lmborrow.exe: lmutil.exe copy lmutil.exe lmborrow.exe lmpath.exe: lmutil.exe copy lmutil.exe lmpath.exe lmdiag.exe: lmutil.exe copy lmutil.exe lmdiag.exe lminstall.exe: lmutil.exe copy lmutil.exe lminstall.exe copy lmutil.exe lmhostid.exe copy lmutil.exe lmver.exe copy lmutil.exe lmdown.exe copy lmutil.exe lmremove.exe copy lmutil.exe lmreread.exe copy lmutil.exe lmswitchr.exe copy lmutil.exe lmstat.exe copy lmutil.exe lmborrow.exe copy lmutil.exe lmdiag.exe copy lmutil.exe lminstall.exe copy lmutil.exe lmpath.exe For in |
#2
|
|||
|
|||
try to read it
|
#3
|
|||
|
|||
Hello FoxB,
I am a friend, and thus cannot download attachments. please send to rcerjackson@gmail.com |
#4
|
|||
|
|||
Hi Fox,
I looked at the doc's you sent me, but I had already followed these instructions. Nevertheless I get the LINK : fatal error "LNK1181: cannot open input file 'vendor_hostid.obj' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\LINK.EXE"' : return code '0x49d'. Th reason being is that the compiler does not create the vendor_hostid.obj file from vendor_hostid.c, and I cannot figure out why. regards |
#5
|
|||
|
|||
Does anybody have some advise on this issue
Rgds |
#6
|
|||
|
|||
you add the "vendor_hostid.c" to make-file?
|
#7
|
|||
|
|||
yes I did this, see below
vendor_hostid.obj: $(SRCDIR)\vendor_hostid.c $(CC) $(CFLAGS) -I../h $(SRCDIR)\vendor_hostid.c but for some reason the compiler does not create vendor_hostid.obj |
#8
|
|||
|
|||
see ch.8 pdf-file
add before $(DAEMON) section: vendor_hostid.obj : ..\machind\vendor_hostid.c $(CC) $(CFLAGS) $(INCS) /c ..\machind\vendor_hostid.c add to $(DAEMON) section: $(DAEMON): $(XTRAOBJS) $(DAEMONLIBS) vendor_hostid.obj $(SRCDIR)/lsserver.h \ lm_new.obj vendor_str.obj $(LD) /subsystem:console /out:$(DAEMON) lsvendor.obj vendor_hostid.obj lm_new.obj \ $(XTRAOBJS) $(DAEMONLIBS) $(XTRALIB1) libcmt.lib add to $(LMNEW_OBJ) section: $(LMNEW_OBJ): $(SRCDIR)\lsvendor.c $(SRCDIR)\lm_code.h lmrand1 -i $(SRCDIR)\lsvendor.c $(CC) /c $(LMNEW_CFLAGS) -I../h lmcode.c $(LD) /subsystem:CONSOLE lmnewgen$(MDNAME).obj lmcode.obj\ lmgr$(MDNAME).lib libcrvs$(MDNAME).lib libsb$(MDNAME).lib $(XTRALIB1) $(CRT_LIB) /out:lmnewgen.exe if exist lm_new.c del lm_new.c lmnewgen.exe $(VENDORNAME) -o lm_new.c $(CC) $(LMNEW_CFLAGS) /Fo$(LMNEW_OBJ) lm_new.c $(CC) $(CFLAGS) vendor_hostid.c add to all next executable like: makekey.exe: $(SRCDIR)\makekey.c $(SRCDIR)\lm_code.h lm_new.obj \ $(SRCDIR)\lmclient.h $(STATIC_CLIENTLIB) $(CC) $(CFLAGS) $(SRCDIR)\makekey.c $(LD) /out:makekey.exe makekey.obj vendor_hostid.obj $(STATIC_CLIENTLIB) $(XTRALIB) if exist makekey.obj del makekey.obj |
The Following User Says Thank You to FoxB For This Useful Post: | ||
niculaita (09-23-2018) |
#9
|
|||
|
|||
adding vendor_hostid.obj : ..\machind\vendor_hostid.c
$(CC) $(CFLAGS) $(INCS) /c ..\machind\vendor_hostid.c before $(DAEMON) section: gives me a makefile(109) : fatal error U1033: syntax error : 'vendor_hostid.obj' unexpected adding vendor_hostid.obj : ..\machind\vendor_hostid.c $(CC) $(CFLAGS) $(INCS) /c ..\machind\vendor_hostid.c after $(DAEMON) section: gives me a fatal error U1034: syntax error : separator missing. changing vendor_hostid.obj : .. to vendor_hostid.obj: .. gives the same syntax error Last edited by rcer; 09-30-2018 at 22:54. |
#10
|
|||
|
|||
strange, v7.x, v8.x and v9.x is work for me
|
#11
|
|||
|
|||
Just add this to your crypter and call it after lc_init,
e.g declare_vid(lm_job, "NSAD_HOSTID", HOSTID_VENDOR+1); Works for me since v6 at least :-) void declare_vid(LM_HANDLE_PTR lm_job, char *name, DWORD type) { LM_VENDOR_HOSTID h; memset(&h, 0, sizeof (h)); h.label = name; h.hostid_num = type; h.case_sensitive = 0; h.get_vendor_id = NULL; if (lc_set_attr(lm_job, LM_A_VENDOR_ID_DECLARE, (LM_A_VAL_TYPE) &h)) lc_perror(lm_job, "LM_A_VENDOR_ID_DECLARE FAILED"); } |
#12
|
|||
|
|||
my apology for my ignorance, because I am not a "C" programmer;
Do you mean that I need to add: void declare_vid(lm_job, "NSAD_HOSTID", HOSTID_VENDOR+1); to the file "lmcrypt.c" ? |
#13
|
|||
|
|||
You should paste that code before main(), then add right after lc_init call this:
declare_vid(job, "YOUR_VID_NAME", YOUR_VID_TYPE); Last edited by ketan; 10-02-2018 at 09:06. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
When use "vendor defined encryption routines", how to set daemon related part? | bridgeic | General Discussion | 6 | 01-22-2015 11:35 |
Need a web host | Nilrem | General Discussion | 2 | 01-17-2004 16:06 |