'Pre'launch error
Program aborts? Network configuration? Graphic errors? Bugs? Post your question here.
1, 2
posted on May 28th, 2009, 12:20 pm
Last edited by OvermindDL1 on May 28th, 2009, 1:13 pm, edited 1 time in total.
I am not adding this to the Launch Error topic because of a reason I will describe shortly.
(Don't you hate seeing me around, every time I stop by I have some nasty error for you, oddly this is just about the only program out of the thousands I have that has any issues...).
When I launch FleetOps (or if I launch the Armada2 executable directly) I get a bog-standard Windows Application Error dialog box containing:
[tt]---------------------------
armada2.exe - Application Error
---------------------------
The instruction at "0x016e24b0" referenced memory at "0x016e24b0". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
If I click Cancel then the application process disappears quite instantly.
If I click OK then the box pops up again.
This *specific* box pops up a total of 6 times. Then I get 2 boxes of:
[tt]---------------------------
Error: armada2.exe - Application Error
---------------------------
The instruction at "0x016e24e0" referenced memory at "0x016e24e0". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
There is also a 9th box:
[tt]---------------------------
Error: armada2.exe - Application Error
---------------------------
The instruction at "0x016e2520" referenced memory at "0x016e2520". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
Now, if I look at the Armada2 executable I notice that the mapped memory between 0x166B000 to 0x01760000 (which so happens to contain both of the above listed locations) contains unallocated memory (reserved area for loading system libraries, but nothing is loaded in that location).
Running the executable in a debugger reveals that these exceptions are thrown before WinMain is ever reached (well before you ever set your own exception handler, hence why I do not see your special box). Since this occurs before WinMain, it is not occurring in your code; upon further inspection it happens while loading system libraries (although, admittedly I do have a few, though none of the many thousands of other installed applications have any issues whatsoever, leading to the belief that the executable or some library it links to is conflicting).
Testing Fleet Ops 3 beta (you know, the 2006 version, wow it has been a long time...) shows it runs perfectly (other than the long path bug that I reported and showed how to fix for you a while back, which from reading around here apparently other people ran into as well). So *something* is unique and broken with the most recent version, but what is it? I cannot seem to find the issue
EDIT1: And yes, this was a fresh install from the CD itself (had a fun time hunting that down again).
EDIT2: And I tried on another freshly made admin user account with no frills or anything, same error.
(Don't you hate seeing me around, every time I stop by I have some nasty error for you, oddly this is just about the only program out of the thousands I have that has any issues...).
When I launch FleetOps (or if I launch the Armada2 executable directly) I get a bog-standard Windows Application Error dialog box containing:
[tt]---------------------------
armada2.exe - Application Error
---------------------------
The instruction at "0x016e24b0" referenced memory at "0x016e24b0". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
If I click Cancel then the application process disappears quite instantly.
If I click OK then the box pops up again.
This *specific* box pops up a total of 6 times. Then I get 2 boxes of:
[tt]---------------------------
Error: armada2.exe - Application Error
---------------------------
The instruction at "0x016e24e0" referenced memory at "0x016e24e0". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
There is also a 9th box:
[tt]---------------------------
Error: armada2.exe - Application Error
---------------------------
The instruction at "0x016e2520" referenced memory at "0x016e2520". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------[/tt]
Now, if I look at the Armada2 executable I notice that the mapped memory between 0x166B000 to 0x01760000 (which so happens to contain both of the above listed locations) contains unallocated memory (reserved area for loading system libraries, but nothing is loaded in that location).
Running the executable in a debugger reveals that these exceptions are thrown before WinMain is ever reached (well before you ever set your own exception handler, hence why I do not see your special box). Since this occurs before WinMain, it is not occurring in your code; upon further inspection it happens while loading system libraries (although, admittedly I do have a few, though none of the many thousands of other installed applications have any issues whatsoever, leading to the belief that the executable or some library it links to is conflicting).
Testing Fleet Ops 3 beta (you know, the 2006 version, wow it has been a long time...) shows it runs perfectly (other than the long path bug that I reported and showed how to fix for you a while back, which from reading around here apparently other people ran into as well). So *something* is unique and broken with the most recent version, but what is it? I cannot seem to find the issue
EDIT1: And yes, this was a fresh install from the CD itself (had a fun time hunting that down again).
EDIT2: And I tried on another freshly made admin user account with no frills or anything, same error.
posted on May 29th, 2009, 10:51 am
And for note, this is on Windows XP Pro 32-bit in an admin account (tried a new admin account too as stated above).
posted on May 29th, 2009, 11:06 am
I am currently not at home so i can neither investigate nor make a detailed post. You said the crash occours while loading the libraries. The dll injection works by loading a wrapper d3d8.dll (data directory) which armada loads without modifiated executable or seperate loader executable. So maybe you find your answer there
posted on May 29th, 2009, 2:21 pm
I noticed that wrapper and it does get past loading it in, but by the time the crash occurs it seems the state seems a bit corrupted so it is *really* hard to follow (especially by the time it starts jumping into inaccessible memory, bit of an indication that something is corrupted by then).
Thanks for the idea though, if I remove (well, rename) your d3d8.dll wrapper then the executable launches, creates a window (meaning it reaches well into your winmain function, well, actually it just popped up and disappeared like before since the long path was not fixed, so using my temp fix that I used for your old version I got it to pop up a window), however it creates the fullscreen window, then an unhandled exception killed it. If I use your launcher it does the same thing (apparently an exception is happening that is not caught by your error handler). Running it through a debugger (after remember to set the environment for the debugger to shorten the path as well, A2 *really* needs that bug fixed) reveals that the exception is that it tried to derefence 0x0, which, obviously will not work.
The line that failed at is 0x0059D125, and I am pretty sure it was calling a function to load a bik file since on the stack there was a pointer that pointed to the embedded string "bitmapsmainsingleplayer.bik" as the second argument to that function (gotta love C-style function calls, so easy to figure out).
Apparently there is a function in the Bink library (_BinkOpen@8) that is passed that string then it then supposed to return a pointer, but the pointer is null, which then the line after the next is the above mentioned instruction, which then dereferences the null pointer, if I drop in the missing .bik file from an actual A2 install then it passed through this fine. If I add in those four bik files then I can get to the main menu just fine.
So, I am guessing that your wrapper is supposed to load up different movies or do something different, but the wrapper is rather horribly corrupting the memory state of the program. I should have been asleep, oh, 4 hours ago at the latest, so I do not have time to diagnose it now, but for later I would *love* it if you could give me any info on your wrapper file and what else it does and loads so that tracing through it will be easier later, hopefully looking into what it will be overwriting in memory because it is apparently overwriting something wrong, possible messing up the dynamic link table of the program (since that is where the program jumps into invalid memory is from the dynamic link table, can definitely tell A2 was compiled by an old compiler looking at that assembly).
If you need any help with code of such things, I have been doing this for years and the past week is the first time I have had free time in near a year, it may not last too long though, so if there is anything I can help with, feel free to ask.
Also, I noticed something odd, the splash screen that A2 pops up for a second while it first loads, is not a normal A2 picture, in fact it is the handle of another program that is currently running on my system, meaning that I bet the handle for it is also corrupted and it is by random chance picking a handle that is actually used by another image on the system (rather then like a file handle or a mutex handle or, you know, a handle that is not defined), I plan to look into that as well since it may also indicate where something is getting corrupted.
Either way, yes, the d3d8.dll hook, something it is passing off is royally screwing up memory, will try to figure out more later, for now, sleep, have work in a few hours...
Thanks for the idea though, if I remove (well, rename) your d3d8.dll wrapper then the executable launches, creates a window (meaning it reaches well into your winmain function, well, actually it just popped up and disappeared like before since the long path was not fixed, so using my temp fix that I used for your old version I got it to pop up a window), however it creates the fullscreen window, then an unhandled exception killed it. If I use your launcher it does the same thing (apparently an exception is happening that is not caught by your error handler). Running it through a debugger (after remember to set the environment for the debugger to shorten the path as well, A2 *really* needs that bug fixed) reveals that the exception is that it tried to derefence 0x0, which, obviously will not work.
The line that failed at is 0x0059D125, and I am pretty sure it was calling a function to load a bik file since on the stack there was a pointer that pointed to the embedded string "bitmapsmainsingleplayer.bik" as the second argument to that function (gotta love C-style function calls, so easy to figure out).
Apparently there is a function in the Bink library (_BinkOpen@8) that is passed that string then it then supposed to return a pointer, but the pointer is null, which then the line after the next is the above mentioned instruction, which then dereferences the null pointer, if I drop in the missing .bik file from an actual A2 install then it passed through this fine. If I add in those four bik files then I can get to the main menu just fine.
So, I am guessing that your wrapper is supposed to load up different movies or do something different, but the wrapper is rather horribly corrupting the memory state of the program. I should have been asleep, oh, 4 hours ago at the latest, so I do not have time to diagnose it now, but for later I would *love* it if you could give me any info on your wrapper file and what else it does and loads so that tracing through it will be easier later, hopefully looking into what it will be overwriting in memory because it is apparently overwriting something wrong, possible messing up the dynamic link table of the program (since that is where the program jumps into invalid memory is from the dynamic link table, can definitely tell A2 was compiled by an old compiler looking at that assembly).
If you need any help with code of such things, I have been doing this for years and the past week is the first time I have had free time in near a year, it may not last too long though, so if there is anything I can help with, feel free to ask.
Also, I noticed something odd, the splash screen that A2 pops up for a second while it first loads, is not a normal A2 picture, in fact it is the handle of another program that is currently running on my system, meaning that I bet the handle for it is also corrupted and it is by random chance picking a handle that is actually used by another image on the system (rather then like a file handle or a mutex handle or, you know, a handle that is not defined), I plan to look into that as well since it may also indicate where something is getting corrupted.
Either way, yes, the d3d8.dll hook, something it is passing off is royally screwing up memory, will try to figure out more later, for now, sleep, have work in a few hours...
posted on May 29th, 2009, 2:43 pm
Last edited by OvermindDL1 on May 29th, 2009, 4:01 pm, edited 1 time in total.
Okay, I should be going to sleep, but I did some debugging, and yep, it seems to not really be with something in general with your code that is hooked in, but the *way* it is hooking, the process of hooking is what seems to be causing the corruption, how are you actually performing the hook, and by hook I mean the DX8 specific hook, because when that part of the code is called I see all manner of odd stuff like the OpenGL library suddenly being linked in and oddities like that, which seems a little specific to be a random occurrence, although nothing is used from it, it is still looked at, very weird?
Either way, it is getting very hard to follow because the code is doing the corrupting past a sysenter call, which of course is *really* hard to follow since that jumps into kernel mode (to link in other system libraries, your d3d wrapper library, etc...) before hopping back, and I cannot debug into of course.
So yes, what is the actual hooking process and what does it do and why is it corrupting global libraries...
EDIT1: Ah hah, I take back the above, it is dieing when hooking, but it is dieing when it is hooking in "..FleetOpsHook.dll", now need to find the entry point into that and figure out where. From the looks it may by dieing while it is still linking it in, even before it runs the library entry function for that dll. Need to examine more (why am I not asleep?).
EDIT2: It appears that the FleetOpsHook.dll file also links in a few other DLL's, one of them is MSCTF.dll (located in the system32 directory), which is odd because I do not see that file located anywhere in the linker map of the library, either way when it is loadlibrary'ed in the loadlibrary function call instruction code points to the above invalid memory, meaning that something is damaging it before that point. If I manually repair the code in-process then I actually get one of your exception boxes throwing an error that I have seen mentioned on these forums before (with no help), let me just copy/paste the relevant parts, hmm, scratch that, your exception box does not support ctrl+c to copy out of it, you should fix that, while typing manually:
[tt]executable = armada2.exe
current module = FleetOpsHook.dll
module date/time = 2009-05-20 17:02
compiled with = Delphi 2006/07
madExcept version = 3.0i beta 2
exception class = EAccessViolation
exception message = Access violation at address 5AD71531 in module 'UxTheme.dll'. Read of address 00000040.[/tt]
And the top of the callstack:
[tt]5ad71531 +00011 UxTheme.dll
5ad79030 +0001f UxTheme.dll IsAppThemed
5a90cb05 +00009 FleetOpsHook.dll GR32_System 446 +0 UseXPThemes
5a90cc57 +00013 FleetOpsHook.dll GR32_System 505 +4 TThemeNexus.OpenVisualStyles
5a90cbee +00022 FleetOpsHook.dll GR32_System 490 +2 TThemeNexus.Create
5a9bcfd8 +00010 FleetOpsHook.dll GR32_System 530 +3 initialization
5a805269 +0003d FleetOpsHook.dll System 161 +0 InitUnits
5a805353 +000bf FleetOpsHook.dll System 161 +0 @StartLib[/tt]
Now, I have a question. Why the heck in the name of anything anyone believes in would you ever possibly have the need to link in UxTheme and query IsAppThemed? I may not have seen the game yet (obviously, will not run after all), but is not the whole thing taking place inside a 3d rendering context? Why would you *ever* need to query things like that?!? I can only guess that TThemeNexus is some new drawing code you made to maybe draw new data in-game or something, have not looked at its code yet, but why on earth would it ever need to query data like that. There are some system files you do not link it, and guess what, UxTheme is one of those! On different systems it has different functionality depending on how they have their windows looking (I use the classic theme, faster drawing, better on memory, etc... and that changes how that library works, it is NOT safe to use that library directly, it is to only be used by windows itself, explorer to be specific, do not use it).
Either way, this got me looking at the hook file in more detail now that I was able to get past it (by having to manually repair the certain section of memory, manually, every time I relaunch the app), and once the hook library is fully loaded it links in a rather monstrous amount of stuff, I means its symbol table it links in is on the order of ungodly monstrous, and I have no clue what most of it would ever be used for in a game like this, or anything for that matter unless you were trying to hook the global operating system and reimplement half of it. Sorry for the rant, but what on earth was the design standard of this file, I could not even imagine the what would have to be *monstrous* code base to create something like this. To get any of my libraries anywhere near this size requires a good multiple hundred thousand lines of code to millions of lines, and considering all the stuff it links in there is no telling what it could possibly be doing to the system. Considering the size of this file I can only guess that you probably reimplement half of the functionality of Armada2 itself inside of it, so I am curious, what does this file do?
Either way, it is getting very hard to follow because the code is doing the corrupting past a sysenter call, which of course is *really* hard to follow since that jumps into kernel mode (to link in other system libraries, your d3d wrapper library, etc...) before hopping back, and I cannot debug into of course.
So yes, what is the actual hooking process and what does it do and why is it corrupting global libraries...
EDIT1: Ah hah, I take back the above, it is dieing when hooking, but it is dieing when it is hooking in "..FleetOpsHook.dll", now need to find the entry point into that and figure out where. From the looks it may by dieing while it is still linking it in, even before it runs the library entry function for that dll. Need to examine more (why am I not asleep?).
EDIT2: It appears that the FleetOpsHook.dll file also links in a few other DLL's, one of them is MSCTF.dll (located in the system32 directory), which is odd because I do not see that file located anywhere in the linker map of the library, either way when it is loadlibrary'ed in the loadlibrary function call instruction code points to the above invalid memory, meaning that something is damaging it before that point. If I manually repair the code in-process then I actually get one of your exception boxes throwing an error that I have seen mentioned on these forums before (with no help), let me just copy/paste the relevant parts, hmm, scratch that, your exception box does not support ctrl+c to copy out of it, you should fix that, while typing manually:
[tt]executable = armada2.exe
current module = FleetOpsHook.dll
module date/time = 2009-05-20 17:02
compiled with = Delphi 2006/07
madExcept version = 3.0i beta 2
exception class = EAccessViolation
exception message = Access violation at address 5AD71531 in module 'UxTheme.dll'. Read of address 00000040.[/tt]
And the top of the callstack:
[tt]5ad71531 +00011 UxTheme.dll
5ad79030 +0001f UxTheme.dll IsAppThemed
5a90cb05 +00009 FleetOpsHook.dll GR32_System 446 +0 UseXPThemes
5a90cc57 +00013 FleetOpsHook.dll GR32_System 505 +4 TThemeNexus.OpenVisualStyles
5a90cbee +00022 FleetOpsHook.dll GR32_System 490 +2 TThemeNexus.Create
5a9bcfd8 +00010 FleetOpsHook.dll GR32_System 530 +3 initialization
5a805269 +0003d FleetOpsHook.dll System 161 +0 InitUnits
5a805353 +000bf FleetOpsHook.dll System 161 +0 @StartLib[/tt]
Now, I have a question. Why the heck in the name of anything anyone believes in would you ever possibly have the need to link in UxTheme and query IsAppThemed? I may not have seen the game yet (obviously, will not run after all), but is not the whole thing taking place inside a 3d rendering context? Why would you *ever* need to query things like that?!? I can only guess that TThemeNexus is some new drawing code you made to maybe draw new data in-game or something, have not looked at its code yet, but why on earth would it ever need to query data like that. There are some system files you do not link it, and guess what, UxTheme is one of those! On different systems it has different functionality depending on how they have their windows looking (I use the classic theme, faster drawing, better on memory, etc... and that changes how that library works, it is NOT safe to use that library directly, it is to only be used by windows itself, explorer to be specific, do not use it).
Either way, this got me looking at the hook file in more detail now that I was able to get past it (by having to manually repair the certain section of memory, manually, every time I relaunch the app), and once the hook library is fully loaded it links in a rather monstrous amount of stuff, I means its symbol table it links in is on the order of ungodly monstrous, and I have no clue what most of it would ever be used for in a game like this, or anything for that matter unless you were trying to hook the global operating system and reimplement half of it. Sorry for the rant, but what on earth was the design standard of this file, I could not even imagine the what would have to be *monstrous* code base to create something like this. To get any of my libraries anywhere near this size requires a good multiple hundred thousand lines of code to millions of lines, and considering all the stuff it links in there is no telling what it could possibly be doing to the system. Considering the size of this file I can only guess that you probably reimplement half of the functionality of Armada2 itself inside of it, so I am curious, what does this file do?
posted on May 29th, 2009, 3:28 pm
Last edited by DOCa Cola on May 29th, 2009, 3:33 pm, edited 1 time in total.
Sorry again for my short post (will have more time on monday). The d3d8 wrapper is thrown out by fleetopshook dll which overwrites winmain. Usually it is not possible to unload the static linked d3d8, so i am writing in a - by specification - part of memory where you should not write to. The fleetopshook.dll sets the reference count of the wrapper dll from -1 to 0 or 1 (not sure) so it can be unloaded by unloadlibrary (i got the reference count thing by reverseengeneering (un)loadlibrary - see also documentation about the reference count). I had to do this as hook dlls from apps that allow videorecording of games crashed with the wrapper d3d8 loaded
posted on May 29th, 2009, 4:10 pm
Last edited by OvermindDL1 on May 29th, 2009, 4:22 pm, edited 1 time in total.
Sorry, apparently this forum software does not alert when someone makes a new post while you are doing an edit, so... I added an edit above in my post right before your last one.
So from what you said, the part of the memory that I have to keep fixing each time is the loadlibrary function itself, do you overwrite its code, or at least the jump table location of it? If so that would explain why it is rather horribly corrupted.
Changing the exe of A2 itself to link in another dll and call a function from it to hook 'stuff' only involves adding about 12 or so lines so machine code to it, and I have done that exact thing to other programs many times in the past, would it not be a lot easier, not to mention safer and more correct, to do that instead, or perhaps wrapping a dll that A2 itself uses and nothing else does (seems to be a nice large amount of libraries in that directory after all, the bink library looks like a perfect candidate, just create your own library main function to do what you need, maybe hook a function or two, and forward all other references from the normal bink library into your own so everything is transparently done?).
But yea, this hook library of yours seems to link in a huge amount of stuff, I am wondering what you use it all for?
And what is this TThemeNexus pervading this library, is it a whole new UI system for A2 or something (I have not yet even seen screenshots of this latest version), if so that sounds like a ton of work, I am quite interested to see how it looks, themes based on the race you pick or something?
EDIT1: This is also fascinating. I am placing breakpoints all inside of this hook dll of yours the library main function, the only exposed function I see, etc... None of them are being hit, however I can get into it just fine if I place a breakpoint in a system dll that your hook dll calls and follow it back down the callstack back into your library, this is rather funky weird...
EDIT2: Also, the MSDN documentation on calling IsAppThemed:
And guess what your hook is doing, calling it *during* the library main function. Guess what my OS is, Windows XP. Guess what is happening, yea, exactly, please fix that, or better yet remove it, there is never a need to call that function (or anything else in UxTheme).
The proper way to theme your windows is to add a manifest file that states so, the manifest needs to be at resource ID 24 as I recall, *NEVER* use UxTheme directly... At the very least, do not call that function during Library load time, just like MSDN tells you not to.
So from what you said, the part of the memory that I have to keep fixing each time is the loadlibrary function itself, do you overwrite its code, or at least the jump table location of it? If so that would explain why it is rather horribly corrupted.
Changing the exe of A2 itself to link in another dll and call a function from it to hook 'stuff' only involves adding about 12 or so lines so machine code to it, and I have done that exact thing to other programs many times in the past, would it not be a lot easier, not to mention safer and more correct, to do that instead, or perhaps wrapping a dll that A2 itself uses and nothing else does (seems to be a nice large amount of libraries in that directory after all, the bink library looks like a perfect candidate, just create your own library main function to do what you need, maybe hook a function or two, and forward all other references from the normal bink library into your own so everything is transparently done?).
But yea, this hook library of yours seems to link in a huge amount of stuff, I am wondering what you use it all for?
And what is this TThemeNexus pervading this library, is it a whole new UI system for A2 or something (I have not yet even seen screenshots of this latest version), if so that sounds like a ton of work, I am quite interested to see how it looks, themes based on the race you pick or something?
EDIT1: This is also fascinating. I am placing breakpoints all inside of this hook dll of yours the library main function, the only exposed function I see, etc... None of them are being hit, however I can get into it just fine if I place a breakpoint in a system dll that your hook dll calls and follow it back down the callstack back into your library, this is rather funky weird...
EDIT2: Also, the MSDN documentation on calling IsAppThemed:
Do not call this function during DllMain or global objects contructors. This may cause invalid return values in Windows Vista and may cause Microsoft Windows XP to become unstable.
And guess what your hook is doing, calling it *during* the library main function. Guess what my OS is, Windows XP. Guess what is happening, yea, exactly, please fix that, or better yet remove it, there is never a need to call that function (or anything else in UxTheme).
The proper way to theme your windows is to add a manifest file that states so, the manifest needs to be at resource ID 24 as I recall, *NEVER* use UxTheme directly... At the very least, do not call that function during Library load time, just like MSDN tells you not to.
posted on May 29th, 2009, 4:29 pm
Last edited by DOCa Cola on May 29th, 2009, 4:33 pm, edited 1 time in total.
The fohook uses delphis vlc which is quite heavy fot the ui stuff. A 3rd party component seems to cause the uxtheme.dll issue (gr32 for delphi)
Sure the bink would ne a great candidate, but the guys from a2f files didn't want me to touch any executable files
Edit: i think you even told me that 'the dll is heavy' stuff the last time btw i really like it when you have issues with fo and come to the forums
Sure the bink would ne a great candidate, but the guys from a2f files didn't want me to touch any executable files
Edit: i think you even told me that 'the dll is heavy' stuff the last time btw i really like it when you have issues with fo and come to the forums
posted on May 30th, 2009, 12:37 am
Ah, I remember now that you use Delphi, you mentioned that last time. It is still one of the only language I have never touched (still meant to look at it sometime, I am a heavy C/C++ person primarily). I guess you should edit that third-party component a touch because what they are doing, Microsoft says *DO*NOT*DO*, since what they are doing can, at worst, cause system instability on Windows XP platforms, and even cause issues with Vista.
That function should never really need to be called though, if you want to get the windows theme information (why on earth would you need to?!?) then accessing a certain registry key gives you more info like if it is enabled or not (as that function is supposed to do) and also *what* theme is being used.
What do you need the UI stuff for, are you embedding it into A2 as a new interface? I had been planning to create a texture wrapper for wxWidgets. wxWidgets universal mode does not use system native widgets, meaning you can create your own interface for it, so it would actually be quite easy to embed a wxWidgets gui into a 3d app, seemed like it would always be a fun challenge that no one else has done yet.
You could always patch the A2 executable, or anything else. That means you do not need to package the existing game exe with your distributable, but you still get much more stable prospects. I could help with that if necessary.
Heh, you like it when I come here with all these issues? Sounds like you might be like me, I generally go for the most difficult projects I can find, such as finding and fixing bugs by digging into disassembly (honestly, how many people do you know can even read that stuff as well as actually like doing so ).
I am still curious, what is everything the hook dll does?
That function should never really need to be called though, if you want to get the windows theme information (why on earth would you need to?!?) then accessing a certain registry key gives you more info like if it is enabled or not (as that function is supposed to do) and also *what* theme is being used.
What do you need the UI stuff for, are you embedding it into A2 as a new interface? I had been planning to create a texture wrapper for wxWidgets. wxWidgets universal mode does not use system native widgets, meaning you can create your own interface for it, so it would actually be quite easy to embed a wxWidgets gui into a 3d app, seemed like it would always be a fun challenge that no one else has done yet.
You could always patch the A2 executable, or anything else. That means you do not need to package the existing game exe with your distributable, but you still get much more stable prospects. I could help with that if necessary.
Heh, you like it when I come here with all these issues? Sounds like you might be like me, I generally go for the most difficult projects I can find, such as finding and fixing bugs by digging into disassembly (honestly, how many people do you know can even read that stuff as well as actually like doing so ).
I am still curious, what is everything the hook dll does?
posted on May 30th, 2009, 12:50 am
OvermindDL1 wrote:...and even cause issues with Vista...
What doesn't?
posted on May 30th, 2009, 12:53 am
Adm. Zaxxon wrote:What doesn't?
Heh, true.
Hmm, I wonder if Fleet Ops would run in Wine in Ubuntu... Might give that a try sometime...
posted on May 30th, 2009, 5:51 am
Last edited by OvermindDL1 on May 30th, 2009, 9:35 am, edited 1 time in total.
Hmm, how fun, I got home, started up the test again, and now some Jedi(???) code in the hooks file is throwing out of memory errors on some string function (WStrAsg), which is odd because not really any memory is being used yet...
EDIT1: Got to the point where I can launch now, get your exception dialog box, and I am sending error reports, at least I think I am. I fill out the info, and at the final step the box disappears, no confirmation that it sent or anything, and the odd thing, I saw no packets being transferred on the network, does your reporting thing even work?
Also, by following the code a bit I only see that it pulls data out to make a string, why don't you create a minidump file and send it off instead, it will contain the full callstack, register details, code locations, even sections of the heap if you so tell it. When you run a debugger with the minidump you get the exact state of the program at the time of the crash so you can see exactly how everything is, what it is doing, etc... and so forth. This exception system seems rather inadequate, although considering that it does not even seem to send off anything, unless my packet watching is missing something, I am guessing that it is not yet complete? I have created a powerful exception system that I use that creates a minidump and uploads it to a predefined server, I can let you use it or help you create something similar, it would be a *great* deal more powerful then what you have now.
Either way, it keeps crashing in the WStrAsg function in your hook file now, which you can see if you are getting the reports I have been filling out...
EDIT1: Got to the point where I can launch now, get your exception dialog box, and I am sending error reports, at least I think I am. I fill out the info, and at the final step the box disappears, no confirmation that it sent or anything, and the odd thing, I saw no packets being transferred on the network, does your reporting thing even work?
Also, by following the code a bit I only see that it pulls data out to make a string, why don't you create a minidump file and send it off instead, it will contain the full callstack, register details, code locations, even sections of the heap if you so tell it. When you run a debugger with the minidump you get the exact state of the program at the time of the crash so you can see exactly how everything is, what it is doing, etc... and so forth. This exception system seems rather inadequate, although considering that it does not even seem to send off anything, unless my packet watching is missing something, I am guessing that it is not yet complete? I have created a powerful exception system that I use that creates a minidump and uploads it to a predefined server, I can let you use it or help you create something similar, it would be a *great* deal more powerful then what you have now.
Either way, it keeps crashing in the WStrAsg function in your hook file now, which you can see if you are getting the reports I have been filling out...
posted on May 30th, 2009, 9:47 am
Last edited by DOCa Cola on June 1st, 2009, 12:12 pm, edited 1 time in total.
WOOT! I have been able to launch it! At the very least I get to the main menu, have not yet tried to play it.
First of all, the PATH environment variable, if too long, still causes it to crash (with an out of memory error, what the frick?).
Second, I fixed the bug with the UXTheme.dll problem, and a couple other minor things I ran into. Also, I altered your CRC code a bit so my edits are accepted (that was fun...).
Now, to load it up (with a bat file that changed the environment path variable so it does not insta-die on load, that really needs to be fixed, maybe I will add that to your dll, I found your 'winmain' overloader, a couple long jumps and a couple hundred bytes free of executable area, (and from my profiling there is a huge amount of code in that library that is not ever run, whatever compiler you used, you either need to change your options, or you really need to get a new compiler because dang, that is bad ) and I could have it perma-fix that bug too.
Depending on how the game plays, I will report my results shortly. Also, I love the new menu, never did like all that corner stuff that the normal one did, the new one also feels faster.
EDIT: Yep, just slaughtered the Federation and Klingon as Borg, works fine now. I have attached the altered dll that fixed the uxtheme error and so forth, might let some other people get working without needing to reinstall windows or whatever they have been doing. The attached file is a standard 7zip file, extractable by most uncompressing programs (since the dll by itself is too big to be an attachment without compressing). If Doca Cola does not want this fixed one available, well, he can remove it from my post, he can also compare the machine code to see what I changed (like 4 lines of code I think? I did only the minimal edits necessary to get it operational).
DOCaEdit: Removed the attached file, please get the test patch from this thread: Star Trek Armada II: Fleet Operations - 3.0.7 pre-release - test patch
First of all, the PATH environment variable, if too long, still causes it to crash (with an out of memory error, what the frick?).
Second, I fixed the bug with the UXTheme.dll problem, and a couple other minor things I ran into. Also, I altered your CRC code a bit so my edits are accepted (that was fun...).
Now, to load it up (with a bat file that changed the environment path variable so it does not insta-die on load, that really needs to be fixed, maybe I will add that to your dll, I found your 'winmain' overloader, a couple long jumps and a couple hundred bytes free of executable area, (and from my profiling there is a huge amount of code in that library that is not ever run, whatever compiler you used, you either need to change your options, or you really need to get a new compiler because dang, that is bad ) and I could have it perma-fix that bug too.
Depending on how the game plays, I will report my results shortly. Also, I love the new menu, never did like all that corner stuff that the normal one did, the new one also feels faster.
EDIT: Yep, just slaughtered the Federation and Klingon as Borg, works fine now. I have attached the altered dll that fixed the uxtheme error and so forth, might let some other people get working without needing to reinstall windows or whatever they have been doing. The attached file is a standard 7zip file, extractable by most uncompressing programs (since the dll by itself is too big to be an attachment without compressing). If Doca Cola does not want this fixed one available, well, he can remove it from my post, he can also compare the machine code to see what I changed (like 4 lines of code I think? I did only the minimal edits necessary to get it operational).
DOCaEdit: Removed the attached file, please get the test patch from this thread: Star Trek Armada II: Fleet Operations - 3.0.7 pre-release - test patch
posted on May 31st, 2009, 6:36 pm
the failing code is actually not mine, as is the crash dialog box or crc check. the jedi stuff and so on are 3rd party components like checkboxes or buttons and so on. the delphi compiler seems to link in a lot of code that is not used or only used in cases that can never occur when these components are used. i am glad that i didn't have to develop that ui with just through api calls. i can not set many options on the compiler btw - but this is usually no problem either as that only increases the size of the executable which shouldn't be a problem nowadays.
as far as i know the crash dialog box want's to open your mail program through a call to the windows mapi interface. usually should be working. i have no access to the actual code of the exception box, it's pre-compiled, which makes the dll heavier in disk space either.
thanks for your time looking into this issue. i'll probably take a look into your modified dll tomorrow.
as far as i know the crash dialog box want's to open your mail program through a call to the windows mapi interface. usually should be working. i have no access to the actual code of the exception box, it's pre-compiled, which makes the dll heavier in disk space either.
thanks for your time looking into this issue. i'll probably take a look into your modified dll tomorrow.
posted on June 1st, 2009, 1:00 am
I found that jedi stuff and looked into it, as well as that madchi or whatever stuff. First of all, madchi is looking at things wrong, the standard Windows UI (unless you re-invent your own like he did for whatever reason) is already thread-safe, it technically runs outside the application actually so there are no such issues as he described, maybe with the normal Delphi UI if they broke things, but not C++, it is all thread-safe. And the standard windows api UI calls are not hard, it is a simple COM interface and I use it rather directly quite often to keep my executables small.
And the size of an executable can still be a *big* problem depending on your code. If the code does not fit cleanly into the CPU cache lines (this is mostly important on code that is executed often) then it can mean like the difference between the section of code taking 13us to execute, or 850us to execute (yes, I had that much difference once, really sucked since it was an important part of the code).
And I have no mail app, why do you not just mail it yourself, the exception handler I made for my C++ apps sends off the report by itself just fine, I can help you make a better one if you so wish. But still, all those reports I filled out in detail just... disappeared? How useful...
But still, I am curious, what is everything you have that dll do, it is large...
And the size of an executable can still be a *big* problem depending on your code. If the code does not fit cleanly into the CPU cache lines (this is mostly important on code that is executed often) then it can mean like the difference between the section of code taking 13us to execute, or 850us to execute (yes, I had that much difference once, really sucked since it was an important part of the code).
And I have no mail app, why do you not just mail it yourself, the exception handler I made for my C++ apps sends off the report by itself just fine, I can help you make a better one if you so wish. But still, all those reports I filled out in detail just... disappeared? How useful...
But still, I am curious, what is everything you have that dll do, it is large...
1, 2
Reply
Who is online
Users browsing this forum: No registered users and 21 guests