iflow-mcp_developermode-korea_reversecore-mcp 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/METADATA +543 -0
  2. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/RECORD +79 -0
  3. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/WHEEL +5 -0
  4. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/entry_points.txt +2 -0
  5. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/licenses/LICENSE +21 -0
  6. iflow_mcp_developermode_korea_reversecore_mcp-1.0.0.dist-info/top_level.txt +1 -0
  7. reversecore_mcp/__init__.py +9 -0
  8. reversecore_mcp/core/__init__.py +78 -0
  9. reversecore_mcp/core/audit.py +101 -0
  10. reversecore_mcp/core/binary_cache.py +138 -0
  11. reversecore_mcp/core/command_spec.py +357 -0
  12. reversecore_mcp/core/config.py +432 -0
  13. reversecore_mcp/core/container.py +288 -0
  14. reversecore_mcp/core/decorators.py +152 -0
  15. reversecore_mcp/core/error_formatting.py +93 -0
  16. reversecore_mcp/core/error_handling.py +142 -0
  17. reversecore_mcp/core/evidence.py +229 -0
  18. reversecore_mcp/core/exceptions.py +296 -0
  19. reversecore_mcp/core/execution.py +240 -0
  20. reversecore_mcp/core/ghidra.py +642 -0
  21. reversecore_mcp/core/ghidra_helper.py +481 -0
  22. reversecore_mcp/core/ghidra_manager.py +234 -0
  23. reversecore_mcp/core/json_utils.py +131 -0
  24. reversecore_mcp/core/loader.py +73 -0
  25. reversecore_mcp/core/logging_config.py +206 -0
  26. reversecore_mcp/core/memory.py +721 -0
  27. reversecore_mcp/core/metrics.py +198 -0
  28. reversecore_mcp/core/mitre_mapper.py +365 -0
  29. reversecore_mcp/core/plugin.py +45 -0
  30. reversecore_mcp/core/r2_helpers.py +404 -0
  31. reversecore_mcp/core/r2_pool.py +403 -0
  32. reversecore_mcp/core/report_generator.py +268 -0
  33. reversecore_mcp/core/resilience.py +252 -0
  34. reversecore_mcp/core/resource_manager.py +169 -0
  35. reversecore_mcp/core/result.py +132 -0
  36. reversecore_mcp/core/security.py +213 -0
  37. reversecore_mcp/core/validators.py +238 -0
  38. reversecore_mcp/dashboard/__init__.py +221 -0
  39. reversecore_mcp/prompts/__init__.py +56 -0
  40. reversecore_mcp/prompts/common.py +24 -0
  41. reversecore_mcp/prompts/game.py +280 -0
  42. reversecore_mcp/prompts/malware.py +1219 -0
  43. reversecore_mcp/prompts/report.py +150 -0
  44. reversecore_mcp/prompts/security.py +136 -0
  45. reversecore_mcp/resources.py +329 -0
  46. reversecore_mcp/server.py +727 -0
  47. reversecore_mcp/tools/__init__.py +49 -0
  48. reversecore_mcp/tools/analysis/__init__.py +74 -0
  49. reversecore_mcp/tools/analysis/capa_tools.py +215 -0
  50. reversecore_mcp/tools/analysis/die_tools.py +180 -0
  51. reversecore_mcp/tools/analysis/diff_tools.py +643 -0
  52. reversecore_mcp/tools/analysis/lief_tools.py +272 -0
  53. reversecore_mcp/tools/analysis/signature_tools.py +591 -0
  54. reversecore_mcp/tools/analysis/static_analysis.py +479 -0
  55. reversecore_mcp/tools/common/__init__.py +58 -0
  56. reversecore_mcp/tools/common/file_operations.py +352 -0
  57. reversecore_mcp/tools/common/memory_tools.py +516 -0
  58. reversecore_mcp/tools/common/patch_explainer.py +230 -0
  59. reversecore_mcp/tools/common/server_tools.py +115 -0
  60. reversecore_mcp/tools/ghidra/__init__.py +19 -0
  61. reversecore_mcp/tools/ghidra/decompilation.py +975 -0
  62. reversecore_mcp/tools/ghidra/ghidra_tools.py +1052 -0
  63. reversecore_mcp/tools/malware/__init__.py +61 -0
  64. reversecore_mcp/tools/malware/adaptive_vaccine.py +579 -0
  65. reversecore_mcp/tools/malware/dormant_detector.py +756 -0
  66. reversecore_mcp/tools/malware/ioc_tools.py +228 -0
  67. reversecore_mcp/tools/malware/vulnerability_hunter.py +519 -0
  68. reversecore_mcp/tools/malware/yara_tools.py +214 -0
  69. reversecore_mcp/tools/patch_explainer.py +19 -0
  70. reversecore_mcp/tools/radare2/__init__.py +13 -0
  71. reversecore_mcp/tools/radare2/r2_analysis.py +972 -0
  72. reversecore_mcp/tools/radare2/r2_session.py +376 -0
  73. reversecore_mcp/tools/radare2/radare2_mcp_tools.py +1183 -0
  74. reversecore_mcp/tools/report/__init__.py +4 -0
  75. reversecore_mcp/tools/report/email.py +82 -0
  76. reversecore_mcp/tools/report/report_mcp_tools.py +344 -0
  77. reversecore_mcp/tools/report/report_tools.py +1076 -0
  78. reversecore_mcp/tools/report/session.py +194 -0
  79. reversecore_mcp/tools/report_tools.py +11 -0
