|
Hi!
I am working on a 3D engine for an RTS game using DirectX 9 and I have decided that I will be making the engine modular using .dll files for parts such as the renderer. The problem with this, is that the game is going to have a multiplayer aspect and therefore, I need some way to verify the integrity of a .dll file such as "renderer.dll" to ensure that the file has not been replaced with a third party .dll (basically a hack) that can display wireframe views or remove the fog of war, etc.
The reason I am making the engine modular is so that users will not have to download large updates to fix small issues, but can instead simply download the updated .dll that corresponds to the error fix.
So far the only method I have come up with for this error checking is to either simply redownload all files every time the user launches the game (horrible idea), or to somehow check the file against the server copy.
So I was wondering, do you guys have any ideas of how to achieve this?
|
|
|
|
|
Keep a table of DLL->MD5 mappings. If one does not match, then refetch the offending DLL. Update this table as your DLL are changed at the server. Just download the table and do the check each time. No need to get all the files that way.
|
|
|
|
|
Keeping MD5's (or some other hash/signature/digest) on the server and then comparing as Blake Miller suggested is what I would recommend as well.
However, the paranoid in me would also suggest that you compare the MD5s at different parts in the game, just to help keep hackers at bay. For example, check not only at launch/startup to download the correct versions, but also verifying the signatures of different binaries at specific time intervals during play (check only, do not download because the game is in progress).
Just my $0.02...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for your replies guys! do you have any articles on those topics? Doing a quick google, I have recovered an article from wikipedia.
http://en.wikipedia.org/wiki/MD5[^]
This is what the article has to say on MD5: In 1996, a flaw was found with the design of MD5; while it was not a clearly fatal weakness, cryptographers began to recommend using other algorithms, such as SHA-1. In 2004, more serious flaws were discovered making further use of the algorithm for security purposes questionable.
So, should I be using this if these serious flaws really do exist? The article states that a citation is needed for this information, and as such it may not be true, however I really can't take chances with something so vital to the game.
-- modified at 3:08 Wednesday 18th April, 2007
|
|
|
|
|
MD5 would likely still be fine for what you need to use it for - you are not dealing with highly secure messages or financial data/transactions (right?), and someone would still have to try pretty hard to duplicate a MD5 hash. Chances are that a hacker will spend less time trying to bypass the security than finding a useful collision. It is your choice to use something like SHA-1, of course.
I have used the Tiger hash for things like this for a while...
If you use something like Crypto++[^], it should be easy to try different algorithms as you develop the product.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
HI,
AFX_ID_PREVIEW_CLOSE is the ID of button to close printpreview, i search the afx message sended by this button.
AFX_ID_PREVIEW_PRINT call the command ID_FILE_PRINT catch in :
BEGIN_MESSAGE_MAP(CViewPrintPreview, CView)
//{{AFX_MSG_MAP(CViewPrintPreview)
ON_COMMAND(ID_FILE_PRINT, &CViewPrintPreview::OnFilePrint)....
BUT I search to map AFX_ID_PREVIEW_CLOSE, i try with ID_FILE_CLOSE but no effect.
Do you have a solution?
THANKS
|
|
|
|
|
Hi,
if i open a CDialog in a thread, which is destroyed after the execution-block, the debugger
alers that the memory of the variable (of the dialog) is corrupt.
Are windows always created in another thread as the current?
Normally, i create the object in a thread, which is in the thread-allocated-memory and all
operations are done in the "thread-memory".
Is it different for windows, probably because of the messageloops and other window-related-objects?
Thanks
PS: So i need to send a message to my general thread which opens the dialog-window?
|
|
|
|
|
I do so sometimes and it works. Actually, no strange thing in this, sometimes we have to do smth like openning a dlg in a thread. But beware, you should be careful in interthread communications. If your code crashes, abviously smth goes wrong in the code; is the dlg in the heap or stack or how do you destroy it?
--
======
Arman
|
|
|
|
|
thanks for your reply
i create a base-thread-class which is derived from a CWinThread.
Then i set a String-variable to the specially value of the task f.ex. "ListCustomers"
After this i post a message to the thread an there'in he checks the variable and starts
in deppension of the value the correct function ( which realises the task )
After the task is done, the thread post a message to the window and says "I'm ready"
That's the background of my thread-structure...
In a specific task i need to open a DialogBox, like this :
DOptions dlg(NULL,"showInfo");
dlg.DoModal();
at the end of the function, dlg will be killed, there the error-message appears.
|
|
|
|
|
baerten wrote: at the end of the function, dlg will be killed, there the error-message appears.
Are you freeing something in the destructor of the dialog class. If so is the pointer valid.
baerten wrote: After this i post a message to the thread an there'in he checks the variable and starts
in deppension of the value the correct function ( which realises the task )
After the task is done, the thread post a message to the window and says "I'm ready"
You should use AfxBeginThread to start off a thread. If you want it not to start the use CREATE_SUSPENDED option. Then later when you want it started call ResumeThread .
|
|
|
|
|
I'm learning mfc recent now. And I get a word quit confuses me , "hook"! it appears it the "chapter Window Messaging" of " programming applications for windows 4th edition"
quotion below:"
Let's start off with some ground rules. Windows allows a single process to create up to 10,000 different types of User objects: icons, cursors, window classes, menus, accelerator tables, and more. When a thread calls a function that creates one of these objects, the object is owned by the thread's process. So, if the process terminates without a thread explicitly destroying the object, the operating system will automatically destroy the object. However, two User objects—windows and hooks—are owned by the thread that creates the window or installs the hook. So, if a thread creates a window or installs a hook and then that thread terminates, the operating system automatically destroys the window or uninstalls the hook.
"
what does "hooks" meaning ? thanks!
kevien
|
|
|
|
|
Hooking in this sense means getting notification of specific window (creation, initialization, etc.) and being able to get access to (or intefere with) with the data associated with that event as well as being able to do additional processing.
Look up the hook-related functions like SetWindowsHookEx(...) for more details. MSDN also had documentation on "Windows Hooks" that wil be useful to you.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi
All
I am creating owner drawn menu(without using resource editor) so i want to know how to set ID to menu item.
With Regards
Atool
|
|
|
|
|
|
I have create one dll in VC++(win 32 dll) .I want to use the function of that dll in another dll in VC++(win32 dll).
how to do this..
Pls.help me
|
|
|
|
|
Try using LoadLibrary, GetProcAddress and FreeLibrary
Regards,
Paresh.
|
|
|
|
|
induvijay wrote: I have create one dll in VC++(win 32 dll) .I want to use the function of that dll in another dll in VC++(win32 dll).
how to do this..
This[^] should help.
|
|
|
|
|
|
|
just wondering, why are you exposing your DllMain() function in your .def file ?
AFAIK, no one should call it explicitely (the system does it) so there's no need for any one to see its clear name (even the mangled name is not shown in normal cases i believe)
|
|
|
|
|
Thanks for ur suggestions.I can link the dll.
one more query how to get the function protype of
or system dll.how to access them.
pls help me.
|
|
|
|
|
Hi All,
How do i determine whether my application window has the focus or not?
Sunil
|
|
|
|
|
Try using CWnd::GetFocus .
Regards,
Paresh.
|
|
|
|
|
sunilpv1982 wrote: How do i determine whether my application window has the focus or not?
Use GetFocus() which returns the CWnd* object which currently has focus...
So you can compare likewise...
bool <code>CYourMainWindow</code>::IsFocussed()
{
return GetFocus()->GetSafeHwnd() == this->GetSafeHwnd();
}
|
|
|
|
|
GetFocus() returns a HWND. I am not sure about this???
Sunil
|
|
|
|