发新话题
打印

[转载]给Ollydbg的增加实用的快捷键操作功能

[转载]给Ollydbg的增加实用的快捷键操作功能

信息来源:看雪 学院

Ollydbg下载]
新增功能比较大,代码也比较乱,其实一开始应用插件来实现的。;)
感谢heXer,CoDe_Inject给与的帮助与提示!



1.查看数据
push A480033    //如果按回车键,则数据窗口中显示A480033数据,此行按Shift+回车键,即可跳到A480033地址;
mov eax,401000  //此行按回车,则数据窗口中显示401000 数据
mov eax,[401000] //此行按回车,则数据窗口中显示401000 数据
mov [ebp-4], esp //此行按回车,则数据窗口中显示ebp-18的值(注意EIP必须指向当前行)
mov eax, [esp+10]//此行按回车,则数据窗口中显示esp+10的值(注意EIP必须指向当前行)

2.二进制复制/粘贴快捷键
反汇编窗口:Shift+C/Shift+V
数据窗口:Shift+C/Shift+V
注意:数据窗口中,Shift+V时,不必选择块大小,会将剪粘板的数据全部粘贴上去。

3.数据窗口查看数据 (来源于heXer)
数据窗口:
00406000  00 10 40 00 00 00 00 00 00 00 00 00 CA 2E 40 00  .@.........?@.
       ^
       光标移到“00 10 40 00”第一字节00处,按回车,反汇编窗口显示401000;Shift+回车,数据窗口显示401000

4.堆栈窗口 (来源于heXer)
0012FF44  00401D8A  //按回车,反汇编窗口显示0401D8A;Shift+回车,数据窗口显示0401D8A
0012FF48  00000000


5.数据窗口选择数据显示



6.数据窗口切换到代码窗口

00406000  00 12 40 00 00 00 00 00 00 00 00 00 CA 2E 40 00  .@.........?@.
       ^
       光标移到“00 12 40 00”第一字节00处,按Ctrl+双击鼠标,则反汇编窗口显示00406000开始的代码


7.反汇编窗口或数据窗口取当前地址

快捷键:Ctrl+x

例如:
004091C0    push   ebp
004091C1    mov    ebp, esp  
004091C3    push   -1    //此行按快捷键Ctrl+x  ,则将地址004091C3复制到剪粘板里

数据窗口同样操作。
0040DD40  55 8B EC 83 EC 08 53 56 57 55 FC 8B 5D 0C 8B 45  U嬱冹SVWU鼖].婨
       ^
光标移到上面55处,按Ctrl+x ,将地址0040DD40 复制到剪粘板里

8.取数据窗口光标所在字的数据

0040DD40  55 8B EC 83 EC 08 53 56 57 55 FC 8B 5D 0C 8B 45  U嬱冹SVWU鼖].婨
               ^
   光标移到上面EC处,鼠标双击,则将数据565308EC复制到剪粘板里


==================================================================================================

2006-04-20

数据窗口二进制粘贴快捷键的一个bug,这个bug不严重,某些时候也蛮方便的,粘贴时(shift+V)不要选中一块试试就明白了。

原程序:
0044EF87  .  51        push   ecx
0044EF88   - E9 6D021300  jmp    0057F1FA  //跳到补丁代码处


补丁代码:
0057F1FA   6A 10        push   10
0057F1FC   E8 6102F3FF    call   004AF462        //USER32.GetKeyState
0057F201   66:A9 0080    test   ax, 8000
0057F205   74 2F        je    short 0057F236
0057F207   837D 10 43    cmp    dword ptr [ebp+10], 43
0057F20B   75 07        jnz    short 0057F214
0057F20D   BF 76000000    mov    edi, 76
0057F212   EB 1D        jmp    short 0057F231
0057F214   837D 10 56    cmp    dword ptr [ebp+10], 56
0057F218   75 21        jnz    short 0057F23B
0057F21A   BF 77000000    mov    edi, 77
0057F21F   FFB3 85030000  push   dword ptr [ebx+385]
0057F225   8F45 B0      pop    dword ptr [ebp-50]
0057F228   FFB3 89030000  push   dword ptr [ebx+389]  //加上这2行,是选中块的结束地址
0057F22E   8F45 AC      pop    dword ptr [ebp-54]  //
0057F231  - E9 DB21EDFF    jmp    00451411
0057F236   E8 158AF2FF    call   004A7C50
0057F23B  - E9 4DFDECFF    jmp    0044EF8D

