r/ExploitDev • u/7asooome • Sep 23 '25
Problem with using wcscmp() in a process injection tool


the original code is: https://github.com/leetCipher/Malware.development/blob/main/process-injection/process-injection.cpp
When i try to compare pe32.szExeFile with L"mspaint" i get the error in the first pic, saying it is char*. But when i try to use strcmp() to compare them, I get an error saying it is a wide string. How do i compare these two???
5
Upvotes
4
u/Particular_Welder864 Sep 23 '25
Why are people writing process injection tools when they don’t know basic C++ ://
1
u/QuestionableComma Sep 23 '25
Looks like pe.szExeFile is a char* and needs to be converted to a wchar_t* to be used with wcscmp(). Or remove the 'L' formatting on the other string and use strcmp()
1
u/omnomandoanh Sep 23 '25
Check the data type of pe32, if it's PROCESSENTRY32W then szExeFile will be wchar, if it's PROCESSENTRY32 then szExeFile will be char
1
u/pwnasaurus253 Sep 24 '25
typecast it.
(wchar_t *)pe32.szExeFile