close

OPcode 修改

======================
Shutdown
======================

IOPlatformExpert::haltRestart

  1. __text:FFFFFF80006BD100                 push    rbp
  2. __text:FFFFFF80006BD101                 mov     rbp, rsp
  3. __text:FFFFFF80006BD104                 xor     eax, eax
  4. __text:FFFFFF80006BD106                 cmp     esi, 5
  5. __text:FFFFFF80006BD109                 jz      short loc_FFFFFF80006BD141
  6. __text:FFFFFF80006BD10B                 cmp     esi, 3
  7. __text:FFFFFF80006BD10E                 jnz     short loc_FFFFFF80006BD114
  8. __text:FFFFFF80006BD110                 xor     esi, esi
  9. __text:FFFFFF80006BD112                 jmp     short loc_FFFFFF80006BD122
  10. __text:FFFFFF80006BD114 ; ---------------------------------------------------------------------------
  11. __text:FFFFFF80006BD114
  12. __text:FFFFFF80006BD114 loc_FFFFFF80006BD114:                   ; CODE XREF: SACPIPerformShutdown(void)+Ej
  13. __text:FFFFFF80006BD114                 cmp     esi, 2
  14. __text:FFFFFF80006BD117                 jnz     short loc_FFFFFF80006BD122
  15. __text:FFFFFF80006BD119                 nop     dword ptr [rax+00000000h]
  16. __text:FFFFFF80006BD120
  17. __text:FFFFFF80006BD120 loc_FFFFFF80006BD120:                   ; CODE XREF: SACPIPerformShutdown(void):loc_FFFFFF80006BD120j
  18. __text:FFFFFF80006BD120                 jmp     short loc_FFFFFF80006BD120
  19. __text:FFFFFF80006BD122 ; ---------------------------------------------------------------------------
  20. __text:FFFFFF80006BD122
  21. __text:FFFFFF80006BD122 loc_FFFFFF80006BD122:                   ; CODE XREF: SACPIPerformShutdown(void)+12j
  22. __text:FFFFFF80006BD122                                         ; SACPIPerformShutdown(void)+17j
  23. __text:FFFFFF80006BD122                 mov     eax, 0FFFFFFFFh
  24. __text:FFFFFF80006BD127                 mov     rcx, cs:_PE_halt_restart
  25. __text:FFFFFF80006BD12E                 test    rcx, rcx
  26. __text:FFFFFF80006BD131                 jz      short loc_FFFFFF80006BD141
  27. __text:FFFFFF80006BD133                 mov     edi, 1
  28. __text:FFFFFF80006BD138                 cmp     esi, 4
  29. __text:FFFFFF80006BD13B                 cmovnz  edi, esi
  30. __text:FFFFFF80006BD13E                 pop     rbp
  31. __text:FFFFFF80006BD13F                 jmp     rcx
  32. __text:FFFFFF80006BD141 ; ---------------------------------------------------------------------------
  33. __text:FFFFFF80006BD141
  34. __text:FFFFFF80006BD141 loc_FFFFFF80006BD141:                   ; CODE XREF: SACPIPerformShutdown(void)+9j
  35. __text:FFFFFF80006BD141                                         ; SACPIPerformShutdown(void)+31j
  36. __text:FFFFFF80006BD141                 pop     rbp
  37. __text:FFFFFF80006BD142                 retn
复制代码


patch to 004BD100

  1. 55 48 89 E5 31 C0 83 FE 05 74 36 83 FE 03 75 04 31 F6 EB 0E 83 FE 02 75 09 0F 1F 80 00 00 00 00
  2. EB FE B8 FF FF FF FF 48 8B 0D C2 54 24 00 48 85 C9 74 0E BF 01 00 00 00 83 FE 04 0F 45 FE 5D FF
  3. E1 5D C3
复制代码


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


