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

做网站投广告攻略上海工商网上企业查名

做网站投广告攻略,上海工商网上企业查名,合肥龙岗医院网站建设,php做网站多少钱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://www.zqtcl.cn/news/821439/

相关文章:

  • 大连网站备案高品质网站建设公司
  • 建站模板哪个好网站添加子域名
  • html5创意网站创建网站公司好
  • php网站开发外文旅游电子商务网站的品牌建设
  • 陕西西安网站建设公司哪家好网页框架是什么
  • 广东网站建设效果安福网站建设
  • 如何将html发布到网站微帮网免费发布信息网
  • 做个网站西安专业网络推广公司
  • 建设网站cms网站开发后台需要自己写吗
  • 天津协会网站建设学计算机的做网站的叫什么工作
  • 商城网站建设缺点淘宝店铺怎么免费推广
  • 利于优化的网站模板360建筑网密码忘了
  • 商务网站建设找哪家网页设计商品页面制作
  • 连云港网站建设方案大型门户网站多少钱
  • win7 iis设置网站首页网站建设攵金手指科杰壹陆
  • 阿里巴巴网站建设的功能定位手机在线制作图片加字
  • 网站联系我们的地图怎么做的电子商务网站建设完整案例教程
  • 北京学习网站建设湖北省建设厅政务公开网站
  • 推广做网站联系方式贵州省领导班子名单一览表
  • 厦门的网站建设公司徐州城乡建设局网站
  • 天津圣辉友联网站建设南昌本地生活网站有哪些
  • 境外社交网站上做推广上海网站建设的价格低
  • 山西专业网站建设大全高校网站群建设研究
  • 网络营销网站建设流程网站功能设计指什么
  • 企业网络推广网站琼海市建设局网站
  • 移动网站搭建网页设计页面设计
  • 建设网站进行商品营销的重要性恢复正常百度
  • 美容会所网站模板下载jsp网站开发实现增删改查
  • 注册网站需要注意什么深圳建站公司兴田德润官网多少
  • 广东网站优化布吉做棋牌网站建设有哪些公司