当前位置: 首页 > news >正文

企业网站 .networdpress portal

企业网站 .net,wordpress portal,如何做h5,建筑工程网络计划图中怎样算总工期DLL文件在CANoe的使用方法 DLL文件在诊断里面可以用在0x27秘钥服务里面#xff0c;对解密有帮助#xff0c;在下图位置加载。 DLL文件制作 vector公司本来就给了我们一个demo#xff0c;先拷贝一份下来#xff0c;别把原来的文件给改坏了。我这个是CANoe12#xff0c;de…DLL文件在CANoe的使用方法 DLL文件在诊断里面可以用在0x27秘钥服务里面对解密有帮助在下图位置加载。 DLL文件制作 vector公司本来就给了我们一个demo先拷贝一份下来别把原来的文件给改坏了。我这个是CANoe12demo代码的路径在C:\Users\Public\Documents\Vector\CANoe\Sample Configurations 12.0.75\CAN\Diagnostics\UDSSystem\SecurityAccess\Sources大家可以参考下把里面这个KeyGenDll_GenerateKeyEx文件夹复制一份出来当然你也可以用KeyGenDll_GenerateKeyExOpt待会打开源代码看得到是差不多的。 打开Visual Studio 2019将工程里面的工程文件GenerateKeyExImpl.vcproj拖进去就能打开工程。展开工程然后打开源文件GenerateKeyExImpl.cpp。 程序比较简单还有注释里面有很多空行我删了几行放在这里大家看看这个是工程KeyGenDll_GenerateKeyEx的源代码。 // KeyGeneration.cpp : Defines the entry point for the DLL application. #include windows.h #include KeyGenAlgoInterfaceEx.hBOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {return TRUE; }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] */) {if (iSeedArraySizeiKeyArraySize)return KGRE_BufferToSmall;for (unsigned int i0;iiSeedArraySize;i)ioKeyArray[i]~iSeedArray[i];oSizeiSeedArraySize;return KGRE_Ok; }这个是KeyGenDll_GenerateKeyExOpt工程的源代码GenerateKeyExOpt.cpp相对于KeyGenDll_GenerateKeyEx工程就是多了个选项作为入参高级用法才会用到我们一般都用不到所以这里就用KeyGenDll_GenerateKeyEx工程。 // /// Seed Key DLL with extended interface and options argument /// This is an example implementation for CANoe demo configuration UDSsim //#include windows.h #include GenerateKeyExOpt.hKEYGENALGO_API VKeyGenResultExOpt GenerateKeyExOpt(const unsigned char* ipSeedArray, // 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* ipVariant, // Name of the active variant [in]const char* ipOptions, // Optional parameter which might be used for OEM specific information [in]unsigned char* iopKeyArray, // Array for the key [in, out]unsigned int iMaxKeyArraySize, // Maximum length of the array for the key [in]unsigned int oActualKeyArraySize) // Length of the key [out] {// Check the input argumentsif( iSecurityLevel 0 || iSecurityLevel 10)return KGREO_SecurityLevelInvalid;if( iMaxKeyArraySize iSeedArraySize || 4 iSeedArraySize)return KGREO_BufferToSmall;if( !ipSeedArray || !iopKeyArray || !ipOptions || strlen( ipOptions) iSeedArraySize)return KGREO_UnspecifiedError;// Copy the input bytes to the output bytesmemcpy( iopKeyArray, ipSeedArray, iSeedArraySize);// As an example each byte in the options array will be added to each byte of the seed array securityLevel times.for( unsigned int l 0; l iSecurityLevel; l){for( unsigned int i 0; i iSeedArraySize; i)iopKeyArray[i] ipOptions[i];}oActualKeyArraySize iSeedArraySize;return KGREO_Ok; } 修改KeyGenDll_GenerateKeyEx工程源代码GenerateKeyExImpl.cpp里面做了注释。 KEYGENALGO_API VKeyGenResultEx GenerateKeyEx(unsigned char* iSeedArray, /* 种子数组 */unsigned int iSeedArraySize, /* 种子长度 */const unsigned int iSecurityLevel, /* 秘钥等级调试打印 */const char* iVariant, /* 激活状态调试打印 */unsigned char* ioKeyArray, /* 秘钥数组 */unsigned int iKeyArraySize, /* 秘钥长度 */unsigned int oSize /* 秘钥长度调试打印 */) {if (iSeedArraySizeiKeyArraySize)//秘钥长度大于种子长度的话就是长度错误return KGRE_BufferToSmall;……(这里是我的算法计算出来的秘钥放在iSeedArray[]数组)for (int i 0; i iKeyArraySize; i) {ioKeyArray[i] iSeedArray[i];}oSize iSeedArraySize;//这个其实没啥用长度是CDD里面定义的return KGRE_Ok; } 对着工程右键重新生成就行输出信息会告诉你把DLL文件生成到了哪里。 DLL文件检查 如果你很有自信一次写对那直接在CANoe里面直接加载就行。如果想谨慎点想要检查写得对不对就新建个控制台工程来调用DLL文件里面的函数进行验证。 把上面生成的DLL文件拷贝到控制台路径下。 调用代码如下 // CallDLL.cpp : 此文件包含 main 函数。程序执行将在此处开始并结束。 // #include iostream #include Windows.h #include tchar.husing namespace std; #define iSeedArraySize 16 const unsigned char SeedArray[iSeedArraySize] {0xD1,0x28,0xD2,0x7B,0x25,0xCE,0x78,0x22,0xCB,0x75,0x1E,0xC8,0x71,0x1B,0xC5,0x6E }; const unsigned int iSecurityLevel 1; const char iVariant 0;#define iKeyArraySize 16 unsigned char ioKeyArray[iSeedArraySize] { 0x0 };unsigned int oSize 0;int main() {HINSTANCE handle LoadLibrary(_T(SeednKey.dll));//加载dll ,需要加上头文件tchar.h并在调用时加上_T 由句柄指向dll文件cout Dll Adddr: handle endl;if (handle){typedef int(*GenerateKeyExOpt_API_Type)(const unsigned char*,unsigned int,const unsigned int,const char*,unsigned char*,unsigned int,unsigned int );GenerateKeyExOpt_API_Type GenerateKeyExOpt_API_Point (GenerateKeyExOpt_API_Type)GetProcAddress(handle, GenerateKeyEx); //GetProcAddress获取dll中的Add_Func函数用add_API_Point指向函数它cout dll 函数的句柄返回值: GenerateKeyExOpt_API_Point endl;//打印dll的函数句柄地址值,不为0就说明调用成功printf(\n);if (GenerateKeyExOpt_API_Point){int result (*GenerateKeyExOpt_API_Point)(SeedArray,iSeedArraySize, iSecurityLevel,iVariant, ioKeyArray, iKeyArraySize, oSize);for (int i 0; i iSeedArraySize; i) {/*打印种子*/printf(SeedArray[%d]: %2X\n, i, SeedArray[i]);}printf(\n);for (int j 0; j iKeyArraySize; j) {/*打印秘钥*/printf(ioKeyArray[%d]: %2X\n, j, ioKeyArray[j]);}cout oSize oSize endl;/*调试打印*/FreeLibrary(handle); //释放句柄}}return 0; }// Run program: Ctrl F5 or Debug Start Without Debugging menu // Debug program: F5 or Debug Start Debugging menu 对一下打印出来的结果是对的话就是验证通过。 CDD文件配置 0x27服务的长度是在CDD文件里面配置的单纯改代码是改不动的。 用CANdelaStudio打开CDD文件勾选这个把0x27服务带出来。 长度解密等级都在这里设置。 DLL文件使用 按照本文最上面的使用方法加载进去双击能发送。
http://wiki.neutronadmin.com/news/63781/

