自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(27)
  • 资源 (17)
  • 收藏
  • 关注

原创 二进制炸弹第六关

初步翻译了一汇编 是 二进制炸弹 实验里滴第六个炸弹 翻译了半天 累哦 相关帖子地址 http://topic.csdn.net/u/20071126/21/117bf6a0-dccb-49bc-ab3c-9852b6158862.html00401409 :  401409:    55                            push   %ebp  40140a:    89

2008-04-25 20:26:00 1940

原创 构造缓冲区溢出攻击字符串

题目:     对如下程序实施缓冲区溢出攻击,要求printf("getbuf returned 0x%x/n", val);    打印出 0xdeadbeef   /* Bomb program that is solved using a buffer overflow attack */#include stdio.h>#include stdlib.h>#include ctype.

2008-04-25 20:05:00 1405 1

转载 Linux 汇编语言开发指南

Linux 汇编语言开发指南  级别: 初级肖文鹏 ([email protected]), 北京理工大学计算机系硕士研究生英文版 AT&T汇编详细教程(Professional Assembly Language) 作者 Richard Blum ,格式:pdf原版下载地址  http://download.csdn.net/source/280080    汇编语言的优点是速度快

2007-11-08 11:59:00 825

转载 sprintf你知道多少

sprintf你知道多少 选自《CSDN 社区电子杂志——C/C++杂志》 sprintf 是个变参函数,定义如下:int sprintf( char *buffer, const char *format [, argument] ... );除了前两个参数类型固定外,后面可以接任意多个参数。而它的精华,显然就在第二个参数:格式化字符串上。printf 和spri

2007-10-11 19:19:00 567

转载 malloc()以及free()的机制

malloc()以及free()的机制来自bc-cn C语言论坛       事实上,仔细看一下free()的函数原型,也许也会发现似乎很神奇,free()函数非常简单,只有一个参数,只要把指向申请空间的指针传递给free()中的参数就可以完成释放工作!这里要追踪到malloc()的申请问题了。申请的时候实际上占用的内存要比申请的大。因为超出的空间是用来记录对这块内存的管理信息。先看一

2007-10-10 11:04:00 1790 1

转载 推荐一本五星好书:深入理解计算机系统(修订版)

 from:http://outmyth.blogdriver.com/outmyth/1122212.html深入理解计算机系统(修订版)         【原书名】 Computer Systems A Programmers Perspective 【原出版社】 Pearson  【作者】 (美)Randal E.Bryant; David OHallaron  【译者】 龚奕利

2007-09-26 08:58:00 3841 1

转载 gdb查看运行时数据

 gdb查看运行时数据

2007-09-24 15:11:00 915 1

原创 (编程经验)关于函数栈溢出的实例分析

 函数栈溢出的实例分析来源: http://blog.csdn.net/ttlyfast作者: ttlyfast msn:  [email protected]    有很多老程序会把函数写成如下形式 : void f(one, two)int one; //参数类型写在()后面int two;...{    one = g1;    two = g2;}

2007-09-24 11:39:00 2179

转载 GCC使用手册

  1.前言    GCC编译器的手册(GCC MANUAL)的英文版已经非常全面,并且结构也非常完善了,只是一直都没有中文的版本,我这次阅读了GCC编译器的主要内容,对手册的内容进行了结构性的了解,认为有必要对这次阅读的内容进行整理,为以后的工作做准备。     由于我对这个英文手册的阅读也仅仅是结构性的。因此有很多地方并没有看,所以这篇文档的内容我也只能写出部分,对于以后需要详细了解的

2007-09-21 14:19:00 1243

转载 AT&T汇编语言与GCC内嵌汇编简介

AT&T汇编语言与GCC内嵌汇编简介AT&T汇编语言与GCC内嵌汇编简介 版本 0.1  时间04/3/30EMAIL [email protected] AT&T 与INTEL的汇编语言语法的区别1.1大小写1.2操作数赋值方向1.3前缀1.4间接寻址语法1.5后缀1.6指令2 GCC内嵌汇编2.1简介2.2内嵌汇编举例2.3语法2.3.1汇编语句模板2.3.2输出部分2

2007-09-21 11:35:00 727

转载 关于PE可执行文件的修改

关于PE可执行文件的修改文章提交:ILSY (masteruser_at_263.net)在windows 9x、NT、2000下,所有的可执行文件都是基于Microsoft设计的一种新的文件格式Portable Executable File Format(可移植的执行体),即PE格式。有一些时候,我们需要对这些可执行文件进行修改,下面文字试图详细的描述PE文件的格式及对PE格式文件的修改。

2007-09-20 14:20:00 538

转载 PE文件格式详解

