0

I'm working on SPARC binary in IDA Pro and need to use __usercall convention, but can't make it work. For example, I've tried to use the following function declaration to reflect the fact that the function returns result in register %o0:

int __usercall sub@<%o0>()

But it doesn't work, IDA says "Syntax error near: %". Removing the percent sign from register name also doesn't help.

Does anybody know if that's possible to use __usercall with non-x86 architectures at all?

4
  • Hi and welcome to RE.SE. Have you tried without the % or with an alternative characters such as $? Also, have you tried starting the debugger to inspect what the register names are? Perhaps that gives clues as to what should go there. I haven't used IDA with SPARC, but it's also possible you need to adjust the settings for the target processor to support a given register representation.
    – 0xC0000022L
    Commented Sep 22, 2023 at 22:55
  • Hello. Regarding trying the register name without "%" - that also doesn't work, and that was stated in my post. Using "$" also doesn't work (and that would be strange if that worked. SPARC specification uses "%" in register names, and IDA SPARC module follows that convention). "Also, have you tried starting the debugger to inspect what the register names are?" - I can't do that. That's a firmware of specific embedded SPARC-based SoC, and I don't know how to connect to the device with debugger. Commented Sep 25, 2023 at 12:10
  • "it's also possible you need to adjust the settings for the target processor to support a given register representation" - There are no settings which could change register representation, and it is all right with register names in disassembly itself. That's only references to registers via __usercall what fails. Commented Sep 25, 2023 at 12:12
  • As for the debugger part, theoretically something like Qemu or generally debuggers speaking the gdbserver protocol should work fine. As for the rest, apologies. As I wrote I have not used IDA with SPARC and my last developer adventures with SPARC are also by now >10 years ago.
    – 0xC0000022L
    Commented Sep 25, 2023 at 14:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.