Reputation: 6312
I have some IDA pseudo c++ code and I was wondering how close it was...
The lines:
CHAR Filename; // [sp+26Ch] [bp-110h]@1
char v31; // [sp+36Ch] [bp-10h]@1
int v32; // [sp+378h] [bp-4h]@1
GetModuleFileNameA(0, &Filename, 0x100u);
CString__CString(&v31, &Filename);
v32 = 0;
CString::MakeLower(&v31);
if ( CString__Find(&v31, "notepad") != -1 )
...
As the decompiled .dll uses CString I have assumed that it is a MFC based dll. I thought, reading the docs that CString would be immediately available. However, I get the error Error 1 error C2665: 'ATL::CStringT::CStringT' : none of the 17 overloads could convert all the argument types?
I also get similar errors with MakeLower and Find, which according to what I have read are standard CString functions so where am I going wrong?
Also, you are supposed to be able to use the CString class in non mfc based .dll's by using teh #include header, however, I get the same Error 1 error C2039: 'CString' : is not a member of 'ATL::CStringT' so again how do I use it?
Thanks.
Upvotes: 1
Views: 1240
Reputation: 2776
hexrays will produces more C-like code than C++ with objects. so all 'this' pointers are passed explicitly.
to clear things up you should probably change the type of v31 to CString.
and i think the compiler will not understand that CString__CString( <>, FileName) is the constructor.
so you should change that yourself in:
CString v31(FileName);
Upvotes: 1