zoukankan      html  css  js  c++  java
  • 生成UDS安全算法DLL文件

    使用Visual Studio打开工工程模板,模板在C:UsersPublicDocumentsVectorCANoe10.0 (x64)CANoe Sample ConfigurationsCANDiagnosticsUDSSystemSecurityAccessSourcesKeyGenDll_GenerateKeyEx下,

    打开工程GenerateKeyExImpl.vcproj,提示工程转换点确定

    修改算法

    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 key = 0U;
    unsigned int seed = 0U;
    unsigned int i = 0;
    if (iSeedArraySize>iKeyArraySize)
    return KGRE_BufferToSmall;
    // for (unsigned int i=0;i<iSeedArraySize;i++)
    // ioKeyArray[i]=~iSeedArray[i];
    seed = iSeedArray[1];
    seed |= (iSeedArray[0]<<8);

    key = seed + 1;

    ioKeyArray[1] = key & 0xff;
    ioKeyArray[0] = (key>>8)& 0xff;
    oSize=iSeedArraySize;

    return KGRE_Ok;
    }

    在工程属性下 选择生成DLL文件

    点击生成文件,DLL文件在debug文件夹下。

  • 相关阅读:
    taro 列表渲染
    taro 事件处理
    taro 项目、代码说明
    taro 开发注意点
    taro 知识点
    taro 学习资料
    egg 官方文档之:框架扩展(Application、Context、Request、Response、Helper的访问方式及扩展)
    node 学习资料
    node api 之:fs
    node api 之:stream
  • 原文地址:https://www.cnblogs.com/hkj8808/p/14829999.html
Copyright © 2011-2022 走看看