==================================================================================================
2006-04-18


1.查看数据
push A480033    //如果按回车键,则数据窗口中显示A480033数据,此行按Shift+回车键,即可跳到A480033地址;
mov eax,401000  //此行按回车,则数据窗口中显示401000 数据
mov eax,[401000] //此行按回车,则数据窗口中显示401000 数据
mov [ebp-4], esp //此行按回车,则数据窗口中显示ebp-18的值(注意EIP必须指向当前行)
mov eax, [esp+10]//此行按回车,则数据窗口中显示esp+10的值(注意EIP必须指向当前行)

2.二进制复制/粘贴快捷键
反汇编窗口:Shift+C/Shift+V
数据窗口:Shift+C/Shift+V

3.数据窗口查看数据 (来源于heXer)
数据窗口:
00406000  00 10 40 00 00 00 00 00 00 00 00 00 CA 2E 40 00  .@.........?@.
       ^
       光标移到“00 10 40 00”第一字节00处,按回车,反汇编窗口显示401000;Shift+回车,数据窗口显示401000

4.堆栈窗口 (来源于heXer)
0012FF44  00401D8A  //按回车,反汇编窗口显示0401D8A;Shift+回车,数据窗口显示0401D8A
0012FF48  00000000



==================================================================================================
2006-04-13

引子:
当修复ASProtect.SKE的SDK和被抽OEP时,经常遇到如下类似代码:
push A480033  
call A500444  //跟踪到这时,需要跳到A480033地址,以前需要按Ctrl+G输入这个地址

今天heXer给了一个很好的提议,当光标在push A480033 一行时,按回车直接跳到A480033 ,操作将会方便多了。

打了这个补丁后:
push A480033  //此行按回车,即可跳到A480033地址
call A500444

刚才heXer改进了我的补丁代码,现在可以实现如下功能:
mov eax,401000 //此行按回车,即可跳到401000 地址
xor eax,401000 //此行按回车,即可跳到401000 地址

根据CCDebuger的建议,0.2新增的功能:
push A480033 //此行按回车键,即可跳到A480033地址;如果按Ctrl+回车键,则数据窗口中显示A480033数据[/B]

根据CodeInject方案,0.3改进后的功能:

push A480033    //如果按回车键,则数据窗口中显示A480033数据,此行按Shift+回车键,即可跳到A480033地址;
mov eax,401000  //此行按回车,则数据窗口中显示401000 数据
mov eax,[401000] //此行按回车,则数据窗口中显示401000 数据




也就是说,只要指令操作数中有常数,并且这个常数是个有效地址时,按回车就可跳到这地址上去。


0041F24C  > \837D 10 0D   cmp    dword ptr [ebp+10], 0D    //判断是否为回车键
0041F250  .  0F85 73010000 jnz    0041F3C9
0041F256  .  837D E4 00   cmp    dword ptr [ebp-1C], 0
0041F25A  .  0F85 69010000 jnz    0041F3C9



0041F309  .  50        push   eax                    ; /Arg7 => 00000000
0041F30A  .  6A 05      push   5                      ; |Arg6 = 00000005
0041F30C  .  52        push   edx                    ; |Arg5
0041F30D  .  8B4D 88     mov    ecx, dword ptr [ebp-78]       ; |
0041F310  .  51        push   ecx                    ; |Arg4
0041F311  .  8D8D 04EEFFFF lea    ecx, dword ptr [ebp-11FC]      ; |
0041F317  .  8B45 BC     mov    eax, dword ptr [ebp-44]       ; |
0041F31A  .  50        push   eax                    ; |Arg3
0041F31B  .  8B55 AC     mov    edx, dword ptr [ebp-54]       ; |
0041F31E  .  52        push   edx                    ; |Arg2
0041F31F  .  51        push   ecx                    ; |Arg1
0041F320  .  E8 236CFFFF  call   _Disasm                  ; \_Disasm
0041F325  .  83C4 1C     add    esp, 1C

