xiaohongshu
xiaohongshu
add-private-function-with-signatures
Add private functions from game DLLs (server.dll/engine.dll) to metamod plugins using signature scanning and symbol lookup. Use when adding new private function hooks that require IDA Pro analysis, signature creation, cross-platform support (Windows/Linux), and runtime function pointer filling.
Full skill instructions
This skill guides the process of adding private functions from game engine DLLs to metamod plugins. It covers IDA Pro analysis, signature creation, function type definition, and runtime hooking for both Windows and Linux platforms.
Use IDA Pro MCP tools to analyze the target function:
# Find the function
mcp__ida-pro-mcp__lookup_funcs("FunctionName")
# Get decompiled code
mcp__ida-pro-mcp__decompile("0xAddress")
# Get disassembly
mcp__ida-pro-mcp__disasm("0xAddress", max_instructions=30)
# Extract signature bytes
mcp__ida-pro-mcp__get_bytes({"addr": "0xAddress", "size": 50})
# Verify signature uniqueness (CRITICAL STEP!)
# Convert bytes to IDA search format (use signature_converter.py script)
python scripts/signature_converter.py spaced "\\x83\\xEC\\x2C\\xA1\\x2A\\x2A\\x2A\\x2A"
# Output: 83 EC 2C A1 ?? ?? ?? ??
# Search in IDA Pro with converted pattern
mcp__ida-pro-mcp__find_bytes("83 EC 2C A1 ?? ?? ?? ?? 33 C4")
# Result should show ONLY ONE match - your target function
# If multiple matches found, extend signature or use more specific bytes
Critical: Always verify signature uniqueness using find_bytes. If the pattern matches multiple functions, the signature is too generic and must be made more specific.
Tip: Use scripts/signature_converter.py to convert between formats:
# Convert C string to IDA format
python scripts/signature_converter.py spaced "\\x83\\xEC\\x2C"
# Convert IDA format to C string
python scripts/signature_converter.py c_string "83 EC 2C"
# Show all formats
python scripts/signature_converter.py all "83EC2C"
Edit fallguys/serverdef.h:
// Function signature from IDA: ReturnType __callingconv FunctionName(params)
typedef ReturnType(CALLING_CONVENTION *fnFunctionName)(ParamTypes);
PRIVATE_FUNCTION_EXTERN(FunctionName);
Calling convention mapping:
SC_SERVER_DECL - fastcall (Windows) / cdecl (Linux), for class methodsSC_SERVER_CDECL - cdecl (both platforms), for C functionsFor new calling conventions, see calling-conventions.md.
Edit fallguys/signatures.h:
Windows signature:
#ifdef _WIN32
#define FunctionName_Signature "\\x83\\xEC\\x2C\\xA1\\x2A\\x2A\\x2A\\x2A..."
Linux signature and symbol:
#else
#define FunctionName_Signature "\\x55\\x57\\x56\\x53\\x83\\xEC\\x5C..."
#define FunctionName_Symbol "_Z23FunctionNameMangledName"
See signature-patterns.md for signature creation guidelines.
Edit fallguys/server_hook.cpp (or relevant .cpp file):
PRIVATE_FUNCTION_DEFINE(ExistingFunction1);
PRIVATE_FUNCTION_DEFINE(ExistingFunction2);
PRIVATE_FUNCTION_DEFINE(FunctionName); // Add new line
This expands to:
fnFunctionName g_pfn_FunctionName;
fnFunctionName g_call_original_FunctionName;
Edit fallguys/meta_api.cpp:
Windows branch:
#ifdef _WIN32
FILL_FROM_SIGNATURE(server, FunctionName);
Linux Sven Co-op 5.16+ branch:
if (CreateInterface("SCServerDLL003", nullptr) != nullptr)
{
FILL_FROM_SIGNATURE(server, FunctionName);
}
Linux Sven Co-op 5.15 branch:
else
{
FILL_FROM_SYMBOL(server, FunctionName);
}
Fill macros:
FILL_FROM_SIGNATURE(module, name) - Scan by signatureFILL_FROM_SYMBOL(module, name) - Lookup by symbolFILL_FROM_SIGNATURED_CALLER_FROM_END(module, name, offset) - Scan caller signatureModule options: server (server.dll/so), engine (hw.dll/so)
Always check pointer before calling:
if (g_pfn_FunctionName)
{
g_pfn_FunctionName(arg1, arg2);
}
Example usage:
ASEXT_RegisterDocInitCallback([](CASDocumentation *pASDoc) {
if (g_pfn_RegisterSCScriptColor24)
{
g_pfn_RegisterSCScriptColor24(pASDoc);
}
});
asext/include/asext_api.hfallguys/serverdef.hfallguys/signatures.hfallguys/signatures.hPRIVATE_FUNCTION_DEFINE in fallguys/server_hook.cppFILL_FROM_SIGNATURE in fallguys/meta_api.cppFILL_FROM_SIGNATURE in fallguys/meta_api.cppFILL_FROM_SYMBOL in fallguys/meta_api.cppasext/include/asext_api.h - Calling convention macrosfallguys/serverdef.h - Function type definitionsfallguys/signatures.h - Signatures and symbolsfallguys/server_hook.cpp - Function pointer definitionsfallguys/meta_api.cpp - Function pointer fillingmetamod/signatures_template.h - Macro definitionsConverts between three signature formats:
\x83\xEC\x2C\xA1\x2A (for code)83 EC 2C A1 ?? (for IDA Pro)83EC2CA12A (compressed)Usage:
# Convert to IDA Pro format
python scripts/signature_converter.py spaced "\x83\xEC\x2C"
# Convert to C string format
python scripts/signature_converter.py c_string "83 EC 2C"
# Show all formats
python scripts/signature_converter.py all "83EC2C"
# Get help
python scripts/signature_converter.py --help
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience