搜索
 找回密码
 加入

[1.298] Log GM +commands

Twisted 2011-10-17 07:44:05 1135
Worried about giving your GMs access to commands? Afraid they'll abuse it for their own personal gain? Say no more!

...okay, anyway...
This patch will log all used GM commands (that is, "+commands") to the ChattingLog file (the other commands would be extremely fiddly.. and make the patch a whoooole lot larger).

Find your way to CUser::Chat() and replace:


With a jump to our code-cave:

  1. 00498AA8   .^E9 B4FEFFFF        JMP 00498961
  2. 00498AAD         90                         NOP
  3. 00498AAE         90                         NOP
  4. 00498AAF         90                         NOP
  5. 00498AB0         90                         NOP
  6. 00498AB1         90                         NOP
  7. 00498AB2         90                         NOP
  8. 00498AB3         90                         NOP
复制代码
Woo! Lots of NOPs there. :P

Now go up to our code-cave at 00498961 and assemble this:

  1. 00498961   > 60                         PUSHAD
  2. 00498962         50                         PUSH EAX
  3. 00498963         FFB6 98800000  PUSH DWORD PTR DS:[ESI+8098]
  4. 00498969         68 59894900        PUSH 00498959                                 ;  ASCII "%s: %s"
  5. 0049896E         8D85 DCEBFFFF  LEA EAX,DWORD PTR SS:[EBP-1424]
  6. 00498974         50                         PUSH EAX
  7. 00498975         E8 267D0600        CALL 005006A0
  8. 0049897A         83C4 10                ADD ESP,10
  9. 0049897D         8D85 DCEBFFFF  LEA EAX,DWORD PTR SS:[EBP-1424]
  10. 00498983         8B8E 48870000  MOV ECX,DWORD PTR DS:[ESI+8748]
  11. 00498989         50                         PUSH EAX
  12. 0049898A         E8 61B4F6FF        CALL 00403DF0
  13. 0049898F         61                         POPAD
  14. 00498990         56                         PUSH ESI
  15. 00498991         50                         PUSH EAX
  16. 00498992         E8 3E89F6FF        CALL 004012D5
  17. 00498997         E9 4F080000        JMP 004991EB
复制代码
Next bit is slightly trickier, as it's not a simple "Assemble". We'll have to allocate our formatted string at 00498959.

So, jump to 00498959 and select the following:
  1. 00498959         CC                         INT3
  2. 0049895A         CC                         INT3
  3. 0049895B         CC                         INT3
  4. 0049895C         CC                         INT3
  5. 0049895D         CC                         INT3
  6. 0049895E         CC                         INT3
  7. 0049895F         CC                         INT3
复制代码
Right-click the selected lines, and hit "Binary" -> "Edit".
In ASCII, it is important you type:

%s: %s



Then in the "HEX" box, select the last byte, "CC", and type in 00.

You can see what it should be in the following screenshot, just in case you're confused:
Posted Image

Save Ebenezer, and the patch is done! :)

PS: Just a bit busy too explain what's being done this time, sorry. Back to non-KO stuffs.

0 回复

高级模式
游客