| | |
Advanced : Reading Memory and Comparing
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2005
Posts: 36
Reputation:
Solved Threads: 1
Hello, I've been working on a security based software from which I got the idea from another program. Here are the details:
Upon load of the software a 4 digit string is given (I.E: 1kfh). Then you're prompt for a password. To find your password you would use a Memory Editor (TSearch, Artmoney, etc) and search the 3 digits given to you. Out of all the thousands results given, you are to find your password. (obviously, very hard which is the point).
This is where I'm at in my program to do the same thing:
I give user a random string (they see 6 characters; the full string contains 12). They have to search the 6 characters using a ME. The correct password will be the remaining 6 characters will they will locate.
This is my problem:
When my code searches for the remaining code it comes back in UNICODE. I convert to text using wchar_t MyString = _T. After doing so, it still does not work. I think the search part is wrong, or I'm just REALLY bad at converting lol (which I sure I am).
My Question:
I'm familiar with ArtMoney so I don't know if other memory editors are the same. I'll set up an example to make the question make some sense (otherwise everything is very confusing).
Fun.exe gives me a random 3 characters out of 12. (Lets say it gives me, "The")
Full random string = TheFunString. (I dont know this)
Manualy, I search Fun.exe using ArtMoney, "The", there are 7 accurances. I locate the correct one and find the remaning 9 characters.
I enter the remaining characters in the Password box.
How can I search the full string in the program to to compare userinput with the correct value?
Hope this makes sense.. Thanks for any help IA.
Upon load of the software a 4 digit string is given (I.E: 1kfh). Then you're prompt for a password. To find your password you would use a Memory Editor (TSearch, Artmoney, etc) and search the 3 digits given to you. Out of all the thousands results given, you are to find your password. (obviously, very hard which is the point).
This is where I'm at in my program to do the same thing:
I give user a random string (they see 6 characters; the full string contains 12). They have to search the 6 characters using a ME. The correct password will be the remaining 6 characters will they will locate.
This is my problem:
When my code searches for the remaining code it comes back in UNICODE. I convert to text using wchar_t MyString = _T. After doing so, it still does not work. I think the search part is wrong, or I'm just REALLY bad at converting lol (which I sure I am).
My Question:
I'm familiar with ArtMoney so I don't know if other memory editors are the same. I'll set up an example to make the question make some sense (otherwise everything is very confusing).
Fun.exe gives me a random 3 characters out of 12. (Lets say it gives me, "The")
Full random string = TheFunString. (I dont know this)
Manualy, I search Fun.exe using ArtMoney, "The", there are 7 accurances. I locate the correct one and find the remaning 9 characters.
I enter the remaining characters in the Password box.
How can I search the full string in the program to to compare userinput with the correct value?
Hope this makes sense.. Thanks for any help IA.
•
•
Join Date: Mar 2005
Posts: 36
Reputation:
Solved Threads: 1
Sorry for double post, but I could not find the edit button. Anyways, I fixed the search so I do not need help with the question above anymore. I do have a new question which has come up.
Some reason whether I compare CString or Char* it always returns to the else statement. My question is, how do I compare the strings so the IF Else statement will work properly.
Other ways I have tried:
Again it would always return invalid.
I have also tried char * MyVar = (char*)MyCstring.GetString() but that is the same as LPCTSTR.
C Syntax (Toggle Plain Text)
char * Serial = (char*)(LPCTSTR)PreSerial; if (strlen(Serial) > 5) Serial[5] = 0; // PreSerial = (CString)Serial; char * Input = (char*)(LPCTSTR)m_Password; if (Serial == Input) m_Warning.SetWindowText("Correct"); else m_Warning.SetWindowText(PreSerial); }
Other ways I have tried:
C Syntax (Toggle Plain Text)
if (m_Password.Compare(PreSerial) == 0) //correct else // invalid
I have also tried char * MyVar = (char*)MyCstring.GetString() but that is the same as LPCTSTR.
•
•
Join Date: Mar 2005
Posts: 36
Reputation:
Solved Threads: 1
Hey, I figured out the problem. I forgot to add:
Your post helped me with another problem I was having though. Thanks for the help.
C Syntax (Toggle Plain Text)
UpdateData(); CString Password = int pID; UpdateData(FALSE);
•
•
•
•
Originally Posted by winbatch
You defined Input and Serial as char *. You need to you strcmp to compare.
![]() |
Similar Threads
- ptrace() Getting process ID and reading memory (C)
- Virtual Memory (Windows NT / 2000 / XP)
- can't read all the memory of my computer (Windows NT / 2000 / XP)
- Windows Registry/Virtual Memory (Windows NT / 2000 / XP)
- Identifying memory of video card (Monitors, Displays and Video Cards)
Other Threads in the C Forum
- Previous Thread: Number puzzle help
- Next Thread: Taskbar program button visibility
| Thread Tools | Search this Thread |
Tag cloud for C
#include adobe ansi array arrays asterisks binarysearch calculate centimeter changingto char convert copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic fflush file fork forloop framework getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware highest histogram inches include incrementoperators input iso kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard multi mysql number opendocumentformat opensource owf pattern pdf performance pointer posix problem probleminc process program programming radix recursion recv repetition research reversing scanf scripting segmentationfault sequential shape socket socketprograming stack standard string strings structures systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi





