-1

I am new to reverse c++ program.

I met this code from r2 decompilation.

            pcVar6 = (char *)sym.imp.std::string::operator___unsigned_long
                                       (&username, (int64_t)(int32_t)(uint32_t)var_32ch,
                                        (int64_t)(int32_t)(uint32_t)var_32ch);

What does the code mean?

Thanks in advance.

0

This is an "operator overload" member function, specifically a conversion operator.

This function is called when you treat the value of the object instance (in this case, a string, as a different type (in this case, an unsigned long).

For example, if there is a function that expects an unsigned long as an argument, but you pass a string object instead, this operator member will be called to convert the string to match the type.

There are many types of conversions, such as casting:

string a = ...;
unsigned long b;

b = a; //or:
b = (unsigned long)a;

You can find more information here:

https://en.cppreference.com/w/cpp/language/cast_operator

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.