相关文章:

  • cms建站系统 下载平面设计行业市场分析
  • 网站 粘度后台网站模板 html
  • 做网站小编怎么样网站流量排行
  • 东莞找网站设计seo排名优化收费
  • 手机网站专题导航网站好处
  • 成都网站开发多少钱工程认证网站的建设
  • 什么颜色做网站好看网站开发说明
  • 做网站设计哪里有淮安做网站公司
  • 上海平台网站建设在线个人资料制作网站
  • 自己服务器建设网站建网站公司 深圳
  • 网站域名及空间购买学建筑的网站
  • 毕业设计网站建设英文文献如何做自已网站
  • 提供响应式网站建设阿里云国外服务器
  • 网站主机的类型徐州做网站哪里好
  • 新塘17网站一起做网店官网做舞台灯光的在哪些网站接订单呢
  • 网站制作 番禺wordpress seo什么意思
  • 从化免费网站建设郑州旅游网站设计
  • 湛江专业自助建站详细解读企业网站icp是什么
  • 十大网站在线观看域名解析到wordpress
  • 龙华网站建设推广外包猎头公司招聘信息
  • 宁波网站建设科技有限公司建站设计公司
  • 网页制作创建站点内容小程序源码网网盘
  • 我做网站可以赚钱吗公司建立网站流程图
  • 正版素材网站新闻最新热点
  • 做网站公司能赚钱吗彩票app开发制作多少钱
  • 做社交网站要注册哪类商标励志做的很好的网站
  • 游戏 网站 模板wordpress菜单栏设置
  • 网站开发遇到的问题车工订单网站
  • 网站建设多少钱宋柯yy大杂烩
  • 免费的微网站制作平台做网站用go语言还是php