|
Dear all everyone,
My project compiled out "exe file" but I want protect this exe file when click it(password requestion).Please help me! I created this project by DIALOG(MFC)in environment of visual studio 2005.
Thanks and Best regards,
LQLONG
|
|
|
|
|
If I'm not missing something, you just write code to ask for password.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
|
I help you with what exactly? Read point #2 in this post: How to ask a question[^]
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Dear Mr. Chris Maunder,
Thanks and Good health,
LQL
|
|
|
|
|
hey guys i have this
int main(void)
{
while (malloc(50));
return 0;
}
but after a couple of seconds it just asks to press any key to continue. what i would like it to do is just run till it crashes the program?
|
|
|
|
|
|
|
Wimdows, MacOSX, Linux, GCC, Visual Studio.....?
|
|
|
|
|
windows, using c-free 5. i just want it to keep running untill it crashes or slows my comp down heaps
|
|
|
|
|
malloc returns NULL when it can't allocate the requested memory. So your program simply allocates 50 bytes in a loop until memory runs out then exits (as NULL is treated as false by the while loop). Why would you expect a spectacular crash?
Steve
|
|
|
|
|
int main()
{
while(true)
malloc(50);
return 0;
}
The loop is now infinite, but the memory will sooner or later be exhausted.
At that point, malloc will not allocate anymore, but the loop will still cycle forever.
It will be very hard to stop it, having no more resource to create another process to kill the cycling one ...
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hello!
I am searching for an old artical that defines how to protect all the running processes from being modified by some other process or virus.
It articulate about: for most of the time it is required that we should be alerted when something tries to alter our running processes. The source code provided was also release as an separate free downloadable product on author personal website.
-- Waqar
|
|
|
|
|
|
Jeffrey Walton - Wow that guy sounds like one *real man* we talk about.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
You can find an answer to this in the Secure Coding Cookbook. There are some elegant macros that you wrap around the methods you want to watch. Even if a checkpoint is set, the checksum of the method will change.
Som compilers let you set the code segments to read only. You might want to read about that as well.
|
|
|
|
|
Hi
I have two modeless dialogs. One dialog is a member variable of a CWnd class and the Create function is called on this dialog member variable. This dialog displays correctly. There is another dialog which is created as a pointer using new operator and Create is called on this dialog. There are issues with the second dialog on Windows 2003 with one of our clients. Wanted to know if there is a difference when a modeless dialog is created as a member variable of a Wnd and using new operator.
Secondly, in both the cases the *pParent passed is NULL. Is there any known issue passing the parent window pointer as NULL, or it should be the applications main frame window or the Desktop window?
Thanks
|
|
|
|
|
vipin_nvk wrote: There are issues with the second dialog on Windows 2003 with one of our clients.
What kind of issues?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Painting issues where the frame of the window is not getting painted properly
|
|
|
|
|
Of course i can only talk for myself, but personally i don't think generally there are problems with creating the dialog class dynamically or passing NULL for the parent, i think this issue could very well be a specific one.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Try posting a screen capture of what you're referring to. The drawing of the frame is almost entirely handled by the framework, so it might just be a Windows bug.
|
|
|
|
|
Can you show some piece of code?
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
They should be exactly the same... it's possible that there's an old bug in that Windows version, but I'm not sure. There's nothing wrong with setting the parent to NULL, but you should really be using the real parent for more predictable behavior.
|
|
|
|
|
I don't get it. It works fine in debug mode, but in release mode, this buffer I create doesn't seem to exist, and returns just nothing. At first I thought it was my wcsncpy_s, in which on ERROR_SUCCESS, I create the buffer, and copy the rgValue to szReturnValue instead of the wchar single copy for loop, but then I changed it to copy 1 wchar at a time and it does the same thing.
So in my message pump, I grab the data from the registry
case IDM_FILE_RECENTPROJECT_FILE1:
{
CA_Registry caReg;
WCHAR *szProject_Path = NULL;
DWORD dwProjectPath = 0;
caReg._read_Registry_ProjectMRUList_Value( L"File1", dwProjectPath );
szProject_Path = new WCHAR[ dwProjectPath + 1 ];
szProject_Path = caReg._read_Registry_ProjectMRUList_Value( L"File1", dwProjectPath );
_project_Open( szProject_Path );
delete [] szProject_Path;
}
break;
And in the registry function, szReturnValue is there, but I can't check the value using the Add Watch or the mouse over, when running in release. All the other values show and I can check the values.
WCHAR *szReturnValue = NULL;
WCHAR *regPath = L"SOFTWARE\\redCopper\\Internet Commerce Engine 5\\ProjectMRUList\\";
HKEY keyHandle;
WCHAR rgValue[MAX_PATH];
DWORD dwValue = sizeof(rgValue);
DWORD dwType = REG_SZ;
DWORD regStatus = REG_DWORD;
if(RegOpenKeyEx(HKEY_CURRENT_USER, regPath, 0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS) {
regStatus = RegQueryValueEx( keyHandle, pzValue, NULL, &dwType, (LPBYTE)&rgValue, &dwValue );
RegCloseKey(keyHandle);
switch ( regStatus ) {
case ERROR_SUCCESS:
{
if (( dwOut > 0 ) && ( dwOut < 4096 )) {
szReturnValue = new WCHAR[ dwOut+1 ];
for ( DWORD dwI = 0; dwI <= dwOut; ++dwI ) {
szReturnValue[ dwI ] = rgValue[ dwI ];
}
szReturnValue[ dwOut ] = L'\0';
}
else {
szReturnValue = L'\0';
dwOut = wcslen( rgValue );
}
}
break;
|
|
|
|
|
I'm a bit confused on the Debug/Release part of the question. The way I'm reading it, you have built a Release build but are running in the VS debugger, and that is when you "can't check the value...." Is that the case or did I assume too much?
In the message pump code, how is dwProjectPath getting a value? It's init to 0 then passed into the _read_Reg... function. Is it being passed by reference and getting a value there? Otherwise it's still zero when allocating szProject_Path.
In the second code block, how is dwOut evaluated? In code not shown here I'm guessing since I don't see it's declaration. Are you sure that you're executing the between 0 and 4096 section?
I know you're the one asking the question, so I should be answering instead of asking, but....
BDF
I often make very large prints from unexposed film, and every one of them turns out to be a picture of myself as I once dreamed I would be.
-- BillWoodruff
|
|
|
|