已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Laboratory Two Decoding Lab (Part 1)Objectives: For this exercise, you have to compile a program as attached and supply four secret keys to determine the contents. In this laboratory, you have to supply the first two. The remaining will be done next week. I will guide you to solve the problem. This exercise is extracted from the CTE, SSD6 Exercise one.The details are as follows.Start the program:1) invoke the visual C+ and use new to start the workplace.2) Select the New Menu and click “workplace”. The name is called exercise 13) The project is exercise 1: Select Win32 Console4) The output after selecting the project is as follows. 5) Select the empty button until you see the following screen6) Now Select New again and then Files, type the name of file “Exercise 1” and select C+ source file. 7) Click the fileview and the source files you will see exercise1.cpp is there, but is empty.8) Now you download the secret file (secret.cpp) from CTE web site or get it from appendix.9) Compile the program without any bug. Set a breakpoint: Set a break point to force the program to break, press F9. A good programmer must know how to debug.1) Press F9 at the location of int dummy under main()2) Now Click Debug and choose start debug then go, you will see the screenIt means the program stops at this location, You can now dummy the message to analysis the data.3) Right click your mouse and you will get a screen as follows: 4) Select quick watch and you will see a quick watch 5) Type the data and write the addressAddress of data is: _0x00424ab0_ (hint: in hex, ox.)6) In the address screen: Enter the value of the address of data: 0x00424ab0_. You can see the value of on the right hand side. Write down the first 40 characters.cccccccccFFrromo: mFr:ie ndC TTo:E YouTDetermine the value of start and stride:Hint Now you find that if you can extract the message, pick the start message and then the stride (after how many characters for the next), you can then guess how to determine it. For example, 1234567890AStart:0 and stride: 2, will produce 13579AStart:0 and stride: 3, will produce 1245780AStart:0 and stride: 4, will produce 12356790AStart:1 and stride: 3, will produce 235689AIf you choose the value properly, you will get:Start value: in decimal in order to produce the above message is _9_Stride: length of next character (Hint: You have to refer to the program, the value is 2, 3 or 4 only).1) Write down the address of dummy _0x0018ff3c_, you have to set a break point beside key1, F9 and Execute debug so that the program goes through the first few lines. Use right click mouse and &dummy (&means the address)Press F10 will advance the program.It is an integer: It consists of _4_ bytes. You can determine by checking the location of int start, you then understand the size.Now dummy consists of two parts: stride and start.Write down the value of key1_3_: The difference between dummy and key1, Key2: The first byte: start The second byte: stride The third and fourth byte can be set to zero.Key2 : 0 x start + 0 x stride _777_2) Now select the project: setting, you will see the following screenEnter the value of key1 and key2 that you have determined and execute, you will get :Appendix:Please note that you dont need to modify any program, but to understand how to enter the keys.You can extract and compile the program:#include #include int prologue = 0x5920453A, 0x54756F0A, 0x6F6F470A, 0x21643A6F,0x6E617920, 0x680A6474, 0x6F697661, 0x20646E69,0x63636363, 0x63636363, 0x72464663, 0x6F6D6F72,0x63636363, 0x63636363, 0x72464663, 0x6F6D6F72,0x2C336573, 0x7420346E, 0x20216F74, 0x726F5966,0x7565636F, 0x20206120, 0x6C616763, 0x74206C6F,0x20206F74, 0x74786565, 0x65617276, 0x32727463,0x594E2020, 0x206F776F, 0x79727574, 0x4563200A;/*int data = 0x63636363, 0x63636363, 0x72464663, 0x6F6D6F72,0x7565636F, 0x20206120, 0x6C616763, 0x74206C6F,0x5920453A, 0x54756F0A, 0x6F6F470A, 0x21643A6F,0x594E2020, 0x206F776F, 0x79727574, 0x4563200A,0x6F786F68, 0x6E696373, 0x6C206765, 0x796C656B,0x2C336573, 0x7420346E, 0x20216F74, 0x726F5966,0x7565636F, 0x20206120, 0x6C616763, 0x74206C6F,0x20206F74, 0x74786565, 0x65617276, 0x32727463,0x6E617920, 0x680A6474, 0x6F697661, 0x20646E69,0x21687467, 0x63002065, 0x6C6C7861, 0x78742078,0x6578206F, 0x72747878, 0x78636178, 0x00783174;*/int data = 0x63636363, 0x63636363, 0x72464663, 0x6F6D6F72,0x466D203A, 0x65693A72, 0x43646E20, 0x6F54540A,0x5920453A, 0x54756F0A, 0x6F6F470A, 0x21643A6F,0x594E2020, 0x206F776F, 0x79727574, 0x4563200A,0x6F786F68, 0x6E696373, 0x6C206765, 0x796C656B,0x2C336573, 0x7420346E, 0x20216F74, 0x726F5966,0x7565636F, 0x20206120, 0x6C616763, 0x74206C6F,0x20206F74, 0x74786565, 0x65617276, 0x32727463,0x6E617920, 0x680A6474, 0x6F697661, 0x20646E69,0x21687467, 0x63002065, 0x6C6C7861, 0x78742078,0x6578206F, 0x72747878, 0x78636178, 0x00783174;int epilogue = 0x594E2020, 0x206F776F, 0x79727574, 0x4563200A,0x6E617920, 0x680A6474, 0x6F697661, 0x20646E69,0x7565636F, 0x20206120, 0x6C616763, 0x74206C6F,0x2C336573, 0x7420346E, 0x20216F74, 0x726F5966,0x20206F74, 0x74786565, 0x65617276, 0x32727463;char message100;void usage_and_exit(char * program_name) fprintf(stderr, USAGE: %s key1 key2 key3 key4n, program_name);exit(1);void process_keys12 (int * key1, int * key2) *(int *) (key1 + *key1) = *key2;void process_keys34 (int * key3, int * key4) *(int *)&key3) + *key3) += *key4;char * extract_message1(int start, int stride) int i, j, k;int done = 0;for (i = 0, j = start + 1; ! done; j+) for (k = 1; k stride; k+, j+, i+) if (*(char *) data) + j) = 0) done = 1;break; messagei = *(char *) data) + j);messagei = 0;return message;char * extract_message2(int start, int stride) int i, j;for (i = 0, j = start; *(char *) da
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 国家电网公司西南分部2025年下半年高校应届毕业生招聘【2人】事业单位易考易错模拟试题(共500题)试卷后附参考答案
- 四川雅安文化旅游发展限责任公司招考易考易错模拟试题(共500题)试卷后附参考答案
- 四川巴中南江县乡镇事业单位从大学生服务基层项目人员中招聘15人易考易错模拟试题(共500题)试卷后附参考答案
- 基于标准的教学- 第8课 我和我的祖国(教学设计)四年级上册信息技术河大音像版
- 内蒙古鄂尔多斯达拉特旗招聘基层卫生专项事业编制工作人员20人易考易错模拟试题(共500题)试卷后附参考答案
- 中国铁路北京局集团限公司2025年下半年度招聘普通高校毕业生829人(二)易考易错模拟试题(共500题)试卷后附参考答案
- 东北师范大学(长春)物理学院量子科学中心招考学术带头人易考易错模拟试题(共500题)试卷后附参考答案
- 2025鸿达兴业股份限公司招聘50人易考易错模拟试题(共500题)试卷后附参考答案
- 2025陕西西安重装蒲白煤矿机械限公司招聘14人易考易错模拟试题(共500题)试卷后附参考答案
- 2025陕西神木富油能源科技限公司招聘100人易考易错模拟试题(共500题)试卷后附参考答案
- 中药学职业发展规划
- 2025下半年榆林神木市公共服务辅助人员招聘(80人)考试笔试备考试题及答案解析
- 腾讯手机行业消费趋势洞察报告(2025年版)
- 防暴风雪安全培训课件
- DB13-T 5611-2022 工业气体空分产品单位产品综合电耗限额
- 中华民族的形成发展 《中华民族大团结》七年级全一册
- 李阳英语十大经典学习方法及精选美文
- XX设立创业投资基金可行性研究报告
- 橡胶零件外观检验知识培训
- 新版《FMEA(第五版)》学习笔记(完整版)
- 做管装爱装的好战士(高级课件)
评论
0/150
提交评论