[1.298] Log GM +commands
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:
00498AA8 .^E9 B4FEFFFF JMP 00498961
00498AAD 90 NOP
00498AAE 90 NOP
00498AAF 90 NOP
00498AB0 90 NOP
00498AB1 90 NOP
00498AB2 90 NOP
00498AB3 90 NOPWoo! Lots of NOPs there. :P
Now go up to our code-cave at 00498961 and assemble this:
00498961 > 60 PUSHAD
00498962 50 PUSH EAX
00498963 FFB6 98800000PUSH DWORD PTR DS:
00498969 68 59894900 PUSH 00498959 ;ASCII "%s: %s"
0049896E 8D85 DCEBFFFFLEA EAX,DWORD PTR SS:
00498974 50 PUSH EAX
00498975 E8 267D0600 CALL 005006A0
0049897A 83C4 10 ADD ESP,10
0049897D 8D85 DCEBFFFFLEA EAX,DWORD PTR SS:
00498983 8B8E 48870000MOV ECX,DWORD PTR DS:
00498989 50 PUSH EAX
0049898A E8 61B4F6FF CALL 00403DF0
0049898F 61 POPAD
00498990 56 PUSH ESI
00498991 50 PUSH EAX
00498992 E8 3E89F6FF CALL 004012D5
00498997 E9 4F080000 JMP 004991EBNext 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:00498959 CC INT3
0049895A CC INT3
0049895B CC INT3
0049895C CC INT3
0049895D CC INT3
0049895E CC INT3
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.
页:
[1]