首页
社区
课程
招聘
[旧帖] [求助]关于hostid问题 0.00雪花
发表于: 2011-3-28 12:37 2759

[旧帖] [求助]关于hostid问题 0.00雪花

2011-3-28 12:37
2759
我使用FLEXNET SDK 11.4版本进行制作license文件,hostid = ANY没问题,现需要生成hosid=xxxxxx时出现了问题。按照相关资料上的说明,将vendor_hostid.c添加到工程中,修改了相关的几个文件,但编译的时候提示如下:


我修改后的makefile如下:
#########################################################################
#            COPYRIGHT (c) 2003-2005 by Macrovision Corporation.
#        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 = XXXXXXX
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.

ACTSTUB = .\activation\lib\libnoact$(SUFFIX).lib

!ifdef DLL

LMGRNAME=11
LIBSUFFIX=
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
LIBSUFFIX=_md
LMNEW_OBJ=lm_new_md.obj
CRT_FLAG=/MD$(CNAME)
CRT_LIB=msvcrt$(CNAME).lib
LMNEW_OBJ_CLIENT=$(LMNEW_OBJ)

!else

LMGRNAME=
LIBSUFFIX=
CRT_FLAG=/MT$(CNAME)
LMNEW_OBJ=lm_new.obj
LMNEW_OBJ_CLIENT=$(LMNEW_OBJ)
CRT_LIB=libcmt$(CNAME).lib

!endif

SUFFIX=$(LIBSUFFIX)

!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)  /DNO_ACTIVATION_SUPPORT
LMNEW_CFLAGS = /nologo /c  $(INCFLAGS) $(CRT_FLAG) $(DLL_FLAG)

SRCS        = $(SRCDIR)\lsvendor.c

EXECS =  lmflex.exe lmcrypt.exe installs.exe

CLIENTLIB        = $(LMGR_LIB) libsb$(SUFFIX).lib libcrvs$(SUFFIX).lib
STATIC_CLIENTLIB = lmgr$(SUFFIX).lib libsb$(SUFFIX).lib libcrvs$(SUFFIX).lib
LIBS             = lmgras$(SUFFIX).lib lmgrs$(SUFFIX).lib $(STATIC_CLIENTLIB)
DAEMONLIBS       = lmgras$(SUFFIX).lib lmgrs$(SUFFIX).lib lmgr$(SUFFIX).lib libsb$(SUFFIX).lib libcrvs$(SUFFIX).lib
EVENTLOGMESSAGEFILE = VendorLicenseServerMsgs
EVENTLOGMESSAGEFILE2 = MvsnLicenseServerMsgs

all:         \
!ifdef DLL
     lmgr11.dll \
!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) $(ACTSTUB)

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$(SUFFIX).obj lmcode.obj $(ACTSTUB) \
        lmgr$(SUFFIX).lib libcrvs$(SUFFIX).lib libsb$(SUFFIX).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) $(ACTSTUB) $(XTRALIB)

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) $(ACTSTUB) $(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

lmgr11.dll: $(LMNEW_OBJ) $(SRCDIR)\lmgr11.c
        $(CC) $(CFLAGS) $(SRCDIR)\lmgr11.c
        $(LD) /def:"$(SRCDIR)\lmgr11.def" \
              /out:lmgr11.dll lmgr11.obj /implib:"lmgr11.lib" /dll \
              $(LMNEW_OBJ) \
              lmgr$(SUFFIX).lib libsb$(SUFFIX).lib libcrvs$(SUFFIX).lib \
              $(ACTSTUB) $(XTRALIB)
            

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 asrgen.obj copy asrgen.obj asrgen_obj.bak
        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 asrgen_obj.bak move asrgen_obj.bak asrgen.obj
        if exist lmnewgen.exe del lmnewgen.exe
        if exist lmcrypt.exe del lmcrypt.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 *.ilk del *.ilk
        if exist vc60.pdb rename vc60.pdb vc60.sav
        if exist *.p* del *.p*
        if exist vc60.sav rename vc60.sav vc60.pdb
        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 lmgr11.dll del lmgr11.dll
        if exist lmgr11.exp del lmgr11.exp
        if exist lmgr11.lib del lmgr11.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

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 lmgr11.dll del lmgr11.dll
        if exist lmgr11.exp del lmgr11.exp
        if exist lmgr11.lib del lmgr11.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

/////////////////////////////////////////////////////////////////////////////////////////  
    这是什么原因造成的?我觉得应该编译设置的问题,但不知道问题具体出在哪里,请高人指点一下,谢谢!

[课程]FART 脱壳王!加量不加价!FART作者讲授!

上传的附件:
  • 1.JPG (88.20kb,169次下载)
收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 44
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
编译通过了,找不到vendor_hostid.obj的原因是因为在makefile中的EXECS行没有将vendor_hsotid.obj加上去,我起初看的是flexlm sdk(v9.2)的一份说明上进行修改makefile,上面就没有说要把vendor_hostid.obj添加到EXECS行上。后来参考了V10.8版本的文档,里面说明让把vendor_hostid.obj添加到EXECS行。
   但编译后生成的lic文件不对,应用软件识别不出来。
   pdf上有这么一段,不知道是这么理解的:
Additional Steps for Production Use of a Vendor-Defined Hostid Type
To implement a real vendor-defined hostid type, you must write a function that can find the hostid that you want to use, then use that function’s return value instead of the fixed value VENDEF_ID in strncpy() in vendor_hostid.c:
if (idtype == VENDEF_ID_TYPE)
{
h->type = VENDEF_ID_TYPE;
strncpy(h->id.vendor, VENDEF_ID, MAX_HOSTID_LEN);
h->id.vendor[MAX_HOSTID_LEN] = 0;
return(h);
}
这是什么意思啊?有知道的大侠指点一下,谢谢!
2011-3-29 10:35
0
雪    币: 44
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
继续顶吧,高手都难道不屑回复菜鸟的问题!
2011-3-29 19:31
0
雪    币: 324
活跃值: (157)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
不要总等别人给你鱼,自己找到网了,为何不试着捕下鱼呢?
2011-3-29 22:35
0
雪    币: 44
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
NoFlexlm前辈说的很对,但我确实努力了,就是找不到问题出在哪里了!不过我又有点新发现,我发现虽然编译成功了,但是编译vendor_hostid.c的时候有一个警告,不知道会不会是这个原因造成的?
警告如下:
Building using the /MT flag

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        cl /nologo /c  /I..\machind /I. /MT /O1   /DNO_ACTIVATION_SUPPORT -I../h
..\machind\vendor_hostid.c
vendor_hostid.c
..\machind\vendor_hostid.c(102) : warning C4113: 'struct hostid *(__cdecl *)()'
differs in parameter lists from 'struct hostid *(__cdecl *)(short )'
        lmrand1 -i ..\machind\lsvendor.c
        cl /c /nologo /c  /I..\machind /I. /MT  -I../h lmcode.c
lmcode.c
        LINK /nologo /NODEFAULTLIB /OPT:NOREF  /subsystem:CONSOLE lmnewgen.obj l
mcode.obj .\activation\lib\libnoact.lib  lmgr.lib libcrvs.lib libsb.lib oldnames
.lib kernel32.lib user32.lib netapi32.lib  advapi32.lib  gdi32.lib comdlg32.lib
comctl32.lib wsock32.lib libcmt.lib /out:lmnewgen.exe
    那位高手知道希望能指点一下,谢谢!

2011-3-30 11:05
0
雪    币: 44
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
问题找到了,谢谢NoFlexlm前辈!
2011-3-30 13:10
0
游客
登录 | 注册 方可回帖
返回
//