I have this function, named __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm
.
And this is the relevant assembly:
mov rdi, [rbp+var_A80]
mov rsi, [rbp+var_A88]
mov rdx, [rbp+string_length]
call __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm
From what I've noticed by looking at the registers before and after calling the function, the address of RSI is incremented by string_length, but I still have no idea what RDI is doing.
Another weird thing is that the string length reported by the register is 0x046, but the address is incremented by 0x040.
The RDI is 00007FFEEFBFF240
before the call, 0000000100400040
after it.
EDIT:
IDA is not letting me debug the function, as it throws SIGBUS.
I am slowly reversing the function, i'll update here with progress.
RDI is compared with 0FFFFFFFFFFFFFFF0h (Why?)
std::string
constructor. From personal experience with STL code, take educated guesses and move on. You'll turn crazy if you reverse all of it. I usually just check xrefs to some function and if it looks like it may be simply creating anstd::string
from a C string, I treat the function as such until further context shows it doesn't.Options -> Demangled names -> Select names
so you don't have to look at 500 character mangled names all day.