ollydbg Run Trace

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情
Run trace

    Run trace was first introduced in OllyDbg 1.04. This debugging technique is basically very simple. Code is executed step by step, and debugger protocols every command, together with registers and flags, in the large circular buffer. When exception occurs, one can backtrace several (or hundreds of thousands) last commands and analyse conditions that led to error. 
    OllyDbg 1.06 has significantly improved the possibilities of run trace. Run trace shows modified registers and keeps important messages and operands of known functions. One can set conditions to pause run trace, profile traced code, write run trace to disk in order to overcome memory limitations or to compare two runs, debug self-modified programs, find ount when command at certain location was executed for the last time, and so on.

    Please keep in mind, however, that run trace is slow. On a 500-MHz processor, OllyDbg can trace up to 2500 (Windows 95) or 5000 (NT) commands per second. To accelerate run trace, one can mark quasi-linear pieces of code (without jumps to outside) that should be executed at once. And one more limitation: OllyDbg doesn't save the contents of accessed memory.

    To make you familiar with the run trace, let's try to debug a simple console application:

#include <stdio.h>
void f1(void) { printf("a"); };
void f2(void) { printf("b"); };
void f3(void) { printf("c"); };
void (*f[3])() = { f1,f2,f3 };
void main(void) {
  int i,j,k;
  for (i=0; i<100; i++) {
    for (j=0; j<1000000; j++) ;  // Long code
    k=i/33;
    if (k>3) continue;
    f[k]();                      // Here error (when i==99)!
  };
  printf("\n");
};
    Functions f1, f2 and f3 print letters a, b and c. Main program calls each function 33 times, then prints newline and terminates... at least in theory. (You have already found the error, don't you? Well done, but here we learn how to come to the same result using run trace). Try to run  rtrace.exe , and in a couple of seconds it crashes:

    Oh, no! Something is definitely wrong! As OllyDbg is your just-in-time debugger of choice, you press "Debug", but Disassembler window is empty! Address 00620061 points to nowhere, and you have not the faintest idea which command jumped to this location. Let's try from the very beginning. Press Ctrl+F2 (shortcut for Restart), then Ctrl+F11 (Trace into) and wait for a minute or two. Console is still empty. Maybe some part of the code takes too long to execute? Pause run trace by pressing F12 (Pause) or Esc. In the Executable modules, click on RTRACE and select "View run trace profile":

    A command or a sequence of commands at address 00401191 was executed more than 24000 times. Follow this line in Disassembler:

    A short 3-command cycle executes F4240 (decimal 1000000) times. At 5000 commands per second, OllyDbg will need 10 minutes to trace this cycle. Note that sequence is quasi-linear, i.e. has no jumps to outside. From the pop-up menu, choose "Run trace|Skip selection when tracing". Red line in the fourth column indicates that commands are excluded from run trace. When OllyDbg encounters excluded sequence, it sets temporary breakpoint at the command that immediately follows excluded block (in our case, 00401199) and runs it at once. Of course, any return or  jump to outside would make correct tracing impossible, so OllyDbg checks the piece of code you want to exclude and in hard cases asks you for confirmation. 
    Continue run trace. The digits now appear quickly. Within 20 seconds, OllyDbg reports error:

    Confirm this error, open Run trace window (button with period '...' in the toolbar) and scroll it to the bottom:

    Now we can see that command that jumped to 00620061 was CALL EAX at 004011AF, and invalid address was calculated one command before the call. Doubleclick this line to see it in Disassembler. Registers and information are grayed to emphasize that they are not actual, but taken from the trace:

    Address constant 0040A128 points to array of 3 fixups containing addresses of functions f1, f2 and f3. When this command was executed for the last time, EAX contained index 3, outside the array's bounds. Two previous commands should perform bounds checking, but condition is invalid: jump is taken when EAX is greater than 3. Correct condition would be "greater or equal". Doubleclick invalid line and correct condition:

    After you assemble new command, line in Disassembler gets red, indicating that command is modified. Select it again and in the pop-up menu choose the powerful item "Copy to executable file". This applies your modification directly to the executable file:

    All you need is to save modified executable (under different name, of course) and check it. Now the program works correctly! It was easy, isn't it?.. 
    You can download this tutorial and sample program rtrace.exe here.

SQL Server备份恢复 文章目录一、备份1.1 完整备份1.2 差异备份1.3 事务日志备份1.4 文件和文件组备份1.5 关于备份的关注点1.6 三种备份方式对比二、恢复2.1 恢复的3种方式2.2 还原数据库中重点关注2.3 数据恢复 一、备份 1.1 完整备份 1、备份的特点 完整数据库备份表示备份完成时的整个数据库的数据。 备份耗时比较久,备份数据集比较大 备份期间会有一定的IO资源消耗 备份期间,数据库的事务日志不能截断。若数据库变更频繁,很容易导致日志空间不断上涨 完整备份的数据是一份完整的数据库,恢复不需要任何依赖 阅读详情

相关推荐

SQL Server数据库还原差异备份

介绍如何使用 SQL Server Management Studio 或 Transact-SQL 在 SQL Server 中还原差异数据库备份

zxrhhm的博客 2075

ollydbg Run trace

ollydbg Run trace

SQL Server数据库的表级备份

SQL Server management studio不能实现单个表的备份。Litespeed也不行。有一种例外,如果你的表在一个单独的filegroup里,那么就可以单独备份,因为SQL Server支持对单个filegroup的备份。但是显然在大多数情况下,我们的表不满足这个要求。但我们仍然有多种方式备份表。这里说的备份并不是生成一个bak备份文件,仅仅是复制表数据。 1,BCP (BUL

我的学习成长日记 5252

OllyDBG 入门系列(五)-消息断点及 RUN 跟踪

OLLYDBG是一个新的动态追踪工具,将IDA与SoftICE结合起来的思想,Ring 3级调试器,非常容易上手,己代替SoftICE成为当今最为流行的调试解密工具了。同时还支持插件扩展功能,是目前最强大的调试工具。

OD 的 Run Trace

1. Run trace ( 运行跟踪) 可以把被调试程序所执行过的指令保存下来。 2. Run trace 把程序运行过程中所执行指令的地址、寄存器的值、消息等保存到缓冲区中。 如果缓冲区设置过小,则当缓冲区     填满时,最早记录的数据会被覆盖。可在 “Optins / Debug options / Trace” 页中设置。 3. 把Run trace记录的数据保存到文件:在运行 Run ...

LDWJ2016的博客 2105

OD学习笔记2-Run trace /Hit trace

Run trace可以把被调试程序执行过的指令保存下来,了解以前发生的事件,它能把地址、寄存器的内容、消息等记录到Run trace缓冲区中,在运行Run trace前,要把缓冲区设置大些,否则执行的指令太多造成缓冲区溢出: 如果要把Run trace的数据保存到文件,在跟踪之前,打开Run trace窗口,鼠标右击执行Log to file即会弹出个文件保存框 需要运行Run t...

weixin_30764883的博客 342

RunTrace 使用指南

RunTrace 使用指南 项目概述 RunTrace 是一个专为 iOS 开发者设计的实时视图跟踪与分析工具。它通过一个轻量级的接口集成进您的应用中,帮助您无需额外编码即可深入了解应用界面上每个视图的行为和属性变化。该项目托管在 GitHub 上,致力于简化开发者对视图层级、布局调整和状态变更的调试工作。 1. 项目目录结构及介绍 RunTrace/ ├── RunTrace.h ...

gitblog_01103的博客 421

RunTrace 项目常见问题解决方案

RunTrace 项目常见问题解决方案 项目基础介绍和主要编程语言 RunTrace 是一个用于实时跟踪和分析 iOS App 视图的开源工具。该项目的主要目的是帮助 iOS 开发者更轻松地调试和分析 UI 界面,解决常见的视图问题,如视图层次结构、自动布局约束、内存泄漏等。RunTrace 主要使用 Objective-C 编写,适用于 iOS 开发环境。 新手使用注意事项及解决方案 1. 项目...

gitblog_00434的博客 451

利用RunTrace实时跟踪分析iOS App视图

GitHub入口:https://github.com/sx1989827/RunTrace 前言 作为ios的开发者,常常为了UI界面搞得头破血流,你是不是经常遇到这样的痛点:这个view是从哪里来的,它的父视图是什么,它的子视图有哪些,它的frame会发生什么样的变化,它怎么突然隐藏了,它什么时候会被释放掉,对于像自动布局,错误常常如潮水般的涌来,我想动态获取一个view的约束怎么

sx1989827的专栏 1702

SQL Server数据库(自动、手动)备份

SQL Server数据库(自动、手动)备份: 一、为备份文件建一个独立文件夹,方便区分; Win+R,输入services.msc进入服务管理界面查找sqlserver服务,复制此账户后所有用户名; 首先单独建立一个备份文件夹; 给文件夹分配权限 然后粘贴到对象名称空白处; 点击确定后点击高级设置,进入高级权限配置,权限配置到此成功; 二、MS ...

weixin_39758376的博客 9万+

SQL Server 2008/2012 完整数据库备份+差异备份+事务日志备份 数据库备份

文章目录导致数据丢失的原因工作中数据备份恢复中的挑战1. 应该选择什么样的备份策略2. 如何减少备份恢复时间3. 如何将数据库恢复到我想要的时间点?4. 如何迁移数据库系统到一台新机器?备份概述数据备份分类完整数据库备份文件备份部分备份差异备份日志备份事务日志备份最常用的备份方法选择备份策略和恢复模式备份策略简单恢复模式下的备份简单恢复模式下的完整数据库备份+差异数据库备份完整恢复模式下的备份还...

July 1万+

sql server:sqlserver2008数据库的手动本地备份与还原

一、SQL数据库的备份: 1、登录SQLserver2008 → 假设数据库game_db既是我们需要备份的数据库 2、选择要备份的数据库“game_db”,点击鼠标右键 → 任务 → 备份 3、在打开的“备份数据库 — game_db”对话框中,先点击删除,然后再点击“添加” 4、在弹出的“选择备份目标”对话框中: 选择好要备份到哪个路径, 文件类型选择“所有文件” “文件名”那个位置填...

OceanStar的博客 3672

SQL Server数据库的备份还原与删除

实验目的: 1.了解数据库体系结构; 2.学会如何备份还原和删除数据库; 3.学会使用数据库的备份还原和删除的T-SQL语句; 4.理解区分完整备份、差异备份、事务日志备份的不同概念。 实验准备: 1.一台电脑,要求配置:处理器1Ghz以上,RAM 2G以上,硬盘20G以上。 2.软件:SQL Server2014。 3.知识准备:数据库的备份还原与删除章节的理论知识。 实验内容: 1.1完整数据库备份(图形界面) 先分离数据库; 辅助数据库到另一个位置或者U盘; 完成备份的数据

xieailei的博客 3298

SQL数据库备份失败的10大元凶(附高效修复方案)

解决SQL备份恢复难题,总结10大常见故障原因及高效修复方案。涵盖误删数据、日志损坏等典型场景,提供可落地的恢复策略与预防措施,提升数据库可靠性,值得收藏。

CodeNexus的博客 1331

SQL Server数据库定时自动备份

sqlserver 可以通过微软工具SQL Server Management Studio 进行数据库定时自动备份,具体步骤如下: 1,打开SQL Server Management Studio (本例以sqlserver2008 r2为例),打开 作业 2,“作业”文件夹右键点击,出现右键菜单,点击“新建任务” 3,在“新建任务”对话框,常规区域,输入名称(自定义),并选择相关...

a116385895的博客 3556

SQL Server 数据库之备份和恢复数据库

在一些对数据可靠性要求很高的行业,若发生意外停机或数据丢失,其损失是十分惨重的; 数据库管理员应针对具体的业务要求指定详细的数据库备份与灾难恢复策略,并通过模拟故障对每种可能的情况进行严格测试,只有这样才能保证数据的高可用性; 数据库的备份是一个长期过程,而恢复只在发生事故后才能进行,恢复后可看做是备份数据库的逆过程,恢复程度的好坏很大程度上依赖于备份的情况; 数据库管理员在恢复时采取的步骤正确与否也会直接影响最终的恢复结果;备份数据库是指对数据库或事务日志进行复制,当系统,磁盘或数据库文件损坏时,能使用备

m0_67402235的博客 2356

SQL server 数据库备份

备份操作限制 可以在数据库在线并且正在使用时进行备份。但是,存在下列限制。 并发限制 SQL Server可以使用联机备份过程来备份数据库。在备份过程中,可以进行多个操作;例如:在执行备份操作期间允许使用 INSERT、UPDATE 或 DELETE 语句。但是,如果在正在创建或删除数据库文件时尝试启动备份操作,则备份操作将等待,直到创建或删除操作完成或者备份超时。 在数...

banhan7093的博客 592

通过批处理,实现SQL Server数据库定期备份到ftp

@echo offrem --------------------- 配置: ftp上传参数,及本地文件目录(数据库备份的临时目录)-----------------set "PUT_FTP_SERVER=192.168.1.100"set "PUT_FTP_PORT=21"set "PUT_FTP_USERNAME=ftpuser"set "PUT_FTP_PASSWORD=ftppasswd"

小旭的技术博客 4005
上一篇: 数据类型
下一篇: od基础
laogaoAV
博客等级 码龄14年 98粉丝 68原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值