I am still trying to solve the infinite loop problem I reported earlier,
but I am running into some difficulty debugging it further. Note: I am
new to debugging and could be making a lot of mistakes.
To compile, I disbaled optimizations by removing the -O2 parameters from
the configure file and used:
./configure --disable-lib
make depend
make
Then "make install" as root.
I used the following command to launch the app:
winedbg -managed -debugmsg +reg,+relay,+module,+win32,+advapi
"/dos/Program Files/MathType/MathType.exe" &>mathtype.log
The entire log file can be found at:
ftp://ftp.mindspring.com/users/jimshep/mathtype.log.gz
Here are what I believe to be the relevant lines:
Call advapi32.227: RegOpenKeyExA(80000001,41012d90 "Software\\Design
Science\\DSMT4\\Config",00000000,00020019,409168cc) ret=00468b11 fs=008f
trace:reg:RegOpenKeyExA (0x80000001,"Software\\Design
Science\\DSMT4\\Config",0,20019,0x409168cc)
Ret advapi32.227: RegOpenKeyExA() retval=00000000 ret=00468b11 fs=008f
Call advapi32.235: RegQueryValueExA(0000003c,004ac7c4
"AppLang",00000000,409168bc,4091686c,409168b8) ret=00468b3f fs=008f
trace:reg:RegQueryValueExA
(0x3c,"AppLang",(nil),0x409168bc,0x4091686c,0x409168b8=50)
In the debugger, I used "x /d 0x409168bc" to find the lpType. The
output is 0, the default, which I understand is a string. I then used
"x /s 0x4091686c" to find lpData. The output was à*`A#(@ (It should
read "0x040,enu". I used the same debug commands on previous
RegQueryValueExA calls and was able to see the appropriate keys. Are
these commands incorrect in this case, or is the function returning the
wrong data?
Ret advapi32.235: RegQueryValueExA() retval=00000000 ret=00468b3f
fs=008f
Call advapi32.204: RegCloseKey(0000003c) ret=00468b57 fs=008f
trace:reg:RegCloseKey (0x3c)
Ret advapi32.204: RegCloseKey() retval=00000000 ret=00468b57 fs=008f
Call kernel32.425: GetUserDefaultLCID() ret=00468f66 fs=008f
Ret kernel32.425: GetUserDefaultLCID() retval=00000409 ret=00468f66
fs=008f
Call kernel32.342: GetLocaleInfoA(00000409,00000003,4091677c,000000ff)
ret=004281c2 fs=008f
Ret kernel32.342: GetLocaleInfoA() retval=00000004 ret=004281c2 fs=008f
Call kernel32.534: MultiByteToWideChar(00000000,00000000,4091677c
"ENU",ffffffff,41012e10,00000004) ret=004026bd fs=008f
Ret kernel32.534: MultiByteToWideChar() retval=00000004 ret=004026bd
fs=008f
Call kernel32.727: WideCharToMultiByte(00000000,00000000,40916898
L"ENU",ffffffff,41012ea0,00000007,00000000,00000000) ret=004026dc
fs=008f
Ret kernel32.727: WideCharToMultiByte() retval=00000004 ret=004026dc
fs=008f
Call kernel32.250: FindFirstFileA(41012190 "C:\\Program
Files\\MathType\\Language\\MT4ENU.DLL",40916618) ret=0048c8c9 fs=008f
Ret kernel32.250: FindFirstFileA() retval=ffffffff ret=0048c8c9 fs=008f
I believe that this call should be looking for mswenu.dll or *enu.dll
instead of MT4ENU.DLL since there are no files beginning with MT4 in
that directory and the file mswenu.dll is the only one with the enu
suffix. I tried to find any calls in the log file that have written
anything to the addresses between 0x41012190 and the end of the string,
but was notable to find any. How do I find out how the string that
starts at 0x41012190 was created?
The rest of the log shows the looping problem.
I also noticed that a couple of the links on the website, under the
References page need to be updated:
Microsoft link to win32 api:
http://msdn.microsoft.com/library/psdk/portals/win32start_1n6t.htm
Overview:
http://msdn.microsoft.com/library/psdk/buildapp/win32api_7f8p.htm
Reference:
http://msdn.microsoft.com/library/psdk/psdkref/alphafunc_3bjm.htm
Thanks for the help,
Jim Shepherd
[EMAIL PROTECTED]