I have a function that seems to calculate the length of a string.
I have made this type declaration and it does kind of work as IDA now flags the string correctly.
__int64 __fastcall strlen(char strlen_string);
Now, RAX seems to hold the length of the string. But doing strlen@<rax>
tells me that 'location rax is not allowed here'. Also, I'd like to flag exactly where the length is being used.
This is what I have now:
mov rdi, rcx ; strlen_string
call strlen
mov [rbp+var001], rax
and this is what I want to have with the new type declaration:
mov rdi, rcx ; strlen_string
call strlen
mov [rbp+var001], rax ; string_length
How can I do that? Is it even possible?
__usercall
, you can't combine custom locations with predefined calling conventions like__fastcall
. I have also never seen IDA name return value locations so unless I've missed it the whole time, you'd probably need to write your own script for that.