CAPL_适用于诊断台调用的DLL文件制作

DLL制作步骤

  1. Step1

    制作该文件,可直接用Vector自带模板【KeyGenDll_GenerateKeyEx】,在该Demo下进行修改&整合。
    Demo路径如下:

C:\Users\Public\Documents\Vector\CANoe\Sample Configurations 11.0.55\CAN\Diagnostics\UDSSystem\SecurityAccess\Sources

  1. Step2

    拷贝该Demo至文件夹,使用Visual Studio打开工工程模板

在这里插入图片描述

  1. Step3

    修改算法

KEYGENALGO_API VKeyGenResultEx GenerateKeyEx(
    const unsigned char* iSeedArray,     /* Array for the seed [in] */
    unsigned int          iSeedArraySize, /* Length of the array for the seed [in] */
    const unsigned int    iSecurityLevel, /* Security level [in] */
    const char* iVariant,       /* Name of the active variant [in] */
    unsigned char* ioKeyArray,     /* Array for the key [in, out] */
    unsigned int          iKeyArraySize,  /* Maximum length of the array for the key [in] */
    unsigned int& oSize           /* Length of the key [out] */
)
{
    unsigned int seed = 0;
    unsigned int key = 0;
    unsigned long secret_keyAPP = 0x11111111;
    unsigned long secret_keyBoot = 0x22222222;
    
    seed = seed | (iSeedArray[3] << 0);
    seed = seed | (iSeedArray[2] << 8);
    seed = seed | (iSeedArray[1] << 16);
    seed = seed | (iSeedArray[0] << 24);

    //begin calculate key form seed 
    if (0x01 == iSecurityLevel)
    {
        Initgenerate_tables();
        key = SAcrypt_Data(seed, secret_keyBoot);
    }
    else if(0x03 == iSecurityLevel){
        Initgenerate_tables();
        key = SAcrypt_Data(seed, secret_keyAPP);  
    }
    //end calculate key form seed
    //copy key to the output buffer
    //Note:The first byte of the key array will be the first key byte of the bus message
    ioKeyArray[3] = key & 0xff;
    ioKeyArray[2] = (key >> 8) & 0xff;
    ioKeyArray[1] = (key >> 16) & 0xff;
    ioKeyArray[0] = (key >> 24) & 0xff;
    oSize = iSeedArraySize;
    return KGRE_Ok;
}
  1. Step4

生成DLL文件SeednKey.dll

  导航栏点击【生成—>生成解决方案】,编译成功后,生成的DLL文件在Debug文件夹中

配置文件&调用

  1. Step1

在诊断台中配置DLL文件,步骤如下:
在这里插入图片描述

  1. Step2
    诊断台发送
    在这里插入图片描述
capl_6700dll是一种文件扩展名,通常用于Windows操作系统中DLL(动态链接库)文件的命名。DLL文件是Windows系统中常见的一种文件类型,它包含了一些可被程序调用的功能和资源。这些功能和资源可以通过运行时链接到调用程序中,以提供特定的功能和服务。 capl_6700dll文件可能是某个程序所需的一个动态链接库文件,用于执行特定的功能或提供特定的服务。当运行该程序时,如果该DLL文件缺失或者无法被正确加载,程序可能无法正常运行或者出现错误。 为了解决这个问题,可以尝试以下方法: 1. 检查该程序的安装文件夹,看是否存在capl_6700dll文件。如果存在,可以尝试将其复制到程序所需的文件夹中。 2. 在Windows操作系统中,可以尝试重新注册capl_6700dll文件。打开命令提示符窗口,输入"regsvr32 capl_6700dll",然后回车执行。如果该DLL文件没有被损坏,重新注册可能可以解决问题。 3. 更新或重新安装程序。有些程序会在安装的过程中自动安装或更新所需的DLL文件,如果该DLL文件是该程序的一部分,重新安装程序可能能够解决问题。 4. 在互联网上搜索有关capl_6700dll文件的更多信息,以了解是否有其他用户遇到过类似的问题,并寻找可能的解决方案。 需要注意的是,对于DLL文件的处理需要谨慎。确保从可靠的来源下载和使用DLL文件,以避免安全风险。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值