参考OD插件帮助文件:
ulong Disasm(char *src,ulong srcsize,ulong srcip,char *srcdec,t_disasm *disasm,int disasmmode,ulong threadid);

重点在t_disasm结构:


代码:--------------------------------------------------------------------------------
typedef struct t_disasm {      // Results of disassembling
  ulong    ip;             // (*) Instrucion pointer
  char    dump[TEXTLEN];    // Hexadecimal dump of the command            
  char    result[TEXTLEN];   // Disassembled command
  char    comment[TEXTLEN];  // Brief comment
  char    opinfo[3][TEXTLEN]; // Comments to command's operands
  int     cmdtype;          // (*) One of C_xxx
  int     memtype;          // (*) Type of addressed variable in memory

  int     nprefix;          // (*) Number of prefixes
  int     indexed;          // Address contains register(s)
  ulong    jmpconst;         // (*) Constant jump address
  ulong    jmptable;         // (*) Possible address of switch table
  ulong    adrconst;         // (*) Constant part of address             //如果是mov eax,[401000],则401000在[ebp-1640]
  ulong    immconst;         // (*) Immediate constant                 //如果是push xxxxx ,则常数xxxxx放在此,即[ebp-163C]
  int     zeroconst;        // (*) Whether contains zero constant
  int     fixupoffset;       // (*) Possible offset of 32-bit fixups

  int     fixupsize;        // (*) Possible total size of fixups or 0
  ulong    jmpaddr;          // Destination of jump/call/return           //如果是Jump/call xxxx 此结构中放的是地址xxxx,即[ebp-162C]
  int     condition;        // 0xFF:unconditional, 0:false, 1:true
  int     error;           // (*) Error while disassembling command
  int     warnings;         // (*) Combination of DAW_xxx
  int     optype[3];        // Type of operand (extended set DEC_xxx)
  int     opsize[3];        // Size of operand, bytes

  int     opgood[3];        // Whether address and data valid
  ulong    opaddr[3];        // Address if memory, index if register
  ulong    opdata[3];        // Actual value (only integer operands)
  t_operand op[3];           // Full description of operand
  ulong    regdata[8];        // Registers after command is executed
  int     regstatus[8];      // Status of registers, one of RST_xxx
  ulong    addrdata;         // Traced memory address

  int     addrstatus;        // Status of addrdata, one of RST_xxx
  ulong    regstack[NREGSTACK];  // Stack tracing buffer
  int     rststatus[NREGSTACK]; // Status of stack items
  int     nregstack;        // Number of items in stack trace buffer
  ulong    reserved[29];      // Reserved for plugin compatibility
} t_disasm;
--------------------------------------------------------------------------------



补丁代码:
原程序修改:
0041F320    E8 236CFFFF      call   _Disasm                  ; \_Disasm
0041F325    E9 98040900      jmp    0004AF646
0041F32A    90            nop
0041F32B    837D A4 00       cmp    dword ptr [ebp-5C], 0

补丁代码:
004AF646    83BD D4E9FFFF>cmp    dword ptr [ebp-162C], 0
004AF64D    75 3C      jnz    short 004AF68B
004AF64F    60        pushad
004AF650    68 00000100  push   10000                  
004AF655    6A 00      push   0
004AF657    83BD C0E9FFFF>cmp    dword ptr [ebp-1640], 0
004AF65E    74 08      je    short 004AF668
004AF660    FFB5 C0E9FFFF push   dword ptr [ebp-1640]
004AF666    EB 0C      jmp    short 004AF674
004AF668    837D E8 00   cmp    dword ptr [ebp-18], 0
004AF66C    75 0A      jnz    short 004AF678
004AF66E    FFB5 C4E9FFFF push   dword ptr [ebp-163C]
004AF674    6A 00      push   0
004AF676    EB 08      jmp    short 004AF680
004AF678    6A 00      push   0
004AF67A    FFB5 C4E9FFFF push   dword ptr [ebp-163C]
004AF680    6A 00      push   0
004AF682              call   0042D618 //call   _Setcpu
004AF687    83C4 14     add    esp, 14
004AF68A    61        popad
004AF68B    83C4 1C     add    esp, 1C
004AF68E    8945 A4     mov    dword ptr [ebp-5C], eax
004AF691   ^ E9 95FCF6FF  jmp    0041F32B

TOP

发新话题