Downloads · 30 days
15
12% of all-time downloads
Keowu/monare-re-qwen25-coder-7b
monare-re-qwen25-coder-7b is a text generation model from Keowu. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as other.
Downloads · 30 days
15
12% of all-time downloads
All-time downloads
130
Public
Repo size
501 MB
Likes
2
Public
Click a slice to open those files.
.safetensors485 MB · 71%
From the Hugging Face model README

Monare RE Qwen2.5-Coder 7B is an experimental reverse-engineering model derived
from Qwen/Qwen2.5-Coder-7B-Instruct. It was fine-tuned with QLoRA to generate
conservative semantic JSON patches from IDA/Hex-Rays-style pseudocode.
The model is intended for binary analysis workflows where stripped binaries
produce decompiler output such as sub_401000, a1, v3, casts, pointer
offsets, and weak type information.
This work is inspired by the ReCopilot research paper:
ReCopilot: Reverse Engineering Copilot in Binary Analysis
arXiv: 2505.16366
https://arxiv.org/abs/2505.16366
This model is not an official ReCopilot release and is not affiliated with the authors of that paper. It follows the same broad idea: training a model on source-code-to-stripped-binary-to-decompiler examples instead of relying only on prompt engineering.
The initial training dataset was built from open-source C/C++ projects. The pipeline used:
open-source C/C++ source
-> debug build with DWARF/symbols
-> stripped binary
-> IDA/Hex-Rays pseudocode export
-> ground-truth extraction from debug metadata
-> supervised fine-tuning JSONL
Current training snapshot:
The dataset focuses on function names, argument names, argument types, and strict JSON output formatting. Struct recovery, data-flow, and richer cross-function context are planned future improvements.
The model is trained to return only valid JSON. A typical output:
{
"function": {
"ea": "0x401230",
"old_name": "sub_401230",
"suggested_name": "aes_cbc_encrypt_buffer",
"confidence": 0.88,
"reason": "Matched stripped decompiler function to debug-symbol ground truth at the same address."
},
"arguments": [
{
"old_name": "a1",
"new_name": "ctx",
"type": "struct AES_ctx *",
"confidence": 0.82
}
],
"locals": [],
"structs": [],
"comments": [],
"warnings": []
}
Use this model for research and assisted reverse engineering tasks such as:
All suggestions should be reviewed by a human reverse engineer before being applied to an analysis database.
This is an early experimental model.
<TASK>recover_semantic_patch</TASK>
<TARGET>
EA: 0x401230
Name: sub_401230
Pseudocode:
...
</TARGET>
<EVIDENCE>
Strings: [...]
Callees: [...]
Callers: [...]
Imports: [...]
Offset accesses: [...]
Data flow: [...]
</EVIDENCE>
<SCHEMA>
{"function":{"ea":"0x401230","old_name":"sub_401230","suggested_name":"","confidence":0.0,"reason":""},"arguments":[],"locals":[],"structs":[],"comments":[],"warnings":[]}
</SCHEMA>
Return only valid JSON. Be conservative. Do not invent facts.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
base = "Qwen/Qwen2.5-Coder-7B-Instruct"
adapter = "Keowu/monare-re-qwen25-coder-7b"
quant_config = BitsAndBytesConfig(load_in_4bit=True)
tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base,
device_map="auto",
quantization_config=quant_config,
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()
import torch
messages = [
{
"role": "system",
"content": """You are a reverse engineering assistant specialized in IDA
Hex-Rays pseudocode. Return only valid JSON. Be conservative."""
},
{
"role": "user",
"content": """
<TASK>recover_semantic_patch</TASK>
<TARGET>
EA: 0x401230
Name: sub_401230
Pseudocode:
int __fastcall sub_401230(__int64 a1, char *a2, unsigned int a3)
{
FILE *v3;
int result;
v3 = fopen(a2, "rb");
if (!v3)
return -1;
result = fread((void *)(a1 + 32), 1u, a3, v3);
fclose(v3);
*(_DWORD *)(a1 + 16) = result;
return result;
}
</TARGET>
<EVIDENCE>
Strings: ["rb"]
Callees: [{"name":"fopen"},{"name":"fread"},{"name":"fclose"}]
Callers: []
Imports: ["fopen","fread","fclose"]
Offset accesses: ["a1 + 32","a1 + 16"]
Data flow: []
</EVIDENCE>
<SCHEMA>
{"function":
{"ea":"0x401230","old_name":"sub_401230","suggested_name":"","confidence":0.0,
"reason":""},"arguments":[],"locals":[],"structs":[],"comments":[],"warnings":
[]}
</SCHEMA>
Return only valid JSON. Be conservative. Do not invent facts."""
}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
outputs = model.generate(
input_ids=inputs,
max_new_tokens=512,
temperature=0.1,
do_sample=False,
eos_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))