@@ -0,0 +1,56 @@
1
+ """Prompts package for Reversecore MCP Tools."""
2
+
3
+ from fastmcp import FastMCP
4
+
5
+ from reversecore_mcp.prompts.game import game_analysis_mode
6
+ from reversecore_mcp.prompts.malware import (
7
+ apt_hunting_mode,
8
+ basic_analysis_mode,
9
+ c2_extraction_mode,
10
+ code_similarity_mode,
11
+ full_analysis_mode,
12
+ malware_analysis_mode,
13
+ ransomware_triage_mode,
14
+ unpacking_mode,
15
+ vulnerability_hunter_mode,
16
+ )
17
+ from reversecore_mcp.prompts.report import report_generation_mode
18
+ from reversecore_mcp.prompts.security import (
19
+ crypto_analysis_mode,
20
+ firmware_analysis_mode,
21
+ patch_analysis_mode,
22
+ vulnerability_research_mode,
23
+ )
24
+
25
+
26
+ def register_prompts(mcp: FastMCP):
27
+ """
28
+ Registers analysis scenarios (prompts) to the server.
29
+
30
+ This function aggregates prompts from various modules and registers them
31
+ with the FastMCP server instance.
32
+ """
33
+ # Malware Analysis Prompts
34
+ mcp.prompt("full_analysis_mode")(full_analysis_mode)
35
+ mcp.prompt("malware_analysis_mode")(malware_analysis_mode)
36
+ mcp.prompt("basic_analysis_mode")(basic_analysis_mode)
37
+ mcp.prompt("apt_hunting_mode")(apt_hunting_mode)
38
+ mcp.prompt("vulnerability_hunter_mode")(vulnerability_hunter_mode)
39
+
40
+ # NEW: Specialized Malware Prompts
41
+ mcp.prompt("unpacking_mode")(unpacking_mode)
42
+ mcp.prompt("c2_extraction_mode")(c2_extraction_mode)
43
+ mcp.prompt("ransomware_triage_mode")(ransomware_triage_mode)
44
+ mcp.prompt("code_similarity_mode")(code_similarity_mode)
45
+
46
+ # Security Research Prompts
47
+ mcp.prompt("patch_analysis_mode")(patch_analysis_mode)
48
+ mcp.prompt("crypto_analysis_mode")(crypto_analysis_mode)
49
+ mcp.prompt("firmware_analysis_mode")(firmware_analysis_mode)
50
+ mcp.prompt("vulnerability_research_mode")(vulnerability_research_mode)
51
+
52
+ # Game Analysis Prompts
53
+ mcp.prompt("game_analysis_mode")(game_analysis_mode)
54
+
55
+ # Report Generation Prompts
56
+ mcp.prompt("report_generation_mode")(report_generation_mode)
@@ -0,0 +1,24 @@
1
+ """Common constants and rules for prompts."""
2
+
3
+ # Common path rule instruction for Docker environment
4
+ # This constant is included in prompts to guide AI clients on proper file path usage
5
+ DOCKER_PATH_RULE = """
6
+ [CRITICAL: File Path Rule]
7
+ - This server runs in a Docker container with workspace at /app/workspace/
8
+ - When the user provides a full path like "/Users/.../file.exe", extract ONLY the filename
9
+ - Example: "/Users/john/Reversecore_Workspace/sample.exe" → use "sample.exe"
10
+ - First, ALWAYS run `list_workspace()` to verify the file exists in the workspace
11
+ - If the file is not in the workspace, inform the user to copy it there first
12
+
13
+ [CRITICAL: Tool Usage Rule]
14
+ - ALWAYS use `list_workspace()` first to verify files.
15
+ - For disassembly, ALWAYS use `Radare2_disassemble` or `run_radare2`.
16
+ - DO NOT use Capstone tools as they lack file format context (VA/offset).
17
+ - Use `extract_iocs` for automated artifact extraction (IP, URL, BTC, Hashes).
18
+ """
19
+
20
+ LANGUAGE_RULE = """
21
+ [Language Rule]
22
+ - Answer in the same language as the user's request.
23
+ - Keep technical terms (API names, addresses, opcodes) in English.
24
+ """
@@ -0,0 +1,280 @@
1
+ """Prompts for game analysis mode."""
2
+
3
+ from reversecore_mcp.prompts.common import DOCKER_PATH_RULE, LANGUAGE_RULE
4
+
5
+
6
+ def game_analysis_mode(filename: str) -> str:
7
+ """Advanced Game Client Security Analysis with AI-Powered Reasoning."""
8
+ return f"""
9
+ You are an Elite Game Security Researcher with 15+ years of experience in:
10
+ - Reverse engineering AAA game clients (Unity, Unreal, Custom engines)
11
+ - Anti-cheat system analysis and bypass research
12
+ - Game protocol reverse engineering and packet manipulation
13
+ - Memory hacking and game trainer development
14
+ - Online game security architecture design
15
+
16
+ Your mission: Perform a comprehensive security analysis of '{filename}'
17
+ to understand its protection mechanisms, identify vulnerabilities, and
18
+ assess cheat development feasibility.
19
+
20
+ {LANGUAGE_RULE}
21
+
22
+ {DOCKER_PATH_RULE}
23
+
24
+ ═══════════════════════════════════════════════════════════════════════════
25
+ ██ PHASE 1: RECONNAISSANCE & ENGINE IDENTIFICATION ██
26
+ ═══════════════════════════════════════════════════════════════════════════
27
+
28
+ [STEP 1.1] File Intelligence Gathering
29
+ Execute these tools to build a mental model of the target:
30
+
31
+ ```
32
+ run_file("{filename}") # File type & architecture
33
+ parse_binary_with_lief("{filename}") # PE structure, sections, entropy
34
+ run_strings("{filename}", min_length=6) # String artifacts
35
+ ```
36
+
37
+ [REASONING CHECKPOINT 1]
38
+ Before proceeding, answer these questions internally:
39
+ Q1: What game engine is this? (Unity=mono.dll, Unreal=UE4*.dll, Custom=?)
40
+ Q2: Is it packed? (High entropy sections > 7.0?)
41
+ Q3: What's the target platform? (x86/x64/ARM?)
42
+ Q4: Are there obvious protection signatures in strings?
43
+
44
+ ═══════════════════════════════════════════════════════════════════════════
45
+ ██ PHASE 2: PROTECTION MECHANISM ANALYSIS ██
46
+ ═══════════════════════════════════════════════════════════════════════════
47
+
48
+ [STEP 2.1] Anti-Cheat Detection
49
+ ```
50
+ find_cheat_points("{filename}", categories=["speed_hack", "god_mode", "teleport", "item_dupe", "wallhack"])
51
+ ```
52
+
53
+ Analyze the `anticheat_detected` field carefully:
54
+ - GameGuard/nProtect → Korean games, kernel-level protection
55
+ - BattlEye → European games, user+kernel mode
56
+ - EasyAntiCheat → Fortnite-style, cloud-based detection
57
+ - Themida/VMProtect → Code virtualization, hard to analyze
58
+ - Custom → Look for CRC checks, memory scanning loops
59
+
60
+ [STEP 2.2] Hidden Threat Detection (Backdoors in Game Client)
61
+ ```
62
+ dormant_detector("{filename}")
63
+ ```
64
+
65
+ Pay special attention to:
66
+ - Orphan functions with network calls (potential backdoor)
67
+ - Functions with magic value checks (developer backdoors, debug modes)
68
+ - Unreferenced code that accesses sensitive data
69
+
70
+ [REASONING CHECKPOINT 2]
71
+ Think step-by-step:
72
+ 1. What anti-cheat vendor is protecting this game?
73
+ 2. What's the protection level? (Kernel/User/None)
74
+ 3. Are there integrity checks? How frequent?
75
+ 4. Can the protection be bypassed? What's the difficulty?
76
+
77
+ ═══════════════════════════════════════════════════════════════════════════
78
+ ██ PHASE 3: CHEAT VECTOR ANALYSIS ██
79
+ ═══════════════════════════════════════════════════════════════════════════
80
+
81
+ [STEP 3.1] Speed Hack Feasibility
82
+ For each finding in `cheat_points.speed_hack`:
83
+ ```
84
+ analyze_xrefs("{filename}", "<target_address>")
85
+ ```
86
+
87
+ Chain-of-Thought for Speed Hack:
88
+ - Does the game use GetTickCount/QueryPerformanceCounter?
89
+ - Is there a central timing function we can hook?
90
+ - Is time validation server-side or client-side only?
91
+ - Can we manipulate delta-time without detection?
92
+
93
+ [STEP 3.2] God Mode / Damage Hack Analysis
94
+ For each finding in `cheat_points.god_mode`:
95
+ ```
96
+ smart_decompile("{filename}", "<damage_function_address>")
97
+ ```
98
+
99
+ Reasoning Path:
100
+ - Where is damage calculated? (Client → Server validation?)
101
+ - Is there a SetHealth function we can call directly?
102
+ - Can we NOP the damage application?
103
+ - Is damage logged/verified by anti-cheat?
104
+
105
+ [STEP 3.3] Teleport / Position Hack
106
+ For each finding in `cheat_points.teleport`:
107
+ ```
108
+ recover_structures("{filename}", "<position_function>")
109
+ ```
110
+
111
+ Think through:
112
+ - What's the coordinate system? (float/double, world/local)
113
+ - Is position validated server-side?
114
+ - What's the maximum teleport distance before detection?
115
+ - Are there no-clip/fly mode checks?
116
+
117
+ [STEP 3.4] Item Duplication / Economy Hack
118
+ For `cheat_points.item_dupe`:
119
+ - Identify AddItem/SetGold functions
120
+ - Check if quantities are server-authoritative
121
+ - Look for race conditions in transaction handling
122
+
123
+ ═══════════════════════════════════════════════════════════════════════════
124
+ ██ PHASE 4: NETWORK PROTOCOL REVERSE ENGINEERING ██
125
+ ═══════════════════════════════════════════════════════════════════════════
126
+
127
+ [STEP 4.1] Protocol Structure Discovery
128
+ ```
129
+ analyze_game_protocol("{filename}")
130
+ ```
131
+
132
+ Map the packet ecosystem:
133
+ - Identify packet prefix patterns (Pd*, Pu*, CS_*, SC_*)
134
+ - Categorize by function (movement, combat, inventory, social)
135
+ - Find the packet dispatcher/handler table
136
+
137
+ [STEP 4.2] Encryption Analysis
138
+ ```
139
+ analyze_xrefs("{filename}", "send")
140
+ analyze_xrefs("{filename}", "recv")
141
+ ```
142
+
143
+ For each send() caller:
144
+ - What function prepares the packet before sending?
145
+ - Is there encryption? What algorithm?
146
+ - Where is the encryption key stored/generated?
147
+
148
+ For each recv() caller:
149
+ - Where is the packet parsed?
150
+ - How are packet handlers dispatched?
151
+ - Can we inject fake packets?
152
+
153
+ [STEP 4.3] Deep Protocol Analysis (if needed)
154
+ ```
155
+ smart_decompile("{filename}", "<packet_handler_address>")
156
+ ```
157
+
158
+ Questions to answer:
159
+ - What's the packet header format? (size, opcode, checksum?)
160
+ - Is there packet sequence validation?
161
+ - Can we replay packets?
162
+ - What happens if we send malformed packets?
163
+
164
+ [REASONING CHECKPOINT 3]
165
+ Build a mental model of the network layer:
166
+ 1. Client ←→ Server communication flow
167
+ 2. Encryption/Decryption points
168
+ 3. Packet validation mechanisms
169
+ 4. Potential injection/interception points
170
+
171
+ ═══════════════════════════════════════════════════════════════════════════
172
+ ██ PHASE 5: ADVANCED ANALYSIS (IF PROTECTION IS STRONG) ██
173
+ ═══════════════════════════════════════════════════════════════════════════
174
+
175
+ [STEP 5.1] Anti-Cheat Bypass Strategy
176
+ If anti-cheat is detected, analyze its weaknesses:
177
+
178
+ ```
179
+ trace_execution_path("{filename}", "IsDebuggerPresent", max_depth=3)
180
+ trace_execution_path("{filename}", "NtQueryInformationProcess", max_depth=3)
181
+ ```
182
+
183
+ Bypass categories to consider:
184
+ 1. **Timing Window**: Anti-cheat initializes after main() - hook early
185
+ 2. **Driver Level**: Is kernel protection present? Need driver?
186
+ 3. **Signature Evasion**: What signatures does it scan for?
187
+ 4. **Process Isolation**: Can we inject from external process?
188
+
189
+ [STEP 5.2] Obfuscation Handling
190
+ If code is virtualized (Themida/VMProtect):
191
+
192
+ ```
193
+ dormant_detector("{filename}", focus_function="<virtualized_function>")
194
+ ```
195
+
196
+ Strategy:
197
+ - Don't try to devirtualize - too time-consuming
198
+ - Focus on INPUT and OUTPUT of virtualized functions
199
+ - Hook at the boundary, not inside the VM
200
+ - Look for unprotected helper functions
201
+
202
+ ═══════════════════════════════════════════════════════════════════════════
203
+ ██ PHASE 6: SYNTHESIS & EXPERT REPORT ██
204
+ ═══════════════════════════════════════════════════════════════════════════
205
+
206
+ After completing all phases, synthesize your findings into this format:
207
+
208
+ ```markdown
209
+ # 🎮 Game Security Analysis Report
210
+
211
+ ## Executive Summary
212
+ - **Game Engine**: [Unity/Unreal/Custom]
213
+ - **Protection Level**: [None/Low/Medium/High/Extreme]
214
+ - **Anti-Cheat Vendor**: [Name or Custom]
215
+ - **Cheat Development Difficulty**: [Easy/Medium/Hard/Very Hard]
216
+ - **Overall Security Rating**: [A-F grade with justification]
217
+
218
+ ## Protection Mechanisms
219
+ | Mechanism | Present | Bypass Difficulty | Notes |
220
+ |-----------|---------|-------------------|-------|
221
+ | Anti-Debug | Yes/No | Easy/Medium/Hard | ... |
222
+ | Integrity Check | Yes/No | ... | ... |
223
+ | Memory Scan | Yes/No | ... | ... |
224
+ | Kernel Protection | Yes/No | ... | ... |
225
+
226
+ ## Cheat Vectors Analysis
227
+ ### Speed Hack
228
+ - **Feasibility**: [Possible/Impossible]
229
+ - **Target Function**: [address + name]
230
+ - **Method**: [Hook description]
231
+ - **Detection Risk**: [Low/Medium/High]
232
+
233
+ ### God Mode
234
+ [Same structure]
235
+
236
+ ### Teleport
237
+ [Same structure]
238
+
239
+ ### Item Duplication
240
+ [Same structure]
241
+
242
+ ## Network Protocol Summary
243
+ - **Packet Count**: [N packets identified]
244
+ - **Encryption**: [Algorithm or None]
245
+ - **Key Location**: [address if found]
246
+ - **Packet Categories**:
247
+ - Movement: [list]
248
+ - Combat: [list]
249
+ - Inventory: [list]
250
+
251
+ ## Key Offsets & Structures
252
+ | Name | Address | Size | Purpose |
253
+ |------|---------|------|---------|
254
+ | Player Base | 0x... | ... | ... |
255
+ | Health | 0x... | float | ... |
256
+ | Position | 0x... | vec3 | ... |
257
+
258
+ ## Recommended Attack Vectors (Priority Order)
259
+ 1. **[Highest Priority]**: [Description + specific steps]
260
+ 2. **[Second Priority]**: ...
261
+ 3. **[Third Priority]**: ...
262
+
263
+ ## Defense Recommendations (For Game Developers)
264
+ 1. [Specific vulnerability fix]
265
+ 2. [Architecture improvement]
266
+ 3. [Additional protection suggestion]
267
+ ```
268
+
269
+ ═══════════════════════════════════════════════════════════════════════════
270
+ ██ EXECUTION INSTRUCTION ██
271
+ ═══════════════════════════════════════════════════════════════════════════
272
+
273
+ BEGIN ANALYSIS NOW.
274
+
275
+ Execute Phase 1 tools first, then reason through each checkpoint before
276
+ proceeding to the next phase. Show your reasoning at each checkpoint.
277
+
278
+ Remember: You are not just running tools - you are THINKING like an expert
279
+ game hacker. Each tool output should trigger deeper questions and hypotheses.
280
+ """