3D view in 2k/xp
Posted: Wed Mar 01, 2006 6:11 am
today i meet with some russian hacker (z0) and give him a copy of Drakan with editor to look what we can do with crashes of 3D view Engine of editor... so the work of fixing it looks to be started wih a small team...
i tryed some workaround in the Engine.exe for 3D View window and 3D model view from Level Editor to works in win2k and possibly winxp (i do not use this system at home)...
the point was really in memory protection of memory mapped files but it looks like a bug by surreal that unmaps view of file before accessing mapped memory again - that works in shared memory in win98 above 2 Gb (virtual) but as ppl wrote me on wasm.ru forum win2k and later uses another way of mapping files so if unmap view was called, unmapped memory pages may be physically throwed away from pages addreses translation and so on and no ways to access them exist...
i simply remove call to unmapviewoffile function from engine.exe so it possibly _can_ cause memory leak or even exception errors in level editor with losing all unsaved level data so it recommended to save work frequently and reload editor from time to time if memory leaks will occur...
current changes to Engine.exe : patch bytes from file offset 69446H:
8B 90
4B 90
50 90
51 90
FF 90
15 90
DC 90
30 90
48 90
00 90
current version of patched Engine.exe : ftp://au:au@files.drakan.ru/pub/Engine_2kxp.zip
i test it with 3D view of some retail levels at win2000sp3eng and it still works without crashes or visible memory leaks in system stats... if anyone will found a place or level that would cause something to crash (editor or engine) you can post here a detailed description how to reproduce that crash so we can try to analyse it...
i tryed some workaround in the Engine.exe for 3D View window and 3D model view from Level Editor to works in win2k and possibly winxp (i do not use this system at home)...
the point was really in memory protection of memory mapped files but it looks like a bug by surreal that unmaps view of file before accessing mapped memory again - that works in shared memory in win98 above 2 Gb (virtual) but as ppl wrote me on wasm.ru forum win2k and later uses another way of mapping files so if unmap view was called, unmapped memory pages may be physically throwed away from pages addreses translation and so on and no ways to access them exist...
i simply remove call to unmapviewoffile function from engine.exe so it possibly _can_ cause memory leak or even exception errors in level editor with losing all unsaved level data so it recommended to save work frequently and reload editor from time to time if memory leaks will occur...
current changes to Engine.exe : patch bytes from file offset 69446H:
8B 90
4B 90
50 90
51 90
FF 90
15 90
DC 90
30 90
48 90
00 90
current version of patched Engine.exe : ftp://au:au@files.drakan.ru/pub/Engine_2kxp.zip
i test it with 3D view of some retail levels at win2000sp3eng and it still works without crashes or visible memory leaks in system stats... if anyone will found a place or level that would cause something to crash (editor or engine) you can post here a detailed description how to reproduce that crash so we can try to analyse it...