Different prototype functons depending on context

how about append to hexrays set prototype functions depening on context ?

as example std::shared_ptr after compilation has same call for all binary
so if we set at current context(pseudocode)
struct A *sub_0001(shared_ptr *);
in another context(pseudocode)
this prototype incorrect
and need change to
struct B *sub_0001(shared_ptr *);
etc

some time prototype same per pseudocode
some time dirrerent for same pseudocode

so will be nice to able set prototype

  • global context, same for all binary
  • local context, same for all pseudocode
  • local context per position, dfferent for pseudocode position

Perhaps hrtng/doc/reicast.md at master · KasperskyLab/hrtng · GitHub could help you with this.

Another possibility is to create an union like this:

union shared_{
struct A * a;
struct B * b; 
}

Then change the type of sub_0001 to shared sub_0001(shared_ptr *)

I’m not looking for a solution
I’m suggesting improving the basic functionality

I’d suggest to create a base class for struct A and B. Something like this:

struct base { .. };
struct A: public base { ... };
struct B: public base { ... };

and return base* from the function. However, you will have to manually specify the type of the variable that receives the result of the call to be A or B, not base.

You can also use Edit/Other/Decompile as call and specify the local type there.

in case where hexrays produce code like
1)
sub_0001(&ptr)->field_140 …etc expression

will not possible to use base struct
because it doest find correct field for derive struct variant

yeh in case
2)
var34 = sub_0001(&ptr);
var34->field_140 …etc expression
i can change the variable type A *var34

but this is another case
where i wish enable/disable for hexrays such optimization 1) or 2) for function

for manual set for over +100 calls ?
you are joke

No, I’m a living person and you are very rude.

any way with this topic iam propose to improve hexrays
for set diffetent type for same function

as example add addition notation loke __LOCAL or __LINELOCAL

what this mean

when set function prototype like
__LOCAL A *sub__0001(shared_ptr *);
this will set for all such functions in current window pseudocode

__LINELOCAL A *sub__0001(shared_ptr *);
this will set for only this function in current window position pseudocode

without any notation will default prototype for all global context in all pseudocodes

when i press Y
dialog window for prototype will be show different types
depend from context or already assign type