PE文件格式详解作者:MSDN译者:李马 (http://home.nuc.edu.cn/~titilima) 摘要           Windows NT 3.1引入了一种名为PE文件格式的新可执行文件格式。PE文件格式的规范包含在了MSDN的CD中(Specs and Strategy, Specifications, Windows NT File Format Specifi

2007-09-20 14:15:00 681

转载 gdb 使用教程

发信人: TJB (老六), 信区: Linux 标  题: GDB (2) 发信站: BBS 水木调试站 (Tue Jun  2 15:58:26 1998)  发 信 人:System_Killer(大家一起来发呆)           信区名称:Linux[4614] 信件提要:gdb(二) 原发信站:中国科大BBS站(Sat, 28 Mar 1998 22:28:43)  这里是GDB的一

2007-09-18 13:58:00 1928

原创 c语言笔记

c 语言的有些库函数会在编译的时候被优化如gcc 中log2(1)会被优化成常数但是log2(20)就会在运行时计算值fabs 会被优化成机器(汇编)指令 fabs所以即使你没有包含 含有fabs声明的头文件 也可以成功编译运行带有fabs函数的程序.....................................................................(i

2007-09-13 12:51:00 590

转载 浮点数的比较

在数学运算当中经常会涉及到判断两个数是否相等的情况对于整数很好处理 A==B这样的一个语句就可以解决全部的问题但是对于浮点数是不同的首先,浮点数在计算机当中的二进制表达方式就决定了大多数浮点数都是无法精确的表达的现在的计算机大部分都是数字计算机,不是模拟机,数字机的离散化的数据表示方法自然无法精确表达大部分的数据量的。其次计算机浮点数的精度在单精度float类型下,只有7位,在进行浮点运算的时候,

2007-09-12 17:39:00 8353 7

原创 把游戏变成com组件,实现框架窗口内可动态加载游戏功能(wince 粗略版)

windows 程序设计在线版本http://www.ai8windows6.cn/book/windows_programming/ 设计思想:1。把com写在dll里以实现动态加载功能。2。在dll里加入独立线程以驱动子窗口消息循环,使子窗口与主窗口相对独立。3。编写特定规格的容器用来动态加载com。以后会给出说明和整理。有不足之处请高手指正。具体代码:dl

2007-08-29 22:59:00 785

转载 理解和使用NT驱动程序的执行上下文

理解Windows NT驱动程序最重要的概念之一就是驱动程序运行时所处的“执行上下文”。理解并小心地应用这个概念可以帮助你构建更快、更高效的驱动程序。 NT标准内核模式驱动程序编程中的一个重要观念是某个特定的驱动程序函数执行时所处的“上下文”。传统上文件系统开发者最关注这个问题,但所有类型的NT内核模式驱动程序的编写者都能从对执行上下文的深刻理解中获益。小心谨慎地使用执行上下文的概

2007-08-17 17:30:00 1743 1

转载 嵌入式Linux入门的误区

嵌入式Linux入门的误区 来自:http://www.chinaunix.net

2007-08-16 15:44:00 568

原创 WDM 驱动程序 笔记

注册表的角色有三种注册表键负责配置。它们是硬件(hardware)键、类(class)键、服务(service)键。必须明确一点,这些名字(指hardware、class、service)并不是某个专用子键的名称:它们是这三种键的一般称谓,其具体的路径名要取决于它们所属的设备。概括地讲,硬件键包含单个设备的信息,类键涉及所有相同类型设备的共同信息,服务键包含驱动程序信息。有时人们用“实例(inst

2007-08-16 15:24:00 2962

转载 DIRECTX GRAPHICS C/C++教程(一)

DIRECTX GRAPHICS C/C++教程(一)     作者:未知

2007-04-11 11:33:00 1165 1

转载 DirectDraw 游戏编程基础(4)

生成简单的动画 以上我们已经讨论过的所有的例程,都简要描述了如何在台缓冲区绘画,以及如何把后台缓冲区弹出到主表面(Surface)的简单的实现方法。然而,这些例程都是以极其缓慢的速度在运行。下边的例程,DDEX4和DDEX5以实时运行它们的函数,更象一个实际的程序。 DDEX4显示了如何为表面(Surface)设置一个颜色码,并且演示了如何使用IDirectDrawSurface方法将 隐屏表面(

2007-04-05 23:30:00 664

转载 DirectDraw 游戏编程基础(3)

DirectDraw 游戏编程基础(3) <!--google_ad_client = "pub-22219

2007-04-05 15:02:00 648

转载 GetLastError()

 在VC中编写应用程序时,经常需要涉及到错误处理问题。许多函数调用只用TRUE和FALSE来表明函数的运行结果。一旦出现错误,MSDN中往往会指出请用GetLastError()函数来获得错误原因。     可问题是,GetLastError()返回的只是一个双字节数值(DWORD)。OH,MY GOD!目前Win32的出错编号已经从0排到11031,而这还不是错误编码的全部。因为错误代码还在不断

2007-04-03 14:51:00 3767

转载 程序员的七种武器

 世界上有两件事情,需要一辈子的努力。第一是学习,第二是锻炼。其实这本是说明一个问题:每个人在提高自己能力这件事情上,需要持续不断地努力。以最典型的例子来看,只有通过学习,程序员才能保证不断进步。一方面我们学习新的软件技术和更新速度极快的业界新名词;另外一方面,我们也需要不断加强基本技能的巩固。  在这样的前提下,“程序员的七种武器”这个选题就应运而生了。撇开众多软件开发人员的基本素质(学习能力、

2007-04-03 11:55:00 543

转载 DirectDraw 游戏编程基础(2)

  DirectDraw 游戏编程基础(2) <!--google_ad_client = "pub-22

2007-04-03 10:46:00 872

转载 DirectDraw编程基础

 DirectDraw编程基础(zz From GameRes Blog) 本文面向有几个月学习编程经历的初学者:看过C++的教程,看的懂基本的C++语法;有点点VC使用经验,知道怎么去组建一个工程;理解一些windows编程的基本概念,比如窗口、消息循环等;还有,不懂的地方会去查资料:)。看过几本关于DirectDraw的书,这些书都不错,在此感谢她们的作者。美中不足的是这些书的部分起点较高

2007-04-03 10:40:00 1825

转载 (转)动画程序编写——DirectDraw之旅(1) 

动画程序编写——DirectDraw之旅(1)   DirectDraw——也许大多数人闻所未闻,但当提到 DirectX 恐怕每一个 游戏爱好者都再熟

2007-04-03 10:30:00 827

基于ARM 的嵌入式系统程序开发要点

(一) 嵌入式程序开发基本概念<br>(二) 系统的初始化过程<br>(三) 如何满足嵌入式系统的灵活需求<br>(四) 异常处理机制的设计<br>(五) ARM/Thumb的交互工作<br>(六) 开发高效程序的技巧<br>

2008-05-06

SkyEye教程

对于那些想进行嵌入式系统软件开发和学习,或者想研究嵌入式Linux等操作系统和一些底层系统软件(如TCP/IP等)的研究和开发人员来说,可能存在如下几方面的问题:(1)经常苦于经费不足,缺少足够的硬件开发板和完善的软件开发环境,相关的书籍对一些最新软件的分析还不够全面,无法深入研究和开发嵌入式软件。(2)高层次的软件设计和开发一般不用太考虑底层硬件的实现细节,如果直接处于一个具体的硬件环境下,在开发和研究中可能会陷入硬件的具体细节中不能自拔,而不能把精力放到高层次的软件设计和开发上。(3)如果硬件开发环境不太稳定(这种情况经常见到),且对具体的硬件不是很了解,则可能在排除问题上花费大量的不必要的时间。(4)如果你想自己尝试设计一个操作系统,则先在一个提供源码级调试的软件仿真器上进行开发,可能会大大提高你的开发进度。&lt;br&gt;&lt;br&gt;对于想了解、学习一般操作系统的实现原理,Linux/μCLinux操作系统或TCP/IP等系统级软件的实现的人员,目前一般采用的方法是看书和读源代码,这是一种静态的学习方法,效率较低,比较枯燥,缺少亲自实践的感觉。要想深入分析和开发软件,就要动手编程,不能只是看看书,读读代码,只有通过亲手实践才能够掌握软件设计的核心内容。上面所指出的问题和需求促使SkyEye项目的诞生。 &lt;br&gt;&lt;br&gt;3.SkyEye的目标和意义 &lt;br&gt;SkyEye是一个开源软件(OpenSource Software)项目,中文名字是&quot;天目&quot;。SkyEye的目标是在通用的Linux和Windows平台上实现一个纯软件集成开发环境,模拟常见的嵌入式计算机系统(这里假定&quot;仿真&quot;和&quot;模拟&quot;的意思基本相同);可在SkyEye上运行μCLinux以及μC/OS-II等多种嵌入式操作系统和各种系统软件(如TCP/IP,图形子系统,文件子系统等),并可对它们进行源码级的分析和测试。&lt;br&gt;&lt;br&gt;3.SkyEye的目标和意义 &lt;br&gt;SkyEye是一个开源软件(OpenSource Software)项目,中文名字是&quot;天目&quot;。SkyEye的目标是在通用的Linux和Windows平台上实现一个纯软件集成开发环境,模拟常见的嵌入式计算机系统(这里假定&quot;仿真&quot;和&quot;模拟&quot;的意思基本相同);可在SkyEye上运行μCLinux以及μC/OS-II等多种嵌入式操作系统和各种系统软件(如TCP/IP,图形子系统,文件子系统等),并可对它们进行源码级的分析和测试。&lt;br&gt;&lt;br&gt;纯软件的模拟器有许多种,如模拟一个芯片时序逻辑的模拟器、只模拟CPU指令的模拟器、模拟整个硬件开发板的模拟器、模拟一个PDA的模拟器等。存在一些纯软件的仿真器或模拟器,如Stanford大学的SimOS模拟器,它仿真的是MIPS系列CPU和相关外设,可以在其上运行SGI公司的Irix操作系统和软件,目前基本上停止了进一步的开发;PSIM是一个仿真PowerPC指令集的模拟器,目前只支持简单的命令行应用程序;xcopilot是一个PDA模拟器,它是由Greg Hewgill出于个人喜好编写的,它仿真的是M68K CPU,通过它可以给基于PalmOS的软件开发者提供一个模拟开发环境。Bochs是一个仿真x86 CPU的开源项目,目前还支持AMD64 CPU,在它上面可以运行Linux操作系统。其它一些商业的仿真软件如vmware和virtualPC可以仿真一个真实的x86计算机,而Virtutech Simics仿真器可以仿真多种CPU和硬件,功能强大,可用于硬件和系统软件的评测。&lt;br&gt;&lt;br&gt;SkyEye是一个指令级模拟器,可以模拟多种嵌入式开发板,可支持多种CPU指令集,在SkyEye上运行的操作系统意识不到它是在一个虚拟的环境中运行,而且开发人员可以通过SkyEye调试操作系统和系统软件。由于SkyEye的目标不是验证硬件逻辑,而是协助开发、调试和学习系统软件,所以在实现上SkyEye与真实的硬件环境相比还是有一定差别的。SkyEye在时钟节拍的时序上不保证与硬件完全相同,对软件透明的一些硬件仿真进行了一定的简化。这样带来的好处是SkyEye的执行效率更高。SkyEye的推出具有下面三方面的意义:&lt;br&gt;&lt;br&gt;通过SkyEye仿真集成环境可以很方便地进入到嵌入式系统软件学习和开发的广阔天地中。尤其对于缺少嵌入式硬件开发环境和软件开发环境的用户来说,它将是一个非常有效的学习工具和开发手段,因为SkyEye的整个软件系统都是Open Source的,且基于GPL协议(μCOS-II除外)。因此,如果要学习Linux操作系统或者进行嵌入式系统开发,但苦于没有硬件支持,SkyEye仿真环境软件是一个很好的选择! &lt;br&gt;如果想研究与具体硬件无关的系统软件(如TCP/IP协议栈等

2008-03-02

蓝牙协议电子书 + vc通讯例子

1 Introduction ......................................................................................... 4<br>1.1 Bluetooth Protocol Stack............................................................. 4<br>2 Protocols in Bluetooth Architecture.................................................. 6<br>2.1 Bluetooth Core Protocols ............................................................ 7<br>2.1.1 Baseband ....................................................................... 7<br>2.1.1.1 Audio................................................................ 7<br>2.1.2 Link Manager Protocol ................................................... 7<br>2.1.3 Logical Link Control and Adaptation Protocol................. 7<br>2.1.4 Service Discovery Protocol (SDP).................................. 8<br>2.2 Cable Replacement Protocol ...................................................... 8<br>2.2.1 RFCOMM....................................................................... 8<br>2.3 Telephony Control Protocol......................................................... 8<br>2.3.1 Telephony Control – Binary............................................ 8<br>2.3.2 Telephony Control – AT Commands .............................. 8<br>2.4 Adopted Protocols....................................................................... 9<br>2.4.1 PPP................................................................................ 9<br>2.4.2 TCP/UDP/IP ................................................................... 9<br>2.4.3 OBEX Protocol ............................................................... 9<br>2.4.3.1 Content Formats .............................................. 9<br>2.4.4 WAP............................................................................. 10<br>2.4.4.1 Content Formats ............................................ 11<br>3 Bluetooth Usage Models and Protocols ......................................... 12<br>3.1 File Transfer.............................................................................. 12<br>3.2 Internet Bridge .......................................................................... 12<br>3.3 LAN Access .............................................................................. 13<br>3.4 Synchronization ........................................................................ 14<br>3.5 Three-in-One Phone ................................................................. 14<br>3.6 Ultimate Headset ...................................................................... 15<br>4 Summary............................................................................................ 16<br>5 References......................................................................................... 17<br>6 Acronyms........................................................................................... 19

2008-02-23

linker and loader 中文版+英文版

几乎从有计算机以来,链接器和加载器就是软件开发工具包中的一部分,因为他们是<br>允许使用模块(而不是一个单独的大文件)来构建程序的关键工具。<br>早在1947年,程序员们就开始使用原始的加载器:将程序的例程存储在多个不同的磁<br>带上,并将他们合并、重定位为一个程序。在上世纪60年代早期,这些加载器就已经发展<br>的相当完善了。由于那时内存很贵且容量有限,计算机的速度(以今天的标准)很慢,为了<br>创建复杂的内存覆盖策略(将大容量的程序加在到少量的内存中),以及重复编辑之前链接<br>过的文件(节省重新创建程序的时间),这些链接器都包含了很多复杂的特性。<br>上世纪70到80年代,链接技术几乎没有什么进展。链接器趋向于更加简单,虚拟内存<br>技术将应用程序和覆盖机制中的大多数存储管理工作都转移给了操作系统,越来越快的计算<br>机和越来越大的磁盘也使得重新链接一个程序或替换个别模块比仅仅链接改变过的地方更加<br>容易了。从上世纪90年代起,由于增加了诸如动态链接共享库和C++的诸多现代特性,链接<br>器又开始变得复杂起来。像IA64这样具有长指令字和编译时访存调度等特性的先进处理器<br>架构,也需要将一些新的特性加入到链接器中以确保在被链接的程序中可以满足代码的这些<br>复杂需求。<br><br>Table of Contents<br>Chapter 0: Front Matter ........................................................ 1<br>Dedication .............................................................................................. 1<br>Introduction ............................................................................................ 1<br>Who is this book for? ......................................................................... 2<br>Chapter summaries ............................................................................. 3<br>The project ......................................................................................... 4<br>Acknowledgements ............................................................................ 5<br>Contact us ........................................................................................... 6<br>Chapter 1: Linking and Loading ........................................... 7<br>What do linkers and loaders do? ............................................................ 7<br>Address binding: a historical perspective .............................................. 7<br>Linking vs. loading .............................................................................. 10<br>Two-pass linking .............................................................................. 12<br>Object code libraries ........................................................................ 15<br>Relocation and code modification .................................................... 17<br>Compiler Drivers .................................................................................. 18<br>Linker command languages ............................................................. 19<br>Linking: a true-life example ................................................................. 20<br>Exercises .............................................................................................. 25<br>Chapter 2: Architectural Issues ........................................... 27<br>Application Binary Interfaces .............................................................. 27<br>Memory Addresses .............................................................................. 28<br>Byte Order and Alignment ............................................................... 28<br>Address formation ................................................................................ 30<br>Instruction formats ............................................................................... 31<br>Procedure Calls and Addressability ..................................................... 32<br>Procedure calls ................................................................................. 33<br>2 Table of Contents<br>Data and instruction references ............................................................ 36<br>IBM 370 ........................................................................................... 37<br>SPARC ............................................................................................. 40<br>SPARC V8 ................................................................................... 40<br>SPARC V9 ................................................................................... 42<br>Intel x86 ........................................................................................... 43<br>Paging and Virtual Memory ................................................................. 45<br>The program address space .............................................................. 48<br>Mapped files ..................................................................................... 49<br>Shared libraries and programs ......................................................... 51<br>Position-independent code ............................................................... 51<br>Intel 386 Segmentation ........................................................................ 53<br>Embedded architectures ....................................................................... 55<br>Address space quirks ........................................................................ 56<br>Non-uniform memory ...................................................................... 56<br>Memory alignment ........................................................................... 57<br>Exercises .............................................................................................. 57<br>Chapter 3: Object Files ........................................................ 59<br>What goes into an object file? .............................................................. 59<br>Designing an object format .............................................................. 60<br>The null object format: MS-DOS .COM files ...................................... 61<br>Code sections: Unix a.out files ............................................................. 61<br>a.out headers .................................................................................... 64<br>Interactions with virtual memory ..................................................... 65<br>Relocation: MS-DOS EXE files ........................................................... 72<br>Symbols and relocation ........................................................................ 74<br>Relocatable a.out .................................................................................. 75<br>Relocation entries ............................................................................. 78<br>Symbols and strings ......................................................................... 80<br>a.out summary .................................................................................. 82<br>Unix ELF ............................................................................................. 82<br>Relocatable files ............................................................................... 85<br>ELF executable files ......................................................................... 92<br>ELF summary ................................................................................... 94<br>Table of Contents 3<br>IBM 360 object format ......................................................................... 94<br>ESD records ..................................................................................... 95<br>TXT records ..................................................................................... 97<br>RLD records ..................................................................................... 97<br>END records ..................................................................................... 98<br>Summary .......................................................................................... 98<br>Microsoft Portable Executable format ................................................. 99<br>PE special sections ......................................................................... 105<br>Running a PE executable ............................................................... 107<br>PE and COFF ................................................................................. 107<br>PE summary ................................................................................... 108<br>Intel/Microsoft OMF files .................................................................. 108<br>OMF records .................................................................................. 110<br>Details of an OMF file ................................................................... 111<br>Summary of OMF .......................................................................... 114<br>Comparison of object formats ............................................................ 114<br>Project ................................................................................................ 115<br>Exercises ............................................................................................ 117<br>Chapter 4: Storage allocation ............................................ 119<br>Segments and addresses ..................................................................... 119<br>Simple storage layout ......................................................................... 120<br>Multiple segment types ...................................................................... 121<br>Segment and page alignment ............................................................. 124<br>Common blocks and other special segments ..................................... 125<br>Common ......................................................................................... 125<br>C++ duplicate removal ................................................................... 127<br>Initializers and finalizers ................................................................ 130<br>IBM pseudo-registers ..................................................................... 131<br>Special tables ................................................................................. 134<br>X86 segmented storage allocation ................................................. 134<br>Linker control scripts ......................................................................... 136<br>Embedded system storage allocation ................................................. 138<br>Storage allocation in practice ............................................................. 138<br>Storage allocation in Unix a.out linkers ......................................... 139<br>4 Table of Contents<br>Storage allocation in ELF .............................................................. 141<br>Storage allocation in Windows linkers .......................................... 144<br>Exercises ............................................................................................ 146<br>Project ................................................................................................ 147<br>Chapter 5: Symbol management ....................................... 149<br>Binding and name resolution ............................................................. 149<br>Symbol table formats ......................................................................... 150<br>Module tables ................................................................................. 153<br>Global symbol table ....................................................................... 154<br>Symbol resolution .......................................................................... 157<br>Special symbols ............................................................................. 158<br>Name mangling .................................................................................. 158<br>Simple C and Fortran name mangling ........................................... 158<br>C++ type encoding: types and scopes ............................................ 160<br>Link-time type checking ................................................................ 163<br>Weak external and other kinds of symbols ........................................ 164<br>Maintaining debugging information .................................................. 164<br>Line number information ............................................................... 164<br>Symbol and variable information ................................................... 165<br>Practical issues ............................................................................... 166<br>Exercises ............................................................................................ 167<br>Project ................................................................................................ 167<br>Chapter 6: Libraries ........................................................... 169<br>Purpose of libraries ............................................................................ 169<br>Library formats .................................................................................. 169<br>Using the operating system ............................................................ 169<br>Unix and Windows Archive files ................................................... 170<br>Unix archives ............................................................................. 170<br>Extension to 64 bits ........................................................................ 174<br>Intel OMF libraries ........................................................................ 174<br>Creating libraries ................................................................................ 176<br>Searching libraries ............................................................................. 177<br>Table of Contents 5<br>Performance issues ............................................................................. 179<br>Weak external symbols ...................................................................... 179<br>Exercises ............................................................................................ 181<br>Project ................................................................................................ 181<br>Chapter 7: Relocation ......................................................... 183<br>Hardware and software relocation ..................................................... 183<br>Link time and load time relocation .................................................... 184<br>Symbol and segment relocation ......................................................... 185<br>Symbol lookups ............................................................................. 186<br>Basic relocation techniques ................................................................ 186<br>Instruction relocation ..................................................................... 188<br>X86 instruction relocation .......................................................... 189<br>SPARC instruction relocation .................................................... 189<br>ECOFF segment relocation ............................................................ 191<br>ELF relocation ............................................................................... 193<br>OMF relocation .............................................................................. 193<br>Relinkable and relocatable output formats ........................................ 194<br>Other relocation formats .................................................................... 194<br>Chained references ......................................................................... 195<br>Bit maps ......................................................................................... 195<br>Special segments ............................................................................ 196<br>Relocation special cases ..................................................................... 197<br>Exercises ............................................................................................ 197<br>Project ................................................................................................ 198<br>Chapter 8: Loading and overlays ...................................... 201<br>Basic loading ...................................................................................... 201<br>Basic loading, with relocation ............................................................ 202<br>Position-independent code ................................................................. 203<br>TSS/360 position independent code ............................................... 203<br>Per-routine pointer tables ............................................................... 206<br>Table of Contents ........................................................................... 207<br>ELF position independent code ..................................................... 208<br>6 Table of Contents<br>PIC costs and benefits .................................................................... 212<br>Bootstrap loading ............................................................................... 213<br>Tree structured overlays ..................................................................... 214<br>Defining overlays ........................................................................... 217<br>Implementation of overlays ........................................................... 220<br>Overlay fine points ......................................................................... 222<br>Data ............................................................................................ 222<br>Duplicated code ......................................................................... 222<br>Multiple regions ......................................................................... 223<br>Overlay summary ........................................................................... 223<br>Exercises ............................................................................................ 223<br>Project ................................................................................................ 224<br>Chapter 9: Shared libraries ............................................... 227<br>Binding time ...................................................................................... 230<br>Shared libraries in practice ................................................................. 231<br>Address space management ............................................................... 231<br>Structure of shared libraries ............................................................... 232<br>Creating shared libraries .................................................................... 233<br>Creating the jump table .................................................................. 234<br>Creating the shared library ............................................................. 235<br>Creating the stub library ................................................................. 235<br>Version naming .............................................................................. 237<br>Linking with shared libraries ............................................................. 238<br>Running with shared libraries ............................................................ 238<br>The malloc hack, and other shared library problems ......................... 240<br>Exercises ............................................................................................ 243<br>Project ................................................................................................ 244<br>Chapter 10: Dynamic Linking and Loading .................... 247<br>ELF dynamic linking ......................................................................... 248<br>Contents of an ELF file ...................................................................... 248<br>Loading a dynamically linked program ............................................. 253<br>Starting the dynamic linker ............................................................ 253<br>Table of Contents 7<br>Finding the libraries ....................................................................... 254<br>Shared library initialization ............................................................ 255<br>Lazy procedure linkage with the PLT ................................................ 256<br>Other peculiarities of dynamic linking .............................................. 258<br>Static initializations ........................................................................ 258<br>Library versions ............................................................................. 259<br>Dynamic loading at runtime ............................................................... 260<br>Microsoft Dynamic Link Libraries .................................................... 260<br>Imported and exported symbols in PE files ................................... 261<br>Lazy binding .................................................................................. 266<br>DLLs and threads ........................................................................... 267<br>OSF/1 pseudo-static shared libraries ................................................. 267<br>Making shared libraries fast ............................................................... 268<br>Comparison of dynamic linking approaches ...................................... 270<br>Exercises ............................................................................................ 271<br>Project ................................................................................................ 271<br>Chapter 11: Advanced techniques ..................................... 273<br>Techniques for C++ ........................................................................... 273<br>Trial linking .................................................................................... 274<br>Duplicate code elimination ............................................................ 276<br>Database approaches ...................................................................... 278<br>Incremental linking and relinking ...................................................... 278<br>Link time garbage collection ............................................................. 281<br>Link time optimization ....................................................................... 282<br>Link time code generation ................................................................. 284<br>Link-time profiling and instrumentation ........................................ 284<br>Link time assembler ....................................................................... 285<br>Load time code generation ............................................................. 285<br>The Java linking model ...................................................................... 287<br>Loading Java classes ...................................................................... 288<br>Exercises ............................................................................................ 290<br>Project ................................................................................................ 291<br>8 Table of Contents<br>Chapter 12: References ...................................................... 293<br>Perl books ....................................................................................... 295

2008-01-10

手机游戏开发实例(smartphone联机炸弹人)

c++ wince sdk AI<br><br>smartphone版本 和windows版本<br><br>目录<br>Table of content<br>I. Introduction.........................................................................................................................................................................5<br>II. Graphics and Gameplay .................................................................................................................................................7<br>II.1. Getting Started .............................................................................................................................................................7<br>II.1.1. First Test................................................................................................................................................................7<br>II.1.2. Windows Programming and Message Handling essentials ...........................................................................8<br>II.1.3. Drawing Bitmaps to the screen........................................................................................................................ 14<br>II.1.4. Sprite movement and user input....................................................................................................................... 18<br>II.1.5. Additional stuff to do........................................................................................................................................ 22<br>II.2. Dialogs........................................................................................................................................................................22<br>II.3. GAPI, Bitmaps and Blitters......................................................................................................................................26<br>II.3.1. GAPI.................................................................................................................................................................... 26<br>II.3.2. Bitmaps................................................................................................................................................................ 30<br>II.3.3. Blitters ................................................................................................................................................................. 33<br>II.4. Game Design ..............................................................................................................................................................38<br>II.4.1. Graphics .............................................................................................................................................................. 39<br>II.4.2. Game Area .......................................................................................................................................................... 39<br>II.4.3. Bomb handling................................................................................................................................................... 40<br>II.4.4. Player Sprites...................................................................................................................................................... 42<br>II.4.5. Computer Player ................................................................................................................................................ 42<br>II.5. Finishing the game ....................................................................................................................................................43<br>II.6. Debugging...................................................................................................................................................................44<br>II.7. Efficient and clean programming on CE devices..................................................................................................45<br>II.8. Hardware Button Click Sound.................................................................................................................................47<br>III. Communications............................................................................................................................................................50<br>III.1. Overview of the libraries ........................................................................................................................................50<br>III.1.1. Consequences.................................................................................................................................................... 51<br>III.2. Messages....................................................................................................................................................................53<br>III.3. Class CNetwork........................................................................................................................................................54<br>III.3. Class CNetBuffer......................................................................................................................................................56<br>III.4. DirectPlay .................................................................................................................................................................57<br>III.4.1. Introduction....................................................................................................................................................... 57<br>III.4.2. Different kinds of Service Providers.............................................................................................................. 57<br>III.5. Class CDPNet...........................................................................................................................................................59<br>III.5.1. DirectPlay Objects and Initialisation............................................................................................................. 60<br>III.5.2. Sending Data..................................................................................................................................................... 67<br>III.5.3. Game Abort ....................................................................................................................................................... 67<br>III.6. IrDATM (Infrared Data Association).....................................................................................................................68<br>III.6.1. Introduction....................................................................................................................................................... 68<br>III.6.2. Class CNet......................................................................................................................................................... 70<br>III.6.3. Initialise the CIRNet object............................................................................................................................ 71<br>III.6.4. The Recieve Thread......................................................................................................................................... 73<br>III.6.5. The Send Thread .............................................................................................................................................. 74<br>III.6.6. The Send Buffer ............................................................................................................................................... 75<br>III.6.7. The Receive Buffer.......................................................................................................................................... 79<br>III.6.8. Testing the basic network functions............................................................................................................... 81<br>III.6.9. Last things todo in the class CIRNet.............................................................................................................. 82<br>IV. Appendix A: Overview of the message identifiers.................................................................................................84<br>3<br>V. Appendix B: Network Statistics for DirectPlay .......................................................................................................85<br>VI. Appendix C: Configuration of Bluetooth Manager to play SmartBlaser over the Bluetooth Serial Port<br>Service. ....................................................................................................................................................................................86<br>VII. LITERATURE.............................................................................................................................................................89<br>Table of figures<br>Figure 1: Screenshot of SmartBlaster ________________________________________________________ 5<br>Figure 2: Communication Infrastructure______________________________________________________ 6<br>Figure 3: Create new project ______________________________________________________________ 6<br>Figure 4: screenshot from the running application in „project3“.__________________________________ 18<br>Figure 5: The Insert Resource dialog. Three different sized empty dialog templates are available. _________ 23<br>Figure 6: The resource editor. ____________________________________________________________ 25<br>Figure 7: Under Project – Settings, open the tab “Link” and include gx.lib to the library modules _________ 26<br>Figure 8: Under Tools – Options, open the tab “Directories”.. ____________________________________ 27<br>Figure 9: Output of the sample application on the Smartphone. ___________________________________ 28<br>Figure 10: Output of the sample application on the PocketPC..____________________________________ 28<br>Figure 11 a): fast blitter function b): colour keying____________________________________________ 38<br>Figure 12: and at last the sprites get drawn with colour keying being used.___________________________ 38<br>Figure 13: The block bitmap______________________________________________________________ 39<br>Figure 14 bombs triggered by bombs _______________________________________________________ 41<br>Figure 15: Error file logging calls to new and delete___________________________________________ 46<br>Figure 16: Activate the Platform SDK library for Visual Studio ___________________________________ 50<br>Figure 17: Configuration of COM ports for the bluetooth serial sevice______________________________ 52<br>Figure 18: Enumeration of the available DirectPlay Service Providers______________________________ 58<br>Figure 19 : Message flow during network session______________________________________________ 66<br>Figure 20: different IrDa layers___________________________________________________________ 69<br>Figure 21: pointer position in send and recv buffers______________________________________________ 78<br>Figure 22: DirectPlay Network Statistic _____________________________________________________ 85<br>Figure 23: Configaration of Smartblaster____________________________________________________ 86<br>Figure 24: Configuration of computer "DUDDLE"_____________________________________________ 87<br>Figure 25: Configuration of computer "BONGO" ______________________________________________ 88<br>Table of code fragments<br>Code fragment 1: Extract from the file “Blaster_CE.h” in “project3\Blaster_CE” _____________________ 14<br>Code fragment 2: Extract from the file “Blaster_CE.cpp” in “project3\Blaster_CE” ___________________ 15<br>Code fragment 3: The file “resource.h” in project3 “project3\Blaster_CE” __________________________ 15<br>Code fragment 4: Extract from the file “Blaster_CE.rc” in project3\Blaster_CE” _____________________ 15<br>Code fragment 5: The function “LoadBitmaps” in “project3\Blaster_CE”.___________________________ 16<br>Code fragment 6: The function “DrawGame” in “project3\Blaster_CE”.____________________________ 17<br>Code fragment 9: Extract from the file „Blaster_CE.h“ in project4_________________________________ 18<br>Code fragment 10: Extract of the function “DrawGame“ in project4 _______________________________ 19<br>Code fragment 11: The function DoKeydownMain in project4a ___________________________________ 20<br>Code fragment 12: Initialising the GAPI input functionality and retrieving keycode information ___________ 20<br>Code fragment 13: The modified message loop in project4b ______________________________________ 21<br>4<br>Code fragment 14: Open a dialog box_______________________________________________________ 23<br>Code fragment 15: Example of a dialog procedure_____________________________________________ 24<br>Code fragment 17: Creating and using a font _________________________________________________ 25<br>Code fragment 18: The function ”LoadBitmap“ _______________________________________________ 33<br>Code fragment 19: The first blitter method ___________________________________________________ 34<br>Code fragment 20: The Flip method switching between primary and secondary surface_________________ 35<br>Code fragment 22: A faster blit.___________________________________________________________ 36<br>Code fragment 23: Modified LoadBitmap function _____________________________________________ 36<br>Code fragment 24: The faster blit for landscape displays ________________________________________ 37<br>Code fragment 25: Draw the background bitmap to the background buffer. __________________________ 37<br>Code fragment 28: The process function for the game. __________________________________________ 44<br>Code fragment 29: Stop the click with a device management function. ______________________________ 47<br>Code fragment 30: Query the registry before stopping the click tone. _______________________________ 49<br>Code fragment 31: Restore old click tone setting. ______________________________________________ 49<br>Code fragment 32: An example of a send method.. _____________________________________________ 59<br>Code fragment 35: Summary of the CDPServer constructor ______________________________________ 61<br>Code fragment 37: Summary of the function InitDirectPlayClient().________________________________ 62<br>Code fragment 38: Information required to enumerate hosts______________________________________ 62<br>Code fragment 39: Summary of CDPClient:: SessionsDlgEnumHosts _______________________________ 63<br>Code fragment 40: Summary of SessionsDlgNoteEnumResponse() _________________________________ 64<br>Code fragment 42: Client connects to a host (function SessionsDlgJoinGame) ________________________ 65<br>Code fragment 43: Example of how to the server sends data to all direct play clients ___________________ 67<br>Code fragment 44: Example of how to the clint sends data to the server _____________________________ 67<br>Code fragment 45: The Thread used to initialise or reconnect a network connection. ___________________ 70<br>Code fragment 46: The receive thread ______________________________________________________ 74<br>Code fragment 47: The send thread ________________________________________________________ 75<br>Code fragment 48: Example using GetNextMsg and RealeaseNexttMsg to produce a message ____________ 76<br>Code fragment 49: GetNextMsg returns a pointer to the next free message in the send buffer _____________ 76<br>Code fragment 50: ReleaseNextMsg releases dwSize bytes to be sent by adjusting the write pointer ________ 76<br>Code fragment 52: The send thread writes incoming data in the receive buffer and increments the pointers __ 79<br>Code fragment 53: Process the messages contained in the receive buffer ____________________________ 80<br>Code fragment 54: Handle incomplete messages_______________________________________________ 81<br>Code fragment 56: When detecting a socket error in one of the threads, the threads will be stopped and the reconnection<br>process will be initialised._______________________________________________________ 83

2007-12-29

The Art of Assembly Language Programming

You are visitor as of October 17, 1996.The Art of Assembly Language ProgrammingForward Why Would Anyone Learn This Stuff?1 What's Wrong With Assembly Language2 What's Right With Assembly Language?3 Organization of This Text and Pedagogical Concerns4 Obtaining Program Source Listings and Other Materials in This TextSection One: Machine OrganizationArt of Assembly Language: Chapter OneChapter One - Data Representation1.0 - Chapter Overview1.1 - Numbering Systems1.1.1 - A Review of the Decimal System1.1.2 - The Binary Numbering System1.1.3 - Binary Formats1.2 - Data Organization1.2.1 - Bits1.2.2 - Nibbles1.2.3 - Bytes1.2.4 - Words1.2.5 - Double Words1.3 - The Hexadecimal Numbering System1.4 - Arithmetic Operations on Binary and Hexadecimal Numbers1.5 - Logical Operations on Bits1.6 - Logical Operations on Binary Numbers and Bit Strings1.7 - Signed and Unsigned Numbers1.8 - Sign and Zero Extension1.9 - Shifts and Rotates1.10 - Bit Fields and Packed Data1.11 - The ASCII Character Set1.12 Summary1.13 Laboratory Exercises1.13.1 Installing the Software1.13.2 Data Conversion Exercises1.13.3 Logical Operations Exercises1.13.4 Sign and Zero Extension Exercises1.13.5 Packed Data Exercises1.14 Questions1.15 Programming ProjectsChapter Two - Boolean Algebra2.0 - Chapter Overview2.1 - Boolean Algebra2.2 - Boolean Functions and Truth Tables2.3 - Algebraic Manipulation of Boolean Expressions2.4 - Canonical Forms2.5 - Simplification of Boolean Functions2.6 - What Does This Have To Do With Computers, Anyway?2.6.1 - Correspondence Between Electronic Circuits and Boolean Functions2.6.2 - Combinatorial Circuits2.6.3 - Sequential and Clocked Logic2.7 - Okay, What Does It Have To Do With Programming, Then?2.8 - Generic Boolean Functions2.9 Laboratory Exercises<

2007-12-20

程序大战1.0

简介 程序大战也叫磁核大战,英文名为"CoreWars",是一个很古老的游戏,当年比尔.盖茨上学时就有这个东东了,不过国内玩的人很少。 目前一些免费 Unix如FreeBSD等的ports里就有他。 这个游戏可以从名字也能看出来就是程序之间的大赛。就是大家都写一个程序,然后我们把这些程序都放到内存,然后开始"并发"运行,看最终的结果是谁的程序消灭了内存中的其他程序而存活了下来。 这一程序对抗模型可以看作是原始的病毒对抗。每个程序都要尽力的消灭其他程序,为了能够生存,程序应该能保护自己,不断移动自身来躲过其他程序的攻击或当自身受到攻击后能自我修复。 当然这些程序不是运行在家用PC上,也不是随便使用大家常用的intel汇编来编写。其运行平台为Mars机。Mars是一种简单的计算机,他有固定的8000 个内存单元,和约10来个指令。然后整个大战程序就是由这些指令完成。 < 二 > Mars体系结构 Mars机器由一个组内存单元,一个CU单元,一个简单进程管理系统,和一组指令集构成。 Mars机的标准主要参考pMars虚拟机器标准,主要有两个:88标准和94标准。以下都是默认为88标准,扩展94标准会专门标识出来。 该系统内存大小固定为8000个内存单元,每一个内存单元由5个部分构成: <1> OPCODE区:操作数区,该区域指定了机器指令,如MOV ,ADD。 <2> A数据区 :一个32位的数据存储区,存放相应数据,如128,-100。 <3> A数据区寻址修饰:指定了A数据区的寻址方式。 <4> B数据区。 <5> B数据区寻址修饰。 ( 94标准中加入了一个新的部分 <6>操作数修饰区。 ) 系统的寻址方式分为立即寻址,直接寻址,间接寻址。 (94标准中加入了新的间接A减1寻址、间接A加1寻址、间接B减1寻址、间接B 加1寻址) 系统寻址都是相对当前IP为基准寻址的,这是Mars系统和传统计算机最大的不同之处。如 mov 0,1表示将当前指令所在的内存单元拷贝一份到当前指令所在内存单元的下一个内存单元。 CU单元用于执行相应的指令,配合CU单元还有一个隐含的寄存器IP,每次执行单元执行IP指定的内存单元的指令。 简单进程管理器管理进程。系统的进程由一个先进先出队列构成。每次管理系统将当前进程的执行地址出队列放入IP寄存器,然后CU单元执行指令,最后将该进程的下一条指令地址放入队尾。如果该进程产生新进程,则在队尾再加入新进程的起始执行地址。简单进程管理器保证每个进程轮流执行,当一个进程执行了DAT或者执行了0被除的操作则该进程结束。 系统指令包含: DAT MOV ADD SUB JMP JMZ JMN CMP SLT DJN SPL ( 94标准中加入了新的指令: SUB MUL DIV MOD SEQ SNE NOP LDP STP ) Mars机目前你所见到的几乎都是软件模拟系统,模拟器模拟Mars系统工作。有的模拟器支持88标准,有的支持94标准,有的支持88标准并部分支持94 标准,所以你在选择一个模拟器时应该好好看看它支持那个标准。 Mars机的汇编程序通常称为RedCode,而Mars模拟器几乎都集成了一个RedCode 的编译器,将RedCode程序编译为机器码写入内存。 系统初始时内存中都是DATA $ 0,$ 0 ,每一个程序加载到内存的随机位置,当多个程序都加载完后系统给每个程序创建一个进程,此时每个进程在进程队列中的位置是随机的,然后系统开始运行。然后各个程序开始进行对抗,看最终谁能生存下来。 <三> RedCode简单语法(按94标准)

2007-12-07

计算机体系结构第四版(原版)

Computer Architecture.pdf(英)Hennessy & Patterson

2007-12-07

csapp

深入理解计算机系统及实验

2007-12-03

缓冲区溢出攻击实验

缓冲区溢出攻击实验。

2007-11-22

揭密代码结构

揭密代码结构中英对照版

2007-11-19

逆向工程揭密

逆向工程揭密 (英)

2007-11-19

IA32 system programming guide Vol.3

IA32 system programming guide Vol.3

2007-11-08

IA32 system programming guide Vol.2

IA32 system programming guide Vol.2

2007-11-08

IA32 system programming guide Vol.1

IA32 system programming guide Vol.1

2007-11-08

at&t汇编教程1

at&t汇编教程 pdf 英文原版<br>Richard Blum

2007-11-08

跟我学模拟电子电路.pdf

跟我学模拟电子电路 电路哦

2007-11-03

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除