IODTPlatformExpert::haltRestart

  1. __text:FFFFFF80006BD390                 push    rbp
  2. __text:FFFFFF80006BD391                 mov     rbp, rsp
  3. __text:FFFFFF80006BD394                 push    rbx
  4. __text:FFFFFF80006BD395                 push    rax
  5. __text:FFFFFF80006BD396                 mov     ebx, esi
  6. __text:FFFFFF80006BD398                 mov     rdi, [rdi+0E0h]
  7. __text:FFFFFF80006BD39F                 test    rdi, rdi
  8. __text:FFFFFF80006BD3A2                 jz      short loc_FFFFFF80006BD3AD
  9. __text:FFFFFF80006BD3A4                 mov     rax, [rdi]
  10. __text:FFFFFF80006BD3A7                 call    qword ptr [rax+8E8h]
  11. __text:FFFFFF80006BD3AD
  12. __text:FFFFFF80006BD3AD loc_FFFFFF80006BD3AD:                   ; CODE XREF: SACPIPerformReboot(void)+12j
  13. __text:FFFFFF80006BD3AD                 xor     eax, eax
  14. __text:FFFFFF80006BD3AF                 cmp     ebx, 5
  15. __text:FFFFFF80006BD3B2                 jz      short loc_FFFFFF80006BD3F6
  16. __text:FFFFFF80006BD3B4                 cmp     ebx, 3
  17. __text:FFFFFF80006BD3B7                 jnz     short loc_FFFFFF80006BD3BD
  18. __text:FFFFFF80006BD3B9                 xor     ebx, ebx
  19. __text:FFFFFF80006BD3BB                 jmp     short loc_FFFFFF80006BD3D2
  20. __text:FFFFFF80006BD3BD ; ---------------------------------------------------------------------------
  21. __text:FFFFFF80006BD3BD
  22. __text:FFFFFF80006BD3BD loc_FFFFFF80006BD3BD:                   ; CODE XREF: SACPIPerformReboot(void)+27j
  23. __text:FFFFFF80006BD3BD                 cmp     ebx, 2
  24. __text:FFFFFF80006BD3C0                 jnz     short loc_FFFFFF80006BD3D2
  25. __text:FFFFFF80006BD3C2                 db      66h, 66h, 66h, 66h, 2Eh
  26. __text:FFFFFF80006BD3C2                 nop     word ptr [rax+rax+00000000h]
  27. __text:FFFFFF80006BD3D0
  28. __text:FFFFFF80006BD3D0 loc_FFFFFF80006BD3D0:                   ; CODE XREF: SACPIPerformReboot(void):loc_FFFFFF80006BD3D0j
  29. __text:FFFFFF80006BD3D0                 jmp     short loc_FFFFFF80006BD3D0
  30. __text:FFFFFF80006BD3D2 ; ---------------------------------------------------------------------------
  31. __text:FFFFFF80006BD3D2
  32. __text:FFFFFF80006BD3D2 loc_FFFFFF80006BD3D2:                   ; CODE XREF: SACPIPerformReboot(void)+2Bj
  33. __text:FFFFFF80006BD3D2                                         ; SACPIPerformReboot(void)+30j
  34. __text:FFFFFF80006BD3D2                 mov     eax, 0FFFFFFFFh
  35. __text:FFFFFF80006BD3D7                 mov     rcx, cs:_PE_halt_restart
  36. __text:FFFFFF80006BD3DE                 test    rcx, rcx
  37. __text:FFFFFF80006BD3E1                 jz      short loc_FFFFFF80006BD3F6
  38. __text:FFFFFF80006BD3E3                 mov     edi, 1
  39. __text:FFFFFF80006BD3E8                 cmp     ebx, 4
  40. __text:FFFFFF80006BD3EB                 cmovnz  edi, ebx
  41. __text:FFFFFF80006BD3EE                 add     rsp, 8
  42. __text:FFFFFF80006BD3F2                 pop     rbx
  43. __text:FFFFFF80006BD3F3                 pop     rbp
  44. __text:FFFFFF80006BD3F4                 jmp     rcx
  45. __text:FFFFFF80006BD3F6 ; ---------------------------------------------------------------------------
  46. __text:FFFFFF80006BD3F6
  47. __text:FFFFFF80006BD3F6 loc_FFFFFF80006BD3F6:                   ; CODE XREF: SACPIPerformReboot(void)+22j
  48. __text:FFFFFF80006BD3F6                                         ; SACPIPerformReboot(void)+51j
  49. __text:FFFFFF80006BD3F6                 add     rsp, 8
  50. __text:FFFFFF80006BD3FA                 pop     rbx
  51. __text:FFFFFF80006BD3FB                 pop     rbp
  52. __text:FFFFFF80006BD3FC                 retn
复制代码


patch to 004BD390

  1. 55 48 89 E5 53 50 89 F3 48 8B BF E0 00 00 00 48 85 FF 74 09 48 8B 07 FF 90 E8 08 00 00 31 C0 83
  2. FB 05 74 42 83 FB 03 75 04 31 DB EB 15 83 FB 02 75 10 66 66 66 66 66 2E 0F 1F 84 00 00 00 00 00
  3. EB FE B8 FF FF FF FF 48 8B 0D 12 52 24 00 48 85 C9 74 13 BF 01 00 00 00 83 FB 04 0F 45 FB 48 83
  4. C4 08 5B 5D FF E1 48 83 C4 08 5B 5D C3
复制代码



======================
ReBoot
======================
_halt_all_cpus

  1. __text:FFFFFF80006BD145
  2. __text:FFFFFF80006BD145 ; Attributes: bp-based frame
  3. __text:FFFFFF80006BD145
  4. __text:FFFFFF80006BD145 _halt_all_cpus_0 proc near              ; CODE XREF: _halt_all_cpusj
  5. __text:FFFFFF80006BD145                 push    rbp
  6. __text:FFFFFF80006BD146                 mov     rbp, rsp
  7. __text:FFFFFF80006BD149                 push    r15
  8. __text:FFFFFF80006BD14B                 push    r14
  9. __text:FFFFFF80006BD14D                 push    rbx
  10. __text:FFFFFF80006BD14E                 push    rax
  11. __text:FFFFFF80006BD14F                 mov     r14d, edi
  12. __text:FFFFFF80006BD152                 call    sub_FFFFFF80002B84F0
  13. __text:FFFFFF80006BD157                 mov     r15d, eax
  14. __text:FFFFFF80006BD15A                 test    r15d, r15d
  15. __text:FFFFFF80006BD15D                 jz      short loc_FFFFFF80006BD175
  16. __text:FFFFFF80006BD15F                 xor     ebx, ebx
  17. __text:FFFFFF80006BD161                 nop     dword ptr [rax+00h]
  18. __text:FFFFFF80006BD165
  19. __text:FFFFFF80006BD165 loc_FFFFFF80006BD165:                   ; CODE XREF: _halt_all_cpus_0+2Ej
  20. __text:FFFFFF80006BD165                 mov     edi, ebx
  21. __text:FFFFFF80006BD167                 xor     esi, esi
  22. __text:FFFFFF80006BD169                 call    sub_FFFFFF80002EF580
  23. __text:FFFFFF80006BD16E                 inc     ebx
  24. __text:FFFFFF80006BD170                 cmp     r15d, ebx
  25. __text:FFFFFF80006BD173                 jnz     short loc_FFFFFF80006BD165
  26. __text:FFFFFF80006BD175
  27. __text:FFFFFF80006BD175 loc_FFFFFF80006BD175:                   ; CODE XREF: _halt_all_cpus_0+18j
  28. __text:FFFFFF80006BD175                 test    r14d, r14d
  29. __text:FFFFFF80006BD178                 jz      short loc_FFFFFF80006BD199
  30. __text:FFFFFF80006BD17A                 lea     rdi, aMachReboot ; "MACH Reboot\n"
  31. __text:FFFFFF80006BD181                 xor     al, al
  32. __text:FFFFFF80006BD183                 call    _printf
  33. __text:FFFFFF80006BD188                 mov     edi, 1
  34. __text:FFFFFF80006BD18D                 call    _PEHaltRestart
  35. __text:FFFFFF80006BD192                 mov     al, 0FEh
  36. __text:FFFFFF80006BD194                 out     64h, al         ; AT Keyboard controller 8042.
  37. __text:FFFFFF80006BD194                                         ; Resend the last transmission
  38. __text:FFFFFF80006BD196                 hlt
  39. __text:FFFFFF80006BD196 ; ---------------------------------------------------------------------------
  40. __text:FFFFFF80006BD197                 db 0EBh ; ?
  41. __text:FFFFFF80006BD198                 db  1Ch
  42. __text:FFFFFF80006BD199 ; ---------------------------------------------------------------------------
  43. __text:FFFFFF80006BD199
  44. __text:FFFFFF80006BD199 loc_FFFFFF80006BD199:                   ; CODE XREF: _halt_all_cpus_0+33j
  45. __text:FFFFFF80006BD199                 lea     rdi, aCpuHalted ; "CPU halted\n"
  46. __text:FFFFFF80006BD1A0                 xor     al, al
  47. __text:FFFFFF80006BD1A2                 call    _printf
  48. __text:FFFFFF80006BD1A7                 xor     edi, edi
  49. __text:FFFFFF80006BD1A9                 call    _PEHaltRestart
  50. __text:FFFFFF80006BD1AE                 nop     dword ptr [rax+00000000h]
  51. __text:FFFFFF80006BD1B5
  52. __text:FFFFFF80006BD1B5 loc_FFFFFF80006BD1B5:                   ; CODE XREF: _halt_all_cpus_0:loc_FFFFFF80006BD1B5j
  53. __text:FFFFFF80006BD1B5                 jmp     short loc_FFFFFF80006BD1B5
  54. __text:FFFFFF80006BD1B5 _halt_all_cpus_0 endp
  55. __text:FFFFFF80006BD1B5
复制代码


patch to 004BD145

  1. 55 48 89 E5 41 57 41 56 53 50 41 89 FE E8 99 B3 BF FF 41 89 C7 45 85 FF 74 16 31 DB 0F 1F 40 00
  2. 89 DF 31 F6 E8 12 24 C3 FF FF C3 41 39 DF 75 F0 45 85 F6 74 1F 48 8D 3D B3 3D 05 00 30 C0 E8 C8
  3. 33 B7 FF BF 01 00 00 00 E8 BE 0E 00 00 B0 FE E6 64 F4 EB 1C 48 8D 3D A1 3D 05 00 30 C0 E8 A9 33
  4. B7 FF 31 FF E8 A2 0E 00 00 0F 1F 80 00 00 00 00 EB FE 66 66 66 66 66 2E 0F 1F 84 00
复制代码

 

 

arrow
arrow
    文章標籤
    Mac
    全站熱搜

    虎千代 發表在 痞客邦 留言(0) 人氣()