最近在老外网站上又发现了一些好东西。
+ }: y1 C- S. M4 F- q, ^2 M! a" b: L( e! }/ H& R- \& W9 _- e
DLL注入利器Petools是一套关于DLL注入的工具集。 Z$ V7 J# f1 b( ~9 n" R
将在以后的高难度汉化中派上用处。( s- i1 k+ o7 Y& K# C
. P2 o* y7 I( ~) q& l2 }原文
# `0 A' x2 T) o u- B( ^http://comrade.ownz.com/projects/petools.html
0 R& Z [+ L. H }2 s4 x7 ?5 b4 D9 I) q9 m8 X$ t" C
使用方法
. u3 |2 D) F( U i" FInject Tool6 x( u) X- {' ^9 l
Inject is a tool that injects a DLL into a running process. Its command-line usage is as follows: / \+ j o/ f" \- T
) W- h$ [8 ~6 |
Inject C:\hook.dll into pid 1234: inject.exe 1234 C:\hook.dll : k0 q: I4 ^4 Y% k4 C1 W
Inject C:\hook.dll into process notepad.exe (if multiple notepads are running, then whichever one is picked is undefined): inject.exe -p *notepad.exe C:\hook.dll
3 ]: x3 g+ i# H- YInject C:\hook.dll into running process C:\myprogram.exe: inject.exe -p C:\myprogram.exe C:\hook.dll . r2 ^& q3 M& q8 n6 n
Inject C:\hook.dll into process with a window named "Untitled - Notepad": inject.exe -w "Untitled - Notepad" C:\hook.dll
5 B& M8 a& w3 C4 R8 w( `Inject C:\hook.dll into process with a window class Notepad: inject.exe -c Notepad C:\hook.dll 3 `# M! i, |1 k1 Z5 l, z1 ~
Note that in all uses, you should specify the full path to the injected DLL.
- e+ C+ l& O3 o9 \5 x+ @7 g9 S# F, j8 Q3 Y
Loader Tool4 U+ F0 W) p, O3 Y$ x
Loader is a tool that injects a DLL before launching a process. Its command-line usage is as follows: ( h4 L: D$ y' V/ C, x- F1 O
9 ~1 T% H' i- g8 ~: L% ^ G
Load notepad.exe and inject C:\hook.dll into it: loader.exe notepad.exe C:\hook.dll
, h4 K2 H8 h0 wNote that you should specify the full path to the injected DLL.
9 v% _; a2 ]1 j- ` e' j' L u m7 k. x8 Q7 t8 v @
Patch Tool
# D% p, N, x0 q% c$ z2 x$ rPatch is a tool that adds a new section to the executable. The new section becomes the new entrypoint, and contains code to load a particular DLL, and then jump back to the original entrypoint. This can be used to create static patches that behave similar to the Loader tool./ J3 e T: o2 k) v
The tool's command-line usage is as follows:
\6 q5 \, b( X& S9 f0 Y6 X; k- y
Patch original.exe to load C:\hook.dll before execution; save the patched executable to patched.exe: patch.exe original.exe patched.exe C:\hook.dll
% \ N" W, n& r, @3 s9 w! c) Z* H9 a! G, v5 O4 D
Reimport Tool
( D& x& j5 N, GReimport is a tool that redirects certain entries of an executable's import table to another DLL. For example, running reimport.exe game.exe newgame.exe nocd.dll kernel32.dll::GetDriveTypeA kernel32.dll::CreateFileA kernel32.dll::GetVolumeInformation will create a copy of game.exe into newgame.exe, with the above 3 API functions rerouted to nocd.dll, instead of kernel32.dll. That means newgame.exe would import GetDriveTypeA, CreateFileA, and GetVolumeInformation from nocd.dll instead of kernel32.dll. |