You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
move function-name feature matching to insn scope #3125
function-name features presently match at file scope which prevents detection like "function A calls function-name C then function-name D". Changing function-name features to match at the insn scope would also align with api matching.
today we coerce recognized called names into api features. for example, when flirt matches, we use the recovered name as an api feature. is this sufficient for you?
i thought that maybe we already emit function-name at function scope to indicate the name of the current function, so we could say "strcpy that calls GetProcAddress" but our documentation doesn't mention it.
For context, I submitted this issue on behalf of another. Their goal is to isolate functions in large binaries where the binaries contain mostly statically linked code. e.g., function A downloads a payload and decrypts it, where the decryption function is statically linked and therefore, AFAIK, can only be matched using the function-name feature, if extracted. However, since function-name features are file scoped, capa does not currently support this goal.
today we coerce recognized called names into api features.
Can you explain this more? Is this something handled by capa core? Or is it the responsibility of the extractors to emit both api and function-name features for recovered names? e.g., the BinExport feature extractor only emits function-name features:
e.g., the BinExport feature extractor only emits function-name features
ah, this is just what i was looking for! note that this feature is emitted at function scope. it is meant to convey: "we believe the name of this function is 'foo'". it is not meant to indicate one function calls another - that is the API feature.
(we need to update the capa rules doc to explain this case, and clarify this consideration).
Is this something handled by capa core? Or is it the responsibility of the extractors to emit both api and function-name features for recovered names?
It's the responsibility of the extractor to emit API features if it knows the name of callees. capa core doesn't do any magic to map callee names or interpret the call graph.
e.g., the BinExport feature extractor only emits function-name features
ah, this is just what i was looking for! note that this feature is emitted at function scope. it is meant to convey: "we believe the name of this function is 'foo'". it is not meant to indicate one function calls another - that is the API feature.
(we need to update the capa rules doc to explain this case, and clarify this consideration).
Agreed, we need to update the documentation to convey the intention of function-name features and how they differ from api features. We'll then likely need to update the extractors to follow what is documented.
Activity
williballenthin commentedon Jul 14, 2026
today we coerce recognized called names into api features. for example, when flirt matches, we use the recovered name as an api feature. is this sufficient for you?
i thought that maybe we already emit function-name at function scope to indicate the name of the current function, so we could say "strcpy that calls GetProcAddress" but our documentation doesn't mention it.
can you walk through your idea a little more?
mike-hunhoff commentedon Jul 15, 2026
For context, I submitted this issue on behalf of another. Their goal is to isolate functions in large binaries where the binaries contain mostly statically linked code. e.g., function A downloads a payload and decrypts it, where the decryption function is statically linked and therefore, AFAIK, can only be matched using the
function-namefeature, if extracted. However, sincefunction-namefeatures arefilescoped, capa does not currently support this goal.today we coerce recognized called names into api features.
Can you explain this more? Is this something handled by capa core? Or is it the responsibility of the extractors to emit both
apiandfunction-namefeatures for recovered names? e.g., the BinExport feature extractor only emitsfunction-namefeatures:capa/capa/features/extractors/binexport2/function.py
Lines 69 to 70 in 30f9378
abhinav-phi commentedon Jul 15, 2026
williballenthin commentedon Jul 15, 2026
capa/capa/features/extractors/ida/insn.py
Line 135 in 30f9378
here we take the recognized name of a callee, such as via FLIRT, and emit it as an API feature.
williballenthin commentedon Jul 15, 2026
ah, this is just what i was looking for! note that this feature is emitted at function scope. it is meant to convey: "we believe the name of this function is 'foo'". it is not meant to indicate one function calls another - that is the API feature.
(we need to update the capa rules doc to explain this case, and clarify this consideration).
williballenthin commentedon Jul 15, 2026
It's the responsibility of the extractor to emit API features if it knows the name of callees. capa core doesn't do any magic to map callee names or interpret the call graph.
mike-hunhoff commentedon Jul 16, 2026
Hmmm so it looks like the IDA feature extractor is already emitting
function-namefeatures at the instruction scopecapa/capa/features/extractors/ida/insn.py
Lines 143 to 145 in 30f9378
mike-hunhoff commentedon Jul 16, 2026
Agreed, we need to update the documentation to convey the intention of
function-namefeatures and how they differ fromapifeatures. We'll then likely need to update the extractors to follow what is documented.williballenthin commentedon Jul 16, 2026
hm yeah that seems like a bug. maybe a copy paste issue?
williballenthin commentedon Jul 16, 2026
@mike-hunhoff do you think API features let you do what you want? or do we still need to extend the behavior in another way?
mike-hunhoff commentedon Jul 24, 2026
@williballenthin yes, API features would satisfy this requirement.
Here is my understanding of next steps (let me know if I'm missing anything):
williballenthin commentedon Jul 24, 2026
@mike-hunhoff agree