Add ImGui GUI, full type extraction, bidirectional packet injection

Major additions:
- ImGui GUI (paralogue_gui.py) with 6 tabs: Packets, Config, Session,
  Wire, Dispatch, Composer. Real-time packet inspector with JSON syntax
  highlighting via imgui_color_text_edit. Modifier toggles with auto-save.
- Full msg_id -> type extraction via Frida GetTypeName() on all 191
  dispatch entries (extract_type_names.js, run_extract_types.py).
  Zero unknowns remaining.
- Bidirectional WireRewriter: C->S rewriter enables packet injection
  without breaking server decrypt counter. Write locks prevent
  interleaved frame corruption.
- Packet injection: replay captured packets or compose custom ones
  from the GUI Composer tab. S->C uses packet_id=0 (push semantics),
  C->S auto-increments.
- Direction enforcement in _emit_decoded: rejects type names whose
  suffix contradicts wire direction, purges stale cache entries.
- Blueprint injection modifier (11xxx range) as separate toggle.
- build_frame() helper for constructing wire frames from msg_id + body.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
MRLokopandClaude Opus 4.6 committed 2026-04-16 02:36:33 -07:00
1 parent 9c3189cac2
commit d7799f51a7
11 files changed
+2292 -61

No files matched your search

+229
View File
@@ -1325,3 +1325,232 @@ frida_hooks\run_mitm.bat --inject-items
# Login, open a single blueprint -> entire experiment range unlocks
# in the client UI.
```
---
## Session 2026-04-16 — full type extraction, GUI, and open questions resolved
### Complete msg_id → type mapping via Frida + GetTypeName()
All 191 dispatch-table entries now have ground-truth protobuf type
names. Resolved via a Frida script (`extract_type_names.js`) that:
1. Walks the dispatch hash table (same as `dispatch_dump.js`).
2. For each entry, reads the **factory pointer** from
`entry + 8` → dereferences to get the factory's **vtable**.
3. Calls **`vtable[2]`** (offset 16) = `New(factory, NULL)` to
heap-allocate a fresh message instance.
4. Calls **`vtable[1]`** (offset 8) = `GetTypeName(this, &out_str)`
on the new message. This is Google protobuf's
`Message::GetTypeName()` which internally calls
`GetMetadata() → Descriptor → full_name()`.
5. Reads the returned MSVC `std::string` (SSO-aware: if capacity < 16
the buffer is inline at offset 0, otherwise a heap pointer).
6. Strips the `"ParalogueNet."` prefix.
The calling convention detail that made this work: vtable slot 1 is
a **thiscall** (`rcx = this`, `rdx = &output_string`), NOT an sret
return. The function writes into the `std::string` pointed to by
`rdx` and returns `rdx`. Passing the args in the wrong order caused
an access violation at offset `0x80` (the internal
`GetMetadata()` call reading vtable slot 16).
The `New()` call (vtable slot 2) takes `(factory, arena)` where
factory = `this` (the default_instance), arena = NULL for heap
allocation. Passing NULL as both arguments caused the factory to
be treated as an arena, which crashed.
Result: `dispatch_type_names.json` with all 191 entries. Persisted
to `known_msg_ids.json` (192 entries total) and
`factory_to_type.json` (191 vtable→name entries).
### Earlier approach: _InternalSerialize string scanning
Before discovering the GetTypeName vtable slot, we tried scanning
each class's `_InternalSerialize` function (vtable slot 10, offset 80)
for RIP-relative LEA instructions referencing field-verification
strings like `"ParalogueNet.PlayerLoginRsp.region_name"`.
This worked for 65 out of 191 types (those with string fields in
their proto schema). The remaining 96 types had no string fields
(numeric-only bodies like `{status: 1}`) so their serializers
contained no string references. Also produced 30 false positives
for `PatreonBoundResultS2C` — trivial response functions sharing a
code path that happened to reference that string.
The GetTypeName approach superseded this by resolving all 191.
### Key corrections from the extraction
| msg_id | old (heuristic/strict) | **ground-truth** |
|---|---|---|
| 1005 | `<unknown>` | **PlayerMainDataReq** |
| 1007 | `KickPlayerS2C` | **PlayerPingReq** |
| 1008 | `PlayerTimeOffsetS2C` | **PlayerPingRsp** |
| 1013 | `KickPlayerS2C` | **GmCodeReq** |
| 1017 | `AchievementEntry` | **GetMailsReq** |
| 1024 | (unpinned) | **PlayerTimeOffsetS2C** |
| 1032 | `RoleDilationUpdateS2C` | **UeGetRoomRsp** |
| 1082 | (unpinned) | **GetAchievementRewardReq** |
| 1200 | `ClothesPresetUpdateS2C` | **RoleAttrUpdateS2C** |
| 1211 | (unpinned) | **RoleDilationUpdateS2C** |
| 1236 | (unpinned) | **KickPlayerS2C** (the real one!) |
The old `KickPlayerS2C` at msg_id 1007 was a long-standing
misidentification — the real KickPlayerS2C is msg_id 1236.
### Direction enforcement in _emit_decoded
Added `_name_direction_mismatch(name, direction)` that rejects
type names whose suffix contradicts the packet's wire direction:
- C->S packets must not be named `*S2C` or `*Rsp`
- S->C packets must not be named `*C2S` or `*Req`
When a mismatch is detected:
1. The stale entry is **purged from `msg_id_cache`** and saved to
disk (preventing re-contamination when other pins trigger a
`save_known_ids` call).
2. The `preferred` hint passed to `identify_body` is cleared.
3. A direction-compatible strict candidate is picked instead.
### UE Dumper-7 data
The project includes a Dumper-7 extraction at
`dumper/Dumped/5.5.4-0+UE5-Paralogue/` with:
- `GObjects-Dump.txt` (110K lines) — all UE objects
- `GObjects-Dump-WithProperties.txt` — with field details
- `CppSDK/` — generated C++ headers
- `Dumpspace/ClassesInfo.json` — 6064 UE classes
Key finding: `UProtobufMessage` (in `ProtobufBlueprintSp` package)
has an `Identify` int32 field at offset 0x28 and a static
`InitIdentifyMap()` function. But protobuf message types are NOT
UE subclasses — they're Google C++ protobuf classes. The
`InitIdentifyMap()` populates a runtime `TMap<int32, UClass*>` at
startup. The Frida GetTypeName approach was more direct than trying
to hook Blueprint byte-code.
### ImGui GUI (`paralogue_gui.py`)
Built a desktop GUI using `imgui_bundle` (Dear ImGui for Python):
**Architecture:**
- Main thread: imgui render loop at ~60fps
- Background daemon thread: asyncio event loop running the proxy
- `SharedState` bridges the two (deque for packets, Lock for config)
- `GUISession(Session)` subclass mirrors data into SharedState
**5 tabs:**
1. **Packets** — real-time table with direction/source filters,
click to expand detail pane with Tree/JSON/Hex sub-tabs.
JSON tab uses `imgui_color_text_edit.TextEditor` with JSON
syntax highlighting and monospace code font.
2. **Config** — per-modifier toggles (card expand, blueprints,
role attrs, items, unlock functions) with parameter sliders.
Auto-saves to `gui_config.json` on change.
3. **Session** — key/nonce, PID, Frida status (color-coded),
proxy ports, dispatch summary, action buttons (Restart Frida,
Launch Game via Steam URL).
4. **Wire** — raw hex traffic with timestamp and direction.
5. **Dispatch** — all 191 entries with msg_id, vtable, type name,
pinned status. Green = resolved, red = unknown.
**Modifier toggles (Config tab):**
- Card Bag Expand — rewrites `CardBagOpenRsp.rets` to 0..2000
- Inject Blueprints — adds 11000..11999 to `BagItemFullS2C`
- Unlock Functions — populates `PlayerMainDataRsp.unlockFunctions`
- Role Attrs Saturate — sets all role `attrs` to 999, `is_unlock=True`
- Inject Bag Items — dense fill across cloth/card/normal ranges
Modifiers **chain** (not first-wins) so multiple modifiers targeting
the same msg_id all run in sequence.
**Frida lifecycle:**
- "Restart Frida" button stops old bridge, clears scripts,
re-attaches to current game PID.
- "Launch Game (Steam)" calls `os.startfile("steam://rungameid/2701680")`.
- Background poller updates PID + Frida status every second.
- `WireRewriter` resets per TCP connection (not per session).
### Protobuf JSON rendering
Packet detail pane now uses `google.protobuf.json_format.MessageToJson()`
for definitive rendering. For a `RoleListFullS2C` body this produces:
```json
{
"status": "StatusCode_OK",
"role_list": {
"curr_role_name": "Galatea",
"roles": [
{
"name": "Celia",
"is_unlock": false,
"worn_clothes": [{"id": 68}],
...
}
]
}
}
```
Previously, nested `Role` messages with string fields were misparsed
as `ClothesColorCell` with packed-int arrays reading
`[71,97,108,97,116,101,97]` = "Galatea" as integers.
The JSON tab uses `imgui_color_text_edit.TextEditor` with
`LanguageDefinitionId.json` for syntax highlighting, rendered with
`imgui_md.get_code_font()` for monospace display.
### Files added or modified this session
| file | change |
|---|---|
| `frida_hooks/paralogue_gui.py` | **new** — full ImGui GUI (~700 lines) |
| `frida_hooks/extract_type_names.js` | **new** — GetTypeName Frida extraction |
| `frida_hooks/dispatch_type_names.json` | **new** — all 191 msg_id→type mappings |
| `frida_hooks/gui_config.json` | **new** — persisted modifier toggles/params |
| `frida_hooks/run_gui.bat` | **new** — GUI launcher |
| `frida_hooks/paralogue_mitm.py` | added `run_with_session()`, `inject_blueprints_modifier`, `_name_direction_mismatch()`, direction enforcement |
| `frida_hooks/paralogue_decoder.py` | no changes this session |
| `frida_hooks/known_msg_ids.json` | updated to 192 entries (all ground-truth) |
| `frida_hooks/factory_to_type.json` | updated to 191 entries (all vtable→name) |
### Remaining open questions
* **Vtable layout documentation**: vtable slot assignments for
Google protobuf `Message` on MSVC x64:
- [0] deleting destructor
- [1] GetTypeName (thiscall, writes into rdx std::string)
- [2] New(this, Arena*)
- [4] IsInitialized
- [5] ... (unclear)
- [8] GetCachedSize
- [9] _InternalParse
- [10] _InternalSerialize
- [16] GetMetadata (called internally by GetTypeName)
Slots 3,5,6,7,11-15 not fully characterized.
* **Client-side item/card DataTable**: the static `UDataTable` asset
that defines valid item/card IDs was not enumerated. Walking it
would let us inject only IDs the client recognizes (eliminating
the silent-filter problem). `GetItemTypeById` (sub_1448A2A70) is
the entry point but the heavy logic is in Blueprint byte-code.
* **`Role.attrs` semantics**: keys 3, 58-69, 72-74 have varied
values per role (e.g., Erika: 65=42, 67=33, 69=84, 72=3300)
but saturating to 999 had no visible UI effect. Likely
achievement/stat counters, not unlock flags.
### Quick-start with GUI
```
cd X:\Users\user\fallendoll
frida_hooks\run_gui.bat
# GUI launches → proxy starts → waits for game
# Launch game via "Launch Game (Steam)" button or Steam client
# Login → packets stream into Packets tab
# Toggle modifiers in Config tab as needed
# Restart Frida after game relaunch via Session tab button
```
+1 -1
View File
@@ -1 +1 @@
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 20000, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20011, 20012, 20013, 20014, 20015,Line truncated
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 11000, 11002, 11004, 11007, 11008, 11011, 11012, 11013, 11014, 11015, 11016, 11019, 11020, 11021, 11022, 11023,Line truncated
+193
View File
@@ -0,0 +1,193 @@
{
"1001": "VerifyLoginTokenReq",
"1002": "VerifyLoginTokenRsp",
"1003": "PlayerLoginReq",
"1004": "PlayerLoginRsp",
"1005": "PlayerMainDataReq",
"1006": "PlayerMainDataRsp",
"1007": "PlayerPingReq",
"1008": "PlayerPingRsp",
"1009": "PlayerOfflineReq",
"1010": "PlayerOfflineRsp",
"1013": "GmCodeReq",
"1014": "GmCodeRsp",
"1017": "GetMailsReq",
"1018": "GetMailsRsp",
"1019": "OperateMailsReq",
"1020": "OperateMailsRsp",
"1022": "ReceiveMailS2C",
"1024": "PlayerTimeOffsetS2C",
"1029": "CreatePayOrderReq",
"1030": "CreatePayOrderRsp",
"1031": "UeGetRoomReq",
"1032": "UeGetRoomRsp",
"1033": "PlayerTestReq",
"1034": "PlayerTestRsp",
"1036": "BagItemFullS2C",
"1038": "BagItemUpdateS2C",
"1040": "WelfareInfoFullS2C",
"1043": "SignInRewardReq",
"1044": "SignInRewardRsp",
"1080": "BpExpChangeS2C",
"1081": "BuyBattlePassReq",
"1082": "BuyBattlePassRsp",
"1083": "BuyBattlePassLvReq",
"1084": "BuyBattlePassLvRsp",
"1087": "SetDefaultBattlePassReq",
"1088": "SetDefaultBattlePassRsp",
"1089": "ClaimBattlePassRewardReq",
"1090": "ClaimBattlePassRewardRsp",
"1094": "BattlePassFullS2C",
"1105": "ReadItemReq",
"1106": "ReadItemRsp",
"1109": "ClothesSavePresetReq",
"1110": "ClothesSavePresetRsp",
"1117": "ClothesEquipPresetReq",
"1118": "ClothesEquipPresetRsp",
"1119": "ClothesEquipReq",
"1120": "ClothesEquipRsp",
"1121": "SetCurTitleRequestReq",
"1122": "SetCurTitleRequestRsp",
"1123": "SetCurRoleReq",
"1124": "SetCurRoleRsp",
"1125": "SetCurHeadReq",
"1126": "SetCurHeadRsp",
"1127": "GetRolesInfoReq",
"1128": "GetRolesInfoRsp",
"1129": "ChooseSexTagReq",
"1130": "ChooseSexTagRsp",
"1131": "SetCurDilationLevelReq",
"1132": "SetCurDilationLevelRsp",
"1133": "GetCurDilationLevelReq",
"1134": "GetCurDilationLevelRsp",
"1135": "AncheatFoundReq",
"1136": "AncheatFoundRsp",
"1137": "RealNameReq",
"1138": "RealNameRsp",
"1139": "GiveRoleGiftReq",
"1140": "GiveRoleGiftRsp",
"1141": "UpgradeRoleFavorLvReq",
"1142": "UpgradeRoleFavorLvRsp",
"1143": "RoleStaminaAutoRecoveryReq",
"1144": "RoleStaminaAutoRecoveryRsp",
"1145": "RoleStaminaAutoRecoveryExReq",
"1146": "RoleStaminaAutoRecoveryExRsp",
"1147": "RoleAnalExpAndVaginalExpInfosReq",
"1148": "RoleAnalExpAndVaginalExpInfosRsp",
"1149": "ClientSettingReq",
"1150": "ClientSettingRsp",
"1153": "GetTaskRewardReq",
"1154": "GetTaskRewardRsp",
"1155": "ReRollTaskReq",
"1156": "ReRollTaskRsp",
"1159": "CommonShopBuyReq",
"1160": "CommonShopBuyRsp",
"1161": "ReadShopReq",
"1162": "ReadShopRsp",
"1163": "RefreshShopReq",
"1164": "RefreshShopRsp",
"1165": "SetInterestForPartsShopItemReq",
"1166": "SetInterestForPartsShopItemRsp",
"1179": "ReadOutfitShopItemReq",
"1180": "ReadOutfitShopItemRsp",
"1181": "TaskUpdateFullS2C",
"1182": "ShopUpdateFullS2C",
"1183": "CardComposeReq",
"1184": "CardComposeRsp",
"1185": "CardLearnReq",
"1186": "CardLearnRsp",
"1190": "CardLearnS2C",
"1192": "CardBagOpenReq",
"1193": "CardBagOpenRsp",
"1194": "LearnCardInfoFullS2C",
"1195": "UseItemReq",
"1196": "UseItemRsp",
"1197": "SanityRewardReq",
"1198": "SanityRewardRsp",
"1200": "RoleAttrUpdateS2C",
"1202": "RoleListFullS2C",
"1206": "SanityFullS2C",
"1207": "PlayerExpLevelFullS2C",
"1208": "TaskStepUpdateS2C",
"1209": "RoleFavorUpdateS2C",
"1210": "RoleStaminaUpdateS2C",
"1211": "RoleDilationUpdateS2C",
"1212": "ClearRoleCurrentSemenReq",
"1213": "ClearRoleCurrentSemenRsp",
"1214": "ClothesPresetUpdateS2C",
"1215": "TouchRoleReq",
"1216": "TouchRoleRsp",
"1217": "LikeGivedReq",
"1218": "LikeGivedRsp",
"1220": "LikeGivedNoticeS2C",
"1221": "WornClothesUpdateS2C",
"1223": "SetRoleAppearanceReq",
"1224": "SetRoleAppearanceRsp",
"1225": "RoleAppearanceUpdateS2C",
"1226": "RoleTodayDanceUpdateS2C",
"1227": "GetOfflineRewardReq",
"1228": "GetOfflineRewardRsp",
"1229": "RoleAppearanceClothesUpdateS2C",
"1230": "OrgasmsHResultS2C",
"1231": "PlayerExpFullS2C",
"1233": "UeCancelRoomEnterReq",
"1234": "UeCancelRoomEnterRsp",
"1236": "KickPlayerS2C",
"1237": "PatreonBoundResultS2C",
"1238": "VerifyLoginTokenExtS2C",
"1239": "GetRoomBusyStatusReq",
"1240": "GetRoomBusyStatusRsp",
"1241": "UeCancelQueueWaitReq",
"1242": "UeCancelQueueWaitRsp",
"1243": "SetClientLanguageReq",
"1244": "SetClientLanguageRsp",
"1245": "GetAchievementRewardReq",
"1246": "GetAchievementRewardRsp",
"1248": "AchievementFullS2C",
"1250": "AchievementStepUpdateS2C",
"1251": "ErrorLogReq",
"1252": "ErrorLogRsp",
"1253": "ClothesModifyColorReq",
"1254": "ClothesModifyColorRsp",
"1255": "RoleClothesColorUpdateS2C",
"701": "UeServerLoginReq",
"702": "UeServerLoginRsp",
"703": "UePlayerLoginReq",
"704": "UePlayerLoginRsp",
"705": "UePlayerLeaveC2S",
"706": "UeSyncPlayerC2S",
"707": "RoomRoleActionChangeC2S",
"709": "RoomPlayerLikeS2C",
"710": "OrgasmsC2S",
"711": "RolePropertyChangeC2S",
"713": "DanceC2S",
"714": "LikeGivedS2C",
"715": "AddPlayerS2C",
"718": "RoomCurrentRoleUpdateS2C",
"719": "RoomRoleAppearanceUpdateS2C",
"720": "RoomWornClothesUpdateS2C",
"721": "RoomRoleAttrUpdateS2C",
"722": "RoomRoleStaminaUpdateS2C",
"723": "DrinkReq",
"724": "DrinkRsp",
"725": "RoomPlayerLevelS2C",
"727": "RoomPlayerMainDataReq",
"728": "RoomPlayerMainDataRsp",
"729": "RoomRoleDilationUpdateS2C",
"730": "RoomSetDilationC2S",
"731": "OrgasmInBedC2S",
"732": "AddTaskStepC2S",
"733": "RoomTaskStepUpdateS2C",
"734": "RoomTodayFavorUpdateS2C",
"735": "UePlayerNetworkStateChangeC2S",
"736": "RoomUseItemS2C",
"737": "RoomDayCardHCountS2C",
"738": "RoomCheckCardReq",
"739": "RoomCheckCardRsp",
"740": "RoomTaskUpdateFullS2C",
"741": "RoomRoleAppearanceClothesUpdateS2C",
"742": "RoomRoleTodayDanceUpdateS2C",
"743": "RoomRoleFavorUpdateS2C",
"744": "RoomKickPlayerS2C",
"745": "RoomRoleClothesColorUpdateS2C"
}
+118
View File
@@ -0,0 +1,118 @@
// extract_type_names.js — call GetTypeName() on every dispatch entry's
// protobuf class to get the full "ParalogueNet.TypeName" string.
//
// Strategy:
// 1. For each dispatch entry, read factory ptr.
// 2. factory[0] = message class vtable.
// 3. Call vtable[2] (New, offset 16) with arena=NULL → fresh msg instance.
// 4. Call vtable[1] (GetTypeName, offset 8) on the instance → std::string.
// 5. Read MSVC std::string layout (inline if cap<16, else heap pointer).
// 6. Destroy via vtable[0] (destructor, offset 0).
(function () {
'use strict';
var MOD = 'Paralogue-Win64-Shipping.exe';
var mod = Process.getModuleByName(MOD);
if (!mod) { send({t:'error',msg:'module not found'}); return; }
var OFF = {
buckets_ptr: 0x98F2D50,
hash_size: 0x98F2D98,
index_heap: 0x98F2D90,
index_inline:0x98F2D88,
};
// Read MSVC std::string from a 32-byte buffer.
function readMsvcString(buf) {
var size = buf.add(16).readU64();
var cap = buf.add(24).readU64();
if (size === 0) return '';
var dataPtr;
if (cap < 16) {
dataPtr = buf; // inline SSO buffer
} else {
dataPtr = buf.readPointer(); // heap pointer
}
try {
return dataPtr.readCString(size);
} catch (e) {
return null;
}
}
function dump() {
var bucketsBase = mod.base.add(OFF.buckets_ptr).readPointer();
var size = mod.base.add(OFF.hash_size).readU32();
var heap = mod.base.add(OFF.index_heap).readPointer();
var indexArr = heap.isNull() ? mod.base.add(OFF.index_inline) : heap;
// Allocate a 32-byte buffer for std::string output.
var strBuf = Memory.alloc(64);
var seen = {};
var results = [];
for (var i = 0; i < size; i++) {
var idx = indexArr.add(i * 4).readS32();
while (idx !== -1 && !seen[idx]) {
seen[idx] = true;
var entry = bucketsBase.add(idx * 32);
var mid = entry.readU32();
var factory = entry.add(8).readPointer();
var typeName = null;
try {
// factory[0] = vtable
var vtbl = factory.readPointer();
// vtable[2] = New(Arena*), offset 16
var newFnPtr = vtbl.add(16).readPointer();
// New(this=factory, arena=NULL) → heap allocation.
var newFn = new NativeFunction(newFnPtr, 'pointer', ['pointer', 'pointer']);
var msg = newFn(factory, ptr(0));
if (msg.isNull()) throw new Error('New returned null');
// The msg has its OWN vtable (could differ from factory vtable).
var msgVtbl = msg.readPointer();
var getNamePtr = msgVtbl.add(8).readPointer();
var getNameFn = new NativeFunction(getNamePtr, 'pointer', ['pointer', 'pointer']);
// Zero the string buffer.
for (var z = 0; z < 32; z++) strBuf.add(z).writeU8(0);
// MSVC sret: rcx=output_string_ptr, rdx=this
// thiscall: rcx=this (msg), rdx=output string
getNameFn(msg, strBuf);
typeName = readMsvcString(strBuf);
// Strip "ParalogueNet." prefix.
if (typeName && typeName.indexOf('ParalogueNet.') === 0) {
typeName = typeName.substring('ParalogueNet.'.length);
}
// Debug: emit first 3 results for inspection.
if (results.length < 3) {
var rawHex = [];
for (var h = 0; h < 32; h++)
rawHex.push(('0'+strBuf.add(h).readU8().toString(16)).slice(-2));
send({t:'debug', msg_id: mid, typeName: typeName,
newFn: newFnPtr.toString(), getNameFn: getNamePtr.toString(),
msgAddr: msg.toString(), msgVtbl: msgVtbl.toString(),
strBufHex: rawHex.join(' ')});
}
} catch (e) {
if (results.length < 3) {
send({t:'debug_err', msg_id: mid, err: e.message});
}
}
results.push({msg_id: mid, vtbl: factory.readPointer().toString(),
type_name: typeName || null});
idx = entry.add(24).readS32();
}
}
send({t: 'type_names', count: results.length, results: results});
}
setTimeout(dump, 2000);
send({t: 'ready', msg: 'extract_type_names (GetTypeName) hook installed'});
})();
+173 -1
View File
@@ -1,21 +1,193 @@
{
"0x148106a38": "SetCurRoleReq",
"0x148106ae8": "CardComposeRsp",
"0x148106b88": "GmCodeRsp",
"0x148106c28": "SetCurRoleRsp",
"0x148106cb8": "PatreonBoundResultS2C",
"0x148106d68": "CardLearnReq",
"0x148106e98": "SetCurHeadReq",
"0x148106f48": "VerifyLoginTokenExtS2C",
"0x148106fd8": "MailBriefData",
"0x148107078": "SetCurHeadRsp",
"0x1481071c8": "GetRoomBusyStatusReq",
"0x148107268": "CardLearnS2C",
"0x1481072f8": "GetRolesInfoReq",
"0x148107448": "GetRoomBusyStatusRsp",
"0x1481074e8": "CardBagOpenReq",
"0x148107578": "UeCancelQueueWaitReq",
"0x1481076b8": "UeCancelQueueWaitReq",
"0x148107768": "ChooseSexTagReq",
"0x1481078a8": "UeCancelQueueWaitRsp",
"0x148107b40": "SetClientLanguageReq",
"0x148107cb8": "SetClientLanguageRsp",
"0x148107eb8": "ChooseSexTagRsp",
"0x1481080a0": "GetAchievementRewardReq",
"0x148108140": "SetCurDilationLevelReq",
"0x148108328": "GetMailsReq",
"0x1481083c8": "GetAchievementRewardRsp",
"0x148108468": "SetCurDilationLevelRsp",
"0x1481085c8": "GetCurDilationLevelReq",
"0x148108658": "AchievementFullS2C",
"0x1481086e8": "GetMailsRsp",
"0x148108838": "GetCurDilationLevelRsp",
"0x1481088c8": "AchievementStepUpdateS2C",
"0x148108988": "AncheatFoundReq",
"0x148108a18": "OperateMailsReq",
"0x148108ab8": "ErrorLogReq",
"0x148108b68": "AncheatFoundRsp",
"0x148108bf8": "OperateMailsRsp",
"0x148108c98": "ErrorLogRsp",
"0x148108df0": "RealNameReq",
"0x148108ea0": "ClothesModifyColorReq",
"0x148108f30": "ClothesModifyColorReq",
"0x148109078": "CardBagOpenRsp",
"0x148109118": "RealNameRsp",
"0x1481091c8": "ClothesModifyColorRsp",
"0x148109258": "PlayerTimeOffsetS2C",
"0x148109458": "RoleClothesColorUpdateS2C",
"0x1481094e8": "CreatePayOrderReq",
"0x148109650": "LearnCardInfoFullS2C",
"0x1481096e0": "CreatePayOrderRsp",
"0x148109828": "GiveRoleGiftReq",
"0x1481098e8": "UseItemReq",
"0x148109978": "GiveRoleGiftRsp",
"0x148109a08": "UeGetRoomReq",
"0x148109ab8": "UseItemRsp",
"0x148109b48": "UpgradeRoleFavorLvReq",
"0x148109bf8": "UeGetRoomRsp",
"0x148109c88": "SanityRewardReq",
"0x148109d28": "UpgradeRoleFavorLvRsp",
"0x148109dd8": "PlayerTestReq",
"0x148109e68": "SanityRewardRsp",
"0x148109f08": "RoleStaminaAutoRecoveryReq",
"0x148109fa8": "PlayerTestRsp",
"0x14810a048": "RoleStaminaAutoRecoveryRsp",
"0x14810a238": "RoleStaminaAutoRecoveryExReq",
"0x14810a380": "RoleAttrUpdateS2C",
"0x14810a420": "RoleStaminaAutoRecoveryExRsp",
"0x14810a580": "RoleAnalExpAndVaginalExpInfosReq",
"0x14810a610": "RoleListFullS2C",
"0x14810a778": "SanityFullS2C",
"0x14810a808": "RoleAnalExpAndVaginalExpInfosRsp",
"0x14810a960": "BagItemFullS2C",
"0x14810a9f0": "PlayerExpLevelFullS2C",
"0x14810ab40": "BagItemUpdateS2C",
"0x14810abe0": "ClientSettingReq",
"0x14810ac70": "TaskStepUpdateS2C",
"0x14810adb0": "SignInRewardReq",
"0x14810ae60": "RoleFavorUpdateS2C",
"0x14810af00": "SignInRewardRsp",
"0x14810afa0": "RoleStaminaUpdateS2C",
"0x14810b040": "BpExpChangeS2C",
"0x14810b0e0": "RoleDilationUpdateS2C",
"0x14810b228": "ClientSettingReq",
"0x14810b2c8": "BuyBattlePassReq",
"0x14810ca40": "ClearRoleCurrentSemenReq",
"0x14810cad0": "ClientSettingRsp",
"0x14810cb70": "BuyBattlePassRsp",
"0x14810cc20": "ClearRoleCurrentSemenRsp",
"0x14810ccb0": "GetTaskRewardReq",
"0x14810cd50": "BuyBattlePassLvReq",
"0x14810ce00": "GetTaskRewardRsp",
"0x14810cea0": "ClothesPresetUpdateS2C",
"0x14810cf30": "BuyBattlePassLvRsp",
"0x14810cfd0": "ReRollTaskReq",
"0x14810d080": "SetDefaultBattlePassReq",
"0x14810d110": "TouchRoleReq",
"0x14810d1d0": "ReRollTaskRsp",
"0x14810d260": "SetDefaultBattlePassRsp",
"0x14810d2f0": "TouchRoleRsp",
"0x14810d3b0": "LikeGivedReq",
"0x14810d440": "CommonShopBuyReq",
"0x14810d4d0": "ClaimBattlePassRewardReq",
"0x14810d570": "LikeGivedRsp",
"0x14810d770": "LikeGivedNoticeS2C",
"0x14810e2c0": "VerifyLoginTokenReq",
"0x14810e418": "CommonShopBuyRsp",
"0x14810e4a8": "WornClothesUpdateS2C",
"0x14810e5f0": "ClaimBattlePassRewardRsp",
"0x14810ebf8": "ReadShopReq",
"0x14810eca8": "VerifyLoginTokenRsp",
"0x14810ed38": "SetRoleAppearanceReq",
"0x14810edc8": "BattlePassFullS2C",
"0x14810ee68": "ReadShopRsp",
"0x148113390": "SetRoleAppearanceRsp",
"0x148113430": "ReadItemReq",
"0x1481134d0": "RefreshShopReq",
"0x148113570": "PlayerLoginReq",
"0x148113610": "ReadItemRsp",
"0x1481136a0": "RoleAppearanceUpdateS2C",
"0x148113750": "RefreshShopRsp",
"0x148113800": "RoleTodayDanceUpdateS2C",
"0x148113890": "ClothesSavePresetReq",
"0x148113920": "PlayerLoginRsp",
"0x1481139c0": "SetInterestForPartsShopItemReq",
"0x148113a60": "GetOfflineRewardReq",
"0x148113b00": "PlayerMainDataReq",
"0x148113ba0": "ClothesSavePresetRsp",
"0x148113c50": "SetInterestForPartsShopItemRsp",
"0x148113ce0": "GetOfflineRewardRsp",
"0x148113d90": "ClothesEquipPresetReq",
"0x148113e40": "ReadOutfitShopItemReq",
"0x148113ed0": "PlayerMainDataRsp",
"0x148113f60": "RoleAppearanceClothesUpdateS2C",
"0x148114000": "ClothesEquipPresetRsp",
"0x1481140c0": "PlayerPingReq",
"0x148114150": "ReadOutfitShopItemRsp",
"0x1481141f0": "OrgasmsHResultS2C",
"0x148114280": "ClothesEquipReq",
"0x148114330": "PlayerTimeOffsetS2C",
"0x148114830": "ShopUpdateFullS2C"
"0x1481143e0": "ClothesEquipRsp",
"0x148114470": "PlayerExpFullS2C",
"0x148114510": "PlayerOfflineReq",
"0x1481145a0": "TaskUpdateFullS2C",
"0x148114640": "UeCancelRoomEnterReq",
"0x1481146e0": "SetCurTitleRequestReq",
"0x148114780": "PlayerOfflineRsp",
"0x148114830": "ShopUpdateFullS2C",
"0x1481148c0": "UeCancelRoomEnterRsp",
"0x148114960": "SetCurTitleRequestRsp",
"0x148114a00": "KickPlayerS2C",
"0x148114ab0": "CardComposeReq",
"0x148114b50": "KickPlayerS2C",
"0x148116ca0": "RoomCurrentRoleUpdateS2C",
"0x148116d40": "RoomRoleAppearanceUpdateS2C",
"0x148116de0": "RoomWornClothesUpdateS2C",
"0x148116fd8": "RoomRoleAttrUpdateS2C",
"0x148117078": "RoomRoleStaminaUpdateS2C",
"0x148117118": "DrinkReq",
"0x1481171b8": "DrinkRsp",
"0x148117258": "RoomPlayerLevelS2C",
"0x1481172f8": "RoomPlayerMainDataReq",
"0x1481174f0": "RoomPlayerMainDataRsp",
"0x148117630": "RoomRoleDilationUpdateS2C",
"0x1481176d0": "RoomSetDilationC2S",
"0x148117770": "OrgasmInBedC2S",
"0x148117810": "AddTaskStepC2S",
"0x1481178b0": "RoomTaskStepUpdateS2C",
"0x148117950": "RoomTodayFavorUpdateS2C",
"0x1481179f0": "RoomUseItemS2C",
"0x148117a90": "RoomUseItemS2C",
"0x1481195f8": "RoomDayCardHCountS2C",
"0x148119698": "RoomCheckCardReq",
"0x148119738": "RoomCheckCardRsp",
"0x1481197d8": "RoomTaskUpdateFullS2C",
"0x148119878": "RoomRoleAppearanceClothesUpdateS2C",
"0x148119fc0": "RoomRoleTodayDanceUpdateS2C",
"0x14811a060": "RoomRoleFavorUpdateS2C",
"0x14811a110": "RoomKickPlayerS2C",
"0x14811a1b0": "UeServerLoginReq",
"0x14811a240": "RoomRoleClothesColorUpdateS2C",
"0x14811a2e0": "UeServerLoginRsp",
"0x14811a380": "UePlayerLoginReq",
"0x14811a578": "UePlayerLoginRsp",
"0x14811a618": "UePlayerLeaveC2S",
"0x14811a6b8": "UeSyncPlayerC2S",
"0x14811a758": "RoomRoleActionChangeC2S",
"0x14811a7f8": "RoomPlayerLikeS2C",
"0x14811a898": "OrgasmsC2S",
"0x14811a938": "RolePropertyChangeC2S",
"0x14811a9d8": "DanceC2S",
"0x14811aa78": "LikeGivedS2C",
"0x14811ac70": "AddPlayerS2C"
}
+170 -39
View File
@@ -1,63 +1,194 @@
{
"1001": "VerifyLoginTokenReq",
"1002": "VerifyLoginTokenRsp",
"1003": "PlayerLoginReq",
"1004": "PlayerLoginRsp",
"1005": "PlayerMainDataReq",
"1006": "PlayerMainDataRsp",
"1007": "KickPlayerS2C",
"1008": "PlayerTimeOffsetS2C",
"1017": "AchievementEntry",
"1018": "AchievementEntry",
"1007": "PlayerPingReq",
"1008": "PlayerPingRsp",
"1009": "PlayerOfflineReq",
"1010": "PlayerOfflineRsp",
"1013": "GmCodeReq",
"1014": "GmCodeRsp",
"1017": "GetMailsReq",
"1018": "GetMailsRsp",
"1019": "OperateMailsReq",
"1020": "OperateMailsRsp",
"1022": "ReceiveMailS2C",
"1024": "PlayerTimeOffsetS2C",
"1029": "CreatePayOrderReq",
"1030": "CreatePayOrderRsp",
"1031": "UeGetRoomReq",
"1032": "RoleDilationUpdateS2C",
"1032": "UeGetRoomRsp",
"1033": "PlayerTestReq",
"1034": "PlayerTestRsp",
"1036": "BagItemFullS2C",
"1038": "AchievementFullS2C",
"1040": "AchievementFullS2C",
"1044": "BattlePassInfo",
"1038": "BagItemUpdateS2C",
"1040": "WelfareInfoFullS2C",
"1043": "SignInRewardReq",
"1044": "SignInRewardRsp",
"1080": "BpExpChangeS2C",
"1089": "AchievementProgress",
"1081": "BuyBattlePassReq",
"1082": "BuyBattlePassRsp",
"1083": "BuyBattlePassLvReq",
"1084": "BuyBattlePassLvRsp",
"1087": "SetDefaultBattlePassReq",
"1088": "SetDefaultBattlePassRsp",
"1089": "ClaimBattlePassRewardReq",
"1090": "ClaimBattlePassRewardRsp",
"1094": "BattlePassFullS2C",
"1105": "AchievementProgress",
"1106": "AchievementEntry",
"1105": "ReadItemReq",
"1106": "ReadItemRsp",
"1109": "ClothesSavePresetReq",
"1110": "ClothesSavePresetRsp",
"1117": "ClothesEquipPresetReq",
"1118": "ClothesEquipPresetRsp",
"1119": "ClothesEquipReq",
"1120": "AchievementEntry",
"1139": "ClothesEquipReq",
"1140": "AchievementProgress",
"1153": "AchievementEntry",
"1154": "AchievementEntry",
"1120": "ClothesEquipRsp",
"1121": "SetCurTitleRequestReq",
"1122": "SetCurTitleRequestRsp",
"1123": "SetCurRoleReq",
"1124": "SetCurRoleRsp",
"1125": "SetCurHeadReq",
"1126": "SetCurHeadRsp",
"1127": "GetRolesInfoReq",
"1128": "GetRolesInfoRsp",
"1129": "ChooseSexTagReq",
"1130": "ChooseSexTagRsp",
"1131": "SetCurDilationLevelReq",
"1132": "SetCurDilationLevelRsp",
"1133": "GetCurDilationLevelReq",
"1134": "GetCurDilationLevelRsp",
"1135": "AncheatFoundReq",
"1136": "AncheatFoundRsp",
"1137": "RealNameReq",
"1138": "RealNameRsp",
"1139": "GiveRoleGiftReq",
"1140": "GiveRoleGiftRsp",
"1141": "UpgradeRoleFavorLvReq",
"1142": "UpgradeRoleFavorLvRsp",
"1143": "RoleStaminaAutoRecoveryReq",
"1144": "RoleStaminaAutoRecoveryRsp",
"1145": "RoleStaminaAutoRecoveryExReq",
"1146": "RoleStaminaAutoRecoveryExRsp",
"1147": "RoleAnalExpAndVaginalExpInfosReq",
"1148": "RoleAnalExpAndVaginalExpInfosRsp",
"1149": "ClientSettingReq",
"1150": "ClientSettingRsp",
"1153": "GetTaskRewardReq",
"1154": "GetTaskRewardRsp",
"1155": "ReRollTaskReq",
"1156": "ReRollTaskRsp",
"1159": "CommonShopBuyReq",
"1160": "AchievementEntry",
"1161": "AchievementEntry",
"1162": "ClothesColorCell",
"1181": "AddPlayerS2C",
"1160": "CommonShopBuyRsp",
"1161": "ReadShopReq",
"1162": "ReadShopRsp",
"1163": "RefreshShopReq",
"1164": "RefreshShopRsp",
"1165": "SetInterestForPartsShopItemReq",
"1166": "SetInterestForPartsShopItemRsp",
"1179": "ReadOutfitShopItemReq",
"1180": "ReadOutfitShopItemRsp",
"1181": "TaskUpdateFullS2C",
"1182": "ShopUpdateFullS2C",
"1183": "CardComposeReq",
"1184": "CardComposeRsp",
"1185": "CardLearnReq",
"1186": "CardLearnRsp",
"1190": "CardLearnS2C",
"1192": "CardBagOpenReq",
"1193": "CardBagOpenRsp",
"1194": "AchievementEntry",
"1198": "BattlePassInfo",
"1200": "ClothesPresetUpdateS2C",
"1194": "LearnCardInfoFullS2C",
"1195": "UseItemReq",
"1196": "UseItemRsp",
"1197": "SanityRewardReq",
"1198": "SanityRewardRsp",
"1200": "RoleAttrUpdateS2C",
"1202": "RoleListFullS2C",
"1206": "BattlePassInfo",
"1208": "AchievementFullS2C",
"1209": "RoleDilationUpdateS2C",
"1210": "PlayerBriefInfo",
"1215": "CachePlayerData",
"1216": "AchievementEntry",
"1221": "ClothesPresetUpdateS2C",
"1206": "SanityFullS2C",
"1207": "PlayerExpLevelFullS2C",
"1208": "TaskStepUpdateS2C",
"1209": "RoleFavorUpdateS2C",
"1210": "RoleStaminaUpdateS2C",
"1211": "RoleDilationUpdateS2C",
"1212": "ClearRoleCurrentSemenReq",
"1213": "ClearRoleCurrentSemenRsp",
"1214": "ClothesPresetUpdateS2C",
"1215": "TouchRoleReq",
"1216": "TouchRoleRsp",
"1217": "LikeGivedReq",
"1218": "LikeGivedRsp",
"1220": "LikeGivedNoticeS2C",
"1221": "WornClothesUpdateS2C",
"1223": "SetRoleAppearanceReq",
"1224": "AchievementEntry",
"1224": "SetRoleAppearanceRsp",
"1225": "RoleAppearanceUpdateS2C",
"1226": "RoleTodayDanceUpdateS2C",
"1227": "GetOfflineRewardReq",
"1228": "GetOfflineRewardRsp",
"1229": "RoleAppearanceClothesUpdateS2C",
"1230": "OrgasmsHResultS2C",
"1231": "BpExpChangeS2C",
"1234": "AchievementEntry",
"1231": "PlayerExpFullS2C",
"1233": "UeCancelRoomEnterReq",
"1234": "UeCancelRoomEnterRsp",
"1236": "KickPlayerS2C",
"1237": "PatreonBoundResultS2C",
"1238": "VerifyLoginTokenExtS2C",
"1239": "CachePlayerData",
"1240": "AchievementEntry",
"1243": "CachePlayerData",
"1244": "AchievementEntry",
"1239": "GetRoomBusyStatusReq",
"1240": "GetRoomBusyStatusRsp",
"1241": "UeCancelQueueWaitReq",
"1242": "UeCancelQueueWaitRsp",
"1243": "SetClientLanguageReq",
"1244": "SetClientLanguageRsp",
"1245": "GetAchievementRewardReq",
"1246": "GetAchievementRewardRsp",
"1248": "AchievementFullS2C",
"1250": "AchievementStepUpdateS2C",
"1251": "ErrorLogReq",
"1252": "ErrorLogRsp",
"1253": "ClothesModifyColorReq",
"1254": "AchievementEntry",
"1254": "ClothesModifyColorRsp",
"1255": "RoleClothesColorUpdateS2C",
"2500": "AchievementFullS2C"
"2500": "AchievementFullS2C",
"701": "UeServerLoginReq",
"702": "UeServerLoginRsp",
"703": "UePlayerLoginReq",
"704": "UePlayerLoginRsp",
"705": "UePlayerLeaveC2S",
"706": "UeSyncPlayerC2S",
"707": "RoomRoleActionChangeC2S",
"709": "RoomPlayerLikeS2C",
"710": "OrgasmsC2S",
"711": "RolePropertyChangeC2S",
"713": "DanceC2S",
"714": "LikeGivedS2C",
"715": "AddPlayerS2C",
"718": "RoomCurrentRoleUpdateS2C",
"719": "RoomRoleAppearanceUpdateS2C",
"720": "RoomWornClothesUpdateS2C",
"721": "RoomRoleAttrUpdateS2C",
"722": "RoomRoleStaminaUpdateS2C",
"723": "DrinkReq",
"724": "DrinkRsp",
"725": "RoomPlayerLevelS2C",
"727": "RoomPlayerMainDataReq",
"728": "RoomPlayerMainDataRsp",
"729": "RoomRoleDilationUpdateS2C",
"730": "RoomSetDilationC2S",
"731": "OrgasmInBedC2S",
"732": "AddTaskStepC2S",
"733": "RoomTaskStepUpdateS2C",
"734": "RoomTodayFavorUpdateS2C",
"735": "UePlayerNetworkStateChangeC2S",
"736": "RoomUseItemS2C",
"737": "RoomDayCardHCountS2C",
"738": "RoomCheckCardReq",
"739": "RoomCheckCardRsp",
"740": "RoomTaskUpdateFullS2C",
"741": "RoomRoleAppearanceClothesUpdateS2C",
"742": "RoomRoleTodayDanceUpdateS2C",
"743": "RoomRoleFavorUpdateS2C",
"744": "RoomKickPlayerS2C",
"745": "RoomRoleClothesColorUpdateS2C"
}
File diff suppressed because it is too large. Load diff
+160 -20
View File
@@ -295,6 +295,38 @@ def expand_card_bag_open_rsp_modifier(msg_id: int, head, body: bytes):
return out
def inject_blueprints_modifier(msg_id: int, head, body: bytes):
"""modify_cb: when BagItemFullS2C (msg_id=1036) passes through,
inject blueprint items in the 11000..11999 range. Blueprints are
lootbox-style Pack items that can be opened via CardBagOpenReq to
grant experiment cards. Client filters against its local ItemTable
so only valid blueprint IDs actually display."""
if msg_id != 1036:
return None
import paralogue_net_full_pb2 as pb
try:
msg = pb.BagItemFullS2C()
msg.MergeFromString(body)
except Exception:
return None
existing = {it.itemId for it in msg.items}
added = 0
for iid in range(11000, 12000):
if iid in existing:
continue
it = msg.items.add()
it.itemId = iid
it.num = 1
added += 1
try:
out = msg.SerializeToString()
except Exception:
return None
print(f" [inject] BagItemFullS2C: +{added} blueprints (11xxx) "
f"(body {len(body)}B -> {len(out)}B)")
return out
def inject_unlock_functions_modifier(msg_id: int, head, body: bytes):
"""modify_cb: for PlayerMainDataRsp (msg_id=1006), populate
unlockFunctions with every uint32 from 1..2000. If experiments are
@@ -438,6 +470,18 @@ REAL_SERVER_IPS = [
]
def _name_direction_mismatch(name: str, direction: str) -> bool:
"""True if a protobuf type name's suffix contradicts the wire direction.
E.g. 'KickPlayerS2C' on a C->S packet, or 'PlayerPingReq' on S->C."""
if direction == "C->S":
if name.endswith("S2C") or name.endswith("Rsp"):
return True
elif direction == "S->C":
if name.endswith("C2S") or name.endswith("Req"):
return True
return False
# ---------------------------------------------------------------------------
# session state
# ---------------------------------------------------------------------------
@@ -510,16 +554,40 @@ class Session:
"S->C": bytearray()}
self._handshake_done: dict[str, bool] = {"C->S": False, "S->C": False}
# S->C rewriter: enabled only when --inject-items is passed. It
# sits on the proxy's forwarding path and can rewrite frames
# before they reach the client.
# S->C rewriter: sits on the proxy's forwarding path and can
# rewrite frames before they reach the client.
self.s2c_rewriter: Optional[WireRewriter] = None
# C->S rewriter: same but for client->server direction. Needed
# for C->S packet injection (without it, injecting breaks the
# server's decrypt counter). In identity mode (no modify_cb),
# output == input due to ChaCha20 XOR involution.
self.c2s_rewriter: Optional[WireRewriter] = None
# Bytes seen post-handshake but before the Frida key capture
# arrived (async timing). Flushed through the cipher in
# record_session_key.
self._wire_pending: dict[str, bytearray] = {"C->S": bytearray(),
"S->C": bytearray()}
# Writer refs for packet injection. Set per TCP connection in
# handle_game_client(), cleared on disconnect.
self.client_writer: Optional[asyncio.StreamWriter] = None
self.server_writer: Optional[asyncio.StreamWriter] = None
# C->S injection cipher — separate from the wire-decryption
# cipher. Tracks the server's expected decrypt counter so
# injected C->S frames are decryptable. Initialized alongside
# other ciphers in record_session_key().
self.c2s_inject_cipher: Optional[WireCipher] = None
self.c2s_bytes_sent: int = 0 # total encrypted C->S bytes forwarded
# Auto-incrementing packet_id for injected frames.
self._inject_packet_id: int = 60000
# Write locks to prevent interleaved writes from pipe() and
# the injection consumer. One per direction.
self.s2c_write_lock: asyncio.Lock = asyncio.Lock()
self.c2s_write_lock: asyncio.Lock = asyncio.Lock()
def close(self) -> None:
for fp in (self._decoded_fp, self._wire_fp, self._chunks_fp,
self._dispatch_fp):
@@ -573,6 +641,8 @@ class Session:
self._wire_s2c_snapshot = self.wire_bytes_s2c
if self.s2c_rewriter is not None:
self.s2c_rewriter.set_key(key, nonce)
if self.c2s_rewriter is not None:
self.c2s_rewriter.set_key(key, nonce)
except Exception as e:
print(f"[!] wire cipher init failed: {e}")
print(f"\n{'='*64}\n SESSION KEY captured (ctx={this_id} flag={flag})\n"
@@ -756,6 +826,10 @@ class Session:
preferred = self.factory_to_type[factory]
if preferred is None:
preferred = self.msg_id_cache.get(mid)
# Don't feed a wrong-direction name as a hint — it biases
# identify_body into picking a type that contradicts the wire.
if preferred and _name_direction_mismatch(preferred, direction):
preferred = None
strict = identify_body_strict(body) if body else []
strict_names = [s[0] for s in strict]
@@ -803,6 +877,28 @@ class Session:
score = max(score, 200)
break
# Final direction sanity: reject names whose suffix contradicts
# the actual wire direction (e.g. *S2C on a C->S packet).
if name and _name_direction_mismatch(name, direction):
# Purge the stale entry from in-memory cache so it never
# gets re-saved to known_msg_ids.json via a different path.
if mid in self.msg_id_cache and self.msg_id_cache[mid] == name:
del self.msg_id_cache[mid]
save_known_ids(self.msg_id_cache)
# Try to find a direction-compatible alternative from strict.
replacement = None
for sn, sm, _ in strict:
if not _name_direction_mismatch(sn, direction):
replacement = (sn, sm)
break
if replacement:
name, parsed = replacement
score = max(score, 200)
else:
name = None
parsed = None
score = 0
if name and not preferred and score >= self.STRONG_SCORE:
self.msg_id_cache[mid] = name
if mid not in self._user_ids:
@@ -860,18 +956,40 @@ class Session:
# asyncio proxy
# ---------------------------------------------------------------------------
def build_frame(msg_id: int, body: bytes, packet_id: int = 0,
seq_id: int = 0, flag: int = 0) -> bytes:
"""Build a wire frame: [2B prefix][PacketHead][body]."""
head = PACKET_HEAD_CLS()
head.msg_id = msg_id
head.body_len = len(body)
head.packet_id = packet_id
head.seq_id = seq_id
head.flag = flag
head_bytes = head.SerializeToString()
prefix = len(head_bytes).to_bytes(2, "big")
return prefix + head_bytes + body
async def pipe(reader, writer, session: Session, direction: str) -> None:
lock = (session.s2c_write_lock if direction == "S->C"
else session.c2s_write_lock)
try:
while True:
data = await reader.read(65536)
if not data:
break
session.log_wire(direction, data)
async with lock:
if direction == "S->C" and session.s2c_rewriter is not None:
out = session.s2c_rewriter.process(data)
if out:
writer.write(out)
await writer.drain()
elif direction == "C->S" and session.c2s_rewriter is not None:
out = session.c2s_rewriter.process(data)
if out:
writer.write(out)
await writer.drain()
else:
writer.write(data)
await writer.drain()
@@ -894,17 +1012,29 @@ async def handle_game_client(reader, writer, session: Session) -> None:
cb = session.s2c_rewriter.modify_cb
session.s2c_rewriter = WireRewriter(modify_cb=cb, label="S->C")
print("[*] s2c_rewriter reset for new connection")
if session.c2s_rewriter is not None:
cb = session.c2s_rewriter.modify_cb
session.c2s_rewriter = WireRewriter(modify_cb=cb, label="C->S")
print("[*] c2s_rewriter reset for new connection")
session.c2s_bytes_sent = 0
try:
sr, sw = await asyncio.open_connection(GAME_SERVER_IP, GAME_PORT)
except Exception as e:
print(f"[!] cannot reach real server: {e}")
writer.close()
return
# Store writer refs for packet injection.
session.client_writer = writer
session.server_writer = sw
try:
await asyncio.gather(
pipe(reader, sw, session, "C->S"),
pipe(sr, writer, session, "S->C"),
return_exceptions=True,
)
finally:
session.client_writer = None
session.server_writer = None
print(f"[-] game client {addr} disconnected")
@@ -1146,23 +1276,12 @@ class FridaBridge:
# main
# ---------------------------------------------------------------------------
async def run(proxy_enabled: bool, decoder_enabled: bool,
inject_items: bool = False) -> None:
ts = int(time.time())
session = Session(ts)
if inject_items:
def combined(msg_id, head, body):
for fn in (expand_card_bag_open_rsp_modifier,
inject_unlock_functions_modifier,
inject_role_attrs_modifier,
inject_items_1_to_2000_modifier):
r = fn(msg_id, head, body)
if r is not None:
return r
return None
session.s2c_rewriter = WireRewriter(modify_cb=combined, label="S->C")
print("[*] S->C rewriter enabled: inject BagItem items "
"+ saturate RoleListFullS2C attrs")
async def run_with_session(session: Session,
proxy_enabled: bool = True,
decoder_enabled: bool = True) -> None:
"""Core event loop: starts proxy servers, attaches Frida, serves
until cancelled. Accepts a pre-built Session so callers (e.g. the
GUI) can subclass Session to intercept data."""
print("=" * 64)
print(" Paralogue MITM (proxy + plaintext decoder)")
@@ -1189,6 +1308,7 @@ async def run(proxy_enabled: bool, decoder_enabled: bool,
loop = asyncio.get_running_loop()
bridge = FridaBridge(session, loop, with_redirect=proxy_enabled)
await bridge.start()
session.bridge = bridge # expose for GUI / callers
print("[*] Ctrl+C to stop\n")
@@ -1221,6 +1341,26 @@ async def run(proxy_enabled: bool, decoder_enabled: bool,
print(f" msg_id mappings: {len(session.msg_id_cache)}")
async def run(proxy_enabled: bool, decoder_enabled: bool,
inject_items: bool = False) -> None:
ts = int(time.time())
session = Session(ts)
if inject_items:
def combined(msg_id, head, body):
for fn in (expand_card_bag_open_rsp_modifier,
inject_unlock_functions_modifier,
inject_role_attrs_modifier,
inject_items_1_to_2000_modifier):
r = fn(msg_id, head, body)
if r is not None:
return r
return None
session.s2c_rewriter = WireRewriter(modify_cb=combined, label="S->C")
print("[*] S->C rewriter enabled: inject BagItem items "
"+ saturate RoleListFullS2C attrs")
await run_with_session(session, proxy_enabled, decoder_enabled)
def main() -> None:
ap = argparse.ArgumentParser(description="Paralogue MITM (proxy + decoder in one)")
ap.add_argument("--no-proxy", action="store_true",
+20
View File
@@ -0,0 +1,20 @@
@echo off
rem run_extract_types.bat - Extract all 191 msg_id -> protobuf type name
rem mappings from the running game via Frida GetTypeName() and save to
rem dispatch_type_names.json + known_msg_ids.json + factory_to_type.json.
rem
rem Run this after game updates to refresh the mapping. The game must be
rem running (attached via Steam). No proxy needed.
rem
rem Usage:
rem run_extract_types.bat
setlocal
set PY=X:\Users\user\AppData\Local\Programs\Python\Python313\python.exe
set SCRIPT_DIR=%~dp0
echo [*] Extracting protobuf type names from running game...
"%PY%" -u "%SCRIPT_DIR%run_extract_types.py"
endlocal
pause
+158
View File
@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""run_extract_types.py — standalone script to extract all msg_id → protobuf
type name mappings from a running game instance via Frida.
Attaches to Paralogue-Win64-Shipping.exe, loads extract_type_names.js,
waits for the dump, and saves results to:
- dispatch_type_names.json (msg_id → type name, ground truth)
- known_msg_ids.json (merged with any existing entries)
- factory_to_type.json (vtable → type name, for runtime pinning)
Run after game updates when RVA offsets may have changed. The game must
be running but does not need to be connected to a server.
Usage:
python run_extract_types.py
"""
import glob
import json
import os
import sys
import time
try:
import frida
except ImportError:
print("[!] frida not installed. Run: pip install frida-tools")
sys.exit(1)
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PROCESS_NAME = "Paralogue-Win64-Shipping.exe"
JS_PATH = os.path.join(SCRIPT_DIR, "extract_type_names.js")
DISPATCH_OUT = os.path.join(SCRIPT_DIR, "dispatch_type_names.json")
KNOWN_IDS_OUT = os.path.join(SCRIPT_DIR, "known_msg_ids.json")
FACTORY_OUT = os.path.join(SCRIPT_DIR, "factory_to_type.json")
def main() -> None:
if not os.path.isfile(JS_PATH):
print(f"[!] {JS_PATH} not found")
sys.exit(1)
with open(JS_PATH, "r", encoding="utf-8") as f:
js_src = f.read()
# Find and attach to the game.
print(f"[*] looking for {PROCESS_NAME} ...")
pid = None
for proc in frida.get_local_device().enumerate_processes():
if proc.name == PROCESS_NAME:
pid = proc.pid
break
if pid is None:
print(f"[!] {PROCESS_NAME} not running. Launch the game first.")
sys.exit(1)
print(f"[*] attaching to PID {pid}")
session = frida.attach(pid)
results: list[dict] = []
errors: list[str] = []
def on_message(msg, data):
payload = msg.get("payload", {})
t = payload.get("t")
if t == "type_names":
results.extend(payload.get("results", []))
elif t == "ready":
print(f"[*] {payload.get('msg', '')}")
elif t == "error" or t == "debug_err":
errors.append(payload.get("msg", "") or payload.get("err", ""))
script = session.create_script(js_src)
script.on("message", on_message)
script.load()
# Wait for the dump (script fires after 2s timeout + processing).
print("[*] waiting for extraction ...")
for _ in range(20):
time.sleep(0.5)
if results:
break
script.unload()
session.detach()
if not results:
print("[!] no results received. Errors:")
for e in errors[:10]:
print(f" {e}")
sys.exit(1)
resolved = [r for r in results if r.get("type_name")]
print(f"[*] total dispatch entries: {len(results)}")
print(f"[*] resolved type names: {len(resolved)}")
if errors:
print(f"[!] {len(errors)} entries had errors (first 5):")
for e in errors[:5]:
print(f" {e}")
# --- Save dispatch_type_names.json ---
full_map = {}
for r in results:
if r.get("type_name"):
full_map[str(r["msg_id"])] = r["type_name"]
with open(DISPATCH_OUT, "w", encoding="utf-8") as f:
json.dump(full_map, f, indent=2, sort_keys=True)
print(f"[*] saved {len(full_map)} entries -> {DISPATCH_OUT}")
# --- Merge into known_msg_ids.json ---
known: dict[str, str] = {}
if os.path.isfile(KNOWN_IDS_OUT):
try:
with open(KNOWN_IDS_OUT, "r", encoding="utf-8") as f:
known = json.load(f)
except Exception:
pass
updated = 0
for mid_s, name in full_map.items():
if known.get(mid_s) != name:
known[mid_s] = name
updated += 1
with open(KNOWN_IDS_OUT, "w", encoding="utf-8") as f:
json.dump(known, f, indent=2, sort_keys=True)
print(f"[*] known_msg_ids.json: {updated} updated, {len(known)} total")
# --- Update factory_to_type.json (vtable → name) ---
ft: dict[str, str] = {}
if os.path.isfile(FACTORY_OUT):
try:
with open(FACTORY_OUT, "r", encoding="utf-8") as f:
ft = json.load(f)
except Exception:
pass
ft_added = 0
for r in results:
vtbl = r.get("vtbl", "")
name = r.get("type_name")
if vtbl and name:
if vtbl not in ft or ft[vtbl] != name:
ft[vtbl] = name
ft_added += 1
with open(FACTORY_OUT, "w", encoding="utf-8") as f:
json.dump(ft, f, indent=2, sort_keys=True)
print(f"[*] factory_to_type.json: {ft_added} updated, {len(ft)} total")
# --- Summary ---
print(f"\n{'='*60}")
print(f" Extraction complete: {len(resolved)}/{len(results)} types resolved")
print(f" Files updated:")
print(f" {DISPATCH_OUT}")
print(f" {KNOWN_IDS_OUT}")
print(f" {FACTORY_OUT}")
print(f"{'='*60}")
if __name__ == "__main__":
main()
+24
View File
@@ -0,0 +1,24 @@
@echo off
rem run_gui.bat - launch the Paralogue MITM GUI.
rem Kills any running paralogue_mitm.py / paralogue_gui.py first.
setlocal
set PY=X:\Users\user\AppData\Local\Programs\Python\Python313\python.exe
set SCRIPT_DIR=%~dp0
echo [*] stopping any running mitm / gui processes ...
for /f "tokens=2 delims=," %%p in ('
wmic process where "name='python.exe' and (CommandLine like '%%paralogue_mitm.py%%' or CommandLine like '%%paralogue_gui.py%%')" get ProcessId /format:csv ^| findstr /r "[0-9]"
') do (
echo killing PID %%p
taskkill /PID %%p /F >nul 2>&1
)
timeout /t 1 /nobreak >nul
echo [*] starting paralogue_gui.py
pushd "%SCRIPT_DIR%\.."
"%PY%" -u frida_hooks\paralogue_gui.py %*
popd
endlocal