Inject Mode
Inject WPEHook.dll into the target process and hook the WinSock send / receive functions from inside it. This is the capture method closest to the program's own logic; the chapter walks the whole path from picking a target to editing packets.
EasyHook injects the managed assembly into the target → Application.Run(InjectModeForm) runs inside that process → the WPE window appears within the injected program, with LocalHook hooking the send / receive functions of wsock32.dll, ws2_32.dll and mswsock.dll.
When the target is already running and you do not need its start-up traffic, these six steps are the whole procedure.
- Click Inject Mode on the home screen and filter for the target by name in the Process List dialog.
- Click the row to select it — the readout below turns green — then click Inject. The WPE window then appears inside the target program.
- Open Menu → Hook Settings and tick the functions to hook. Everything is on by default; do not trim it down yet.
- When there are too many packets to follow, use Menu → Leach Setting to narrow what is shown by port, length or content.
- Press Start on the toolbar, make the target do something on the network, and packets stream into the list.
- Double-click a row to open Packet Edit, change bytes and press Send to replay. Once the pattern is confirmed, turn it into a Filter.
01 · Picking a target
Clicking Inject Mode on the home screen opens the Process List dialog.
- Filter box: filters by process name as you type — case-insensitive, substring match
- Process table: icon / name / PID / path. Name and PID are sortable by clicking the header, and a single click selects a row
- Selection readout: red border while empty, green once a target is chosen, showing
name [PID] - Pick Window: enters picker mode — hovering any window shows its process, PID, title and path; left-clicking the target selects it and injects immediately; Esc cancels
- Pick Program: choose an
.exethat is not running yet. Injection goes through CreateAndInject — the process is created suspended, then injected — so you can capture from the very first packet - Refresh: clears both boxes and re-enumerates the process list
- Inject: performs the injection. On success the dialog closes and the WPE window appears inside the target
WPE remembers the last process it injected successfully. If that process is running the next time you open the list, it is preselected for you.
Which way to pick
| Method | When to use it | Captures start-up? |
|---|---|---|
| Click in the list | the target is running and you know its name | No |
| Pick Window | you only know which window it is — multiple instances, emulator child windows | No |
| Pick Program | you need login or handshake packets from start-up | Yes |
After injecting via Pick Program the target sits suspended and looks frozen. It only wakes up when you press Start on the toolbar, which calls WakeUpProcess().
02 · The main window
- Sidebar (11 items): Packet List / Filter List / Send List / Robot List / WareHouse List / Statistical Data / Text Comparison / XOR / Transcoding / Extraction / System Log. The green badges are live counts
- Info bar: process name [PID] · main window title and handle · the detected WinSock version · bytes sent and received
- Packet List: the row colour is the filter action — gold for Replace, red for Intercept, blue for Change (see the colour table). Double-click any row to open Packet Edit
- Status bar: total packets / filter executions / Buffer / leached / per-function counters
- Quick list: four tabs — Filter / Send / Robot / WareHouse — so filters can be toggled mid-capture without leaving the list. Double-click a row to open its editor
- Packet data panel: a hex editor for the selected row (Be.Windows.Forms.HexBox), with row, column and bit information along the bottom
- Menu: seven settings drawers that slide in from the right
- Collapse sidebar / theme / display settings / language
If the third segment of the info bar shows only WinSock, without 1.1 / 2.0 / Microsoft after it, the target has not loaded any WinSock module yet — the hooks cannot attach and nothing will be captured. Make the program do something on the network, then inject again.
03 · Starting a capture
- First open Menu → Hook Settings and tick the functions you need (next section). This must be done before pressing Start.
- If needed, narrow the display with Leach Setting.
- Press Start: the hooks go live, and a suspended target is woken at the same moment.
- Make the target do something on the network; packets stream into the list.
- Stop removes every hook and restores the target; Clear empties the queue, the list, the data panel and all counters.
04 · Hook Settings
This decides which hooks get installed, and therefore what can be captured at all.
- Winsock 1.1 (
wsock32.dll): send / sendto / recv / recvfrom - Winsock 2.0 (
ws2_32.dll): send / sendto / recv / recvfrom + WSASend / WSASendTo / WSARecv / WSARecvFrom - Microsoft extension (
mswsock.dll):WSARecvEx, which follows the WSARecv switch - Only the hooks matching the WinSock version that was detected are actually installed
Hooks are created one by one at the moment you press Start. Changing Hook Settings afterwards has no effect — you must Stop, change, then Start again.
05 · Leach Setting (display only)
- Leach method:
Not Displayhides whatever matches;Only Displayshows only what matches - Six conditions, formats in the table below. Ticking one but leaving the box empty is rejected on save
- Packet type: ticking it reveals the type checkboxes — eight on the inject tab, four on the proxy tab
| Condition | Format | Matching |
|---|---|---|
| Socket | 5164;5252 | exact match, ; separated |
| Length | 0-99;100 | ranges and single values |
| IP address | 1.1.1.1;8.8.8.8 | exact match; a hit on either the local or the remote address counts |
| Port | 443;80 | exact match, same rule as above |
| Packet head | 01 00 0A;02 FF | matches the start of the packet |
| Content | 4A 5B;FF FF | substring match anywhere in the packet's hex string |
06 · List Settings
Two tabs — inject and proxy — with ten checkboxes each, controlling which columns the list shows:
No. · Time · Type · Socket · Local address · Local location · Remote address · Remote location · Length · Data
Turning off the two Location columns cuts a lot of overhead during heavy capture — behind them sit a QQWry offline lookup and flag-icon rendering.
07 · Search Packet
- The regular expression box
- What is matched:
Find textsearches the packet decoded as UTF-8;Find hexsearches its formatted hex string — like16 03 01, with spaces - Starting point: from index 0, or continuing from the currently selected row
- Find next: on a hit the list scrolls to that row and the hex editor below highlights the matching bytes. If the offset cannot be located in that row, the search moves on to the next one
Example: to find TLS records starting with 0x16 0x03, choose Find hex and enter ^16 03. When the search finishes with nothing found, WPE reports that no packet matched.
08 · Editing and replaying packets
Double-click a row, or right-click → Edit. This is where hand-editing and replaying actually happens.
- Use socket: defaults to the packet's own socket, and that is what sending uses. Enter
0to go through the SunnyNet channel of Proxy Mode instead (see below) - Hex editor: edit bytes directly. The right-click menu offers Add to Send ▸ / Add to Filter List / Cut / Copy ▸ (text, hex) / Paste ▸ (text, hex) / Select All. Moving the caret updates the progression offset
- Send mode: a fixed number of times, or continuously until you press Stop. An interval of 0 means no pause between sends
- Progression: adds the step to the chosen byte on every send. The
offsetmust be smaller than the packet length or WPE reports an invalid progression offset. Withcarry overticked, an overflow carries into the preceding bytes, up todigitsof them - Live counters: total sent / succeeded / failed
- Send / Stop
- Save: writes the edited content back into that packet in the list — data, length and socket — and refreshes the data panel
Which channel a send goes through
| Condition | How it is sent |
|---|---|
socket > 0 | calls the native send / sendto / WSASend API matching the packet type |
= 0 with type TCP_Req / TCP_Resp | sent to the server or client through the SunnyNet channel |
= 0 with type UDP_* / WebSocket_* | same as above |
= 0 with type HTTP_* / HTTPS_* | cannot be sent — always reports failure |
09 · The packet list right-click menu
| Item | Shortcut | What it does |
|---|---|---|
| Edit | — | opens the Packet Edit window |
| Copy | Ctrl+C | copies the selected rows to the clipboard as hex text, one per line |
| Add to Send ▸ | — | the submenu lists every send item; the selected packets are appended to it |
| Add to Filter List | — | creates a filter from the selected packet, prefilled with its content |
| Add to WareHouse ▸ | — | stores it in the chosen warehouse |
| Set System Socket | — | makes that row's socket the global System Socket |
| View Packet Modification | — | shows the original and the filtered packet side by side |
| Export to Excel | — | exports the selected rows — or all of them — to .xls |
| Add to Text A / Text B | — | sends it to Text Comparison for diffing |
| Select all / deselect | Ctrl+A | — |
Catch the packet → right-click Add to Filter List, which fills the search row for you → double-click the filter to set its action and modify row → switch it on. That is the shortest path from seeing something to changing it.
10 · Comparing original and modified
Right-click → View Packet Modification opens two hex views: the original packet data (length N) on the left and the modified packet data (length M) on the right. Use it to confirm exactly which bytes a filter touched.
11 · Troubleshooting
In order: ① is WPE elevated; ② does the target have anti-cheat or anti-injection protection (if so use Proxy Mode); ③ are WPEHook.dll, EasyHook32/64.dll and EasyLoad32/64.dll all present; ④ was the archive unblocked; ⑤ read the full exception in the System Log.
① Is the WinSock version in the info bar empty; ② are the right functions ticked in Hook Settings (Stop and Start after changing them); ③ a rising Leach counter at the bottom means the display filter is hiding them; ④ is Speed Mode on in System Settings; ⑤ does any filter use the NoModify NoDisplay action.
Expected. CreateAndInject creates the process suspended; pressing Start wakes it up.