One of the last mysteries of DXL unveiled - the DOORS string table. Despite my earlier attempts to discuss the string table away (https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14549758) I now publish the code, that will allow you to check for DXL programs for string table littering or just roam around the DOORS string table to find all funny things that are in there. Bucket String List [1] "abcd" -> "hello" -> "world" [2] empty [3] "orly?" ... [52021] "yarly!" -> "noway!"
Bucket String ... [3] "orly?" -> "Hello World" ...
string s = "1" int i; for (i = 0; i < 100000; i++) s = s "1"
#include <petools.inc> #include <stringTable.inc> printStringTable () string s = "1" // lets litter the string table int i; for (i = 0; i < 1000; i++) s = s "1" printStringTable () // 1000 strings have been created.
#include <src/test/core/petools.inc>
#include <src/test/core/stringTable.inc>
printStringTable ()
string s = "1"
// lets litter the string table
int i; for (i = 0; i < 1000; i++) {
s = s "1"
// pass the string to the richText perm will persist the string
richText s
// passing it to the length perm will not persist the string
// length s
}
printStringTable ()
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias Mamsch - Fri Sep 14 16:03:40 EDT 2012 |
Re: The DOORS StringTable - Unveiled I am extremely interested in using this tool. Unfortunately, when I include the files you provided I receive the following. String Table coud not be found. I am running DOORS 9.2.0.5 Any assistance you can provide will be greatly appreciated. Thanks |
Re: The DOORS StringTable - Unveiled Doug.Zawacki - Thu Oct 25 09:22:09 EDT 2012 Update, After reviewing the code I modified the lines below which doesn't fail.
if ((doorsInfo infoVersion)[0] == '9') // changed from 8 to 9 and it works
{
p = createPEFile 0x400000
}
else
{
p = createPEFile 0x10000000
}
|
Re: The DOORS StringTable - Unveiled Doug.Zawacki - Thu Oct 25 09:38:04 EDT 2012 Update, After reviewing the code I modified the lines below which doesn't fail.
if ((doorsInfo infoVersion)[0] == '9') // changed from 8 to 9 and it works
{
p = createPEFile 0x400000
}
else
{
p = createPEFile 0x10000000
}
Fortunately due to the memory management in Microsoft Windows an executable has its own address space, so it will almost always be loaded at the same virtual memory address. For the doors.exe executable this is 0x400000. Unfortunately the string table functionality moved from doors.exe to general_library.dll which is located at another base address 0x10000000. I was under the impression that this happened with DOORS 9, but obviously that is not the case in 9.2.0.5. So I guess we would need to find out from what version exactly the string table moved to the dll and adapt the if statement to account for it. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: The DOORS StringTable - Unveiled
I'd also like to thank you for posting this.
// Persist
// string ::[] (Buffer, Range_)
// string ::.. (Buffer, string)
// string stringOf(Buffer)
// richText(string)
// No Persist
// tempStringOf(Buffer)
|
Re: The DOORS StringTable - Unveiled SystemAdmin - Mon Oct 29 09:42:46 EDT 2012
I'd also like to thank you for posting this.
// Persist
// string ::[] (Buffer, Range_)
// string ::.. (Buffer, string)
// string stringOf(Buffer)
// richText(string)
// No Persist
// tempStringOf(Buffer)
Since the string returned from tempStringOf(Buffer) does not persist then you must dispose of it immediately; where "immediately" means before changing or deleting the Buffer. Usually this means:
Buffer buf = create()
void PrintIt(string Label)
{
print Label "\t" (tempStringOf(buf) == stringOf(buf)) "\t[" tempStringOf(buf) "]\t<">\n"
}
buf = "ABCDEFG"; PrintIt("init")
buf += "xyz"; PrintIt("xyz")
length(buf, 4); PrintIt("L4")
buf = ""; PrintIt("erase")
buf += "abcdefg"; PrintIt("abc")
buf += "tuv"; PrintIt("tuv")
setempty(buf); PrintIt("empty")
/* Results:
init true [ABCDEFG] <ABCDEFG>
xyz true [ABCDEFGxyz] <ABCDEFGxyz>
L4 false [ABCDEFGxyz] <ABCD>
erase true []
abc true [abcdefg] <abcdefg>
tuv true [abcdefgtuv] <abcdefgtuv>
empty true [] */
|
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Fri Oct 26 03:35:55 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS I now understand why it must be that my address does not work with your code. We are using a DOORS.EXE (Large Address aware) version. This version of DOORS allows us to address up to 3gb of memory instead of the 2gb limitation. If you need more information please let me know. |
Re: The DOORS StringTable - Unveiled llandale - Mon Oct 29 14:12:38 EDT 2012 Since the string returned from tempStringOf(Buffer) does not persist then you must dispose of it immediately; where "immediately" means before changing or deleting the Buffer. Usually this means:
Buffer buf = create()
void PrintIt(string Label)
{
print Label "\t" (tempStringOf(buf) == stringOf(buf)) "\t[" tempStringOf(buf) "]\t<">\n"
}
buf = "ABCDEFG"; PrintIt("init")
buf += "xyz"; PrintIt("xyz")
length(buf, 4); PrintIt("L4")
buf = ""; PrintIt("erase")
buf += "abcdefg"; PrintIt("abc")
buf += "tuv"; PrintIt("tuv")
setempty(buf); PrintIt("empty")
/* Results:
init true [ABCDEFG] <ABCDEFG>
xyz true [ABCDEFGxyz] <ABCDEFGxyz>
L4 false [ABCDEFGxyz] <ABCD>
erase true []
abc true [abcdefg] <abcdefg>
tuv true [abcdefgtuv] <abcdefgtuv>
empty true [] */
I never heard of a large memory aware version of DOORS. Therefore I have no idea on how to detect this version. It seems that it will locate the DOORS.exe at 0x10000000. If you find out on how to detect this DOORS version from DXL code, feel free to post it ;-)
#include <c:/tmp/petools.inc>
#include <c:/tmp/stringTable.inc>
printStringTable ()
Project p
for p in database do { }
printStringTable ()
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: The DOORS StringTable - Unveiled Are you able to upload the code again for the string table, I'm unable to download the current version? Thank you. |
Re: The DOORS StringTable - Unveiled EHcnck - Wed Sep 24 19:20:27 EDT 2014 Are you able to upload the code again for the string table, I'm unable to download the current version? Thank you. Here you go - but I cannot imagine what problem you got with downloading? The download worked for me ... Please note, that this (and all other hacky code, like MemoryManagement, etc. ) will not work on DOORS 9.6 (64bit), since all memory offsets changed in there due to the word length increase to 8 bytes and due to massive changes inside the interpreter. Regards, Mathias Attachments stringTable.zip |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Thu Sep 25 04:09:56 EDT 2014 Here you go - but I cannot imagine what problem you got with downloading? The download worked for me ... Please note, that this (and all other hacky code, like MemoryManagement, etc. ) will not work on DOORS 9.6 (64bit), since all memory offsets changed in there due to the word length increase to 8 bytes and due to massive changes inside the interpreter. Regards, Mathias What do you think, did IBM reduce the problem or did they only paint it with a different color? |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Thu Sep 25 04:09:56 EDT 2014 Here you go - but I cannot imagine what problem you got with downloading? The download worked for me ... Please note, that this (and all other hacky code, like MemoryManagement, etc. ) will not work on DOORS 9.6 (64bit), since all memory offsets changed in there due to the word length increase to 8 bytes and due to massive changes inside the interpreter. Regards, Mathias Mathias, I have tried downloading your stringTable.zip but it appears to be empty. Given that this was posted 18mths ago I'm not sure whether it has been removed or whether I have an issue at my end. Are you able to repost it or send it to me somehow.
Thanks |
Re: The DOORS StringTable - Unveiled Arlo - Wed Apr 27 05:06:24 EDT 2016 Mathias, I have tried downloading your stringTable.zip but it appears to be empty. Given that this was posted 18mths ago I'm not sure whether it has been removed or whether I have an issue at my end. Are you able to repost it or send it to me somehow.
Thanks I just downloaded the file and it seems to be perfectly fine. This should be some browser or firewall issue on your side. Regards, Mathias |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Wed Apr 27 05:58:36 EDT 2016 I just downloaded the file and it seems to be perfectly fine. This should be some browser or firewall issue on your side. Regards, Mathias Problem solved. It looks like it was a compatibility issue with the unzip utility I was using.
Many thanks Steve |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Thu Sep 25 04:09:56 EDT 2014 Here you go - but I cannot imagine what problem you got with downloading? The download worked for me ... Please note, that this (and all other hacky code, like MemoryManagement, etc. ) will not work on DOORS 9.6 (64bit), since all memory offsets changed in there due to the word length increase to 8 bytes and due to massive changes inside the interpreter. Regards, Mathias Since the hacky code does not work on DOORS 9.6 -- is there any replacement? I liked to use that code when running benchmark tests on my DXL code and will miss it now as we're moving on to 9.6.
Cheers, Rene |
Re: The DOORS StringTable - Unveiled Twonky - Thu Aug 04 03:51:25 EDT 2016 Since the hacky code does not work on DOORS 9.6 -- is there any replacement? I liked to use that code when running benchmark tests on my DXL code and will miss it now as we're moving on to 9.6.
Cheers, Rene I ported the PEFile class to 64 bit, but I need to find a more stable way to locate the string table in memory. This is not so easy and I do not know when I can take time for this. If anyone with good reverse engineering skills wants to chime in, feel free to contact me ;-) Regards, Mathias |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Thu Aug 04 08:01:13 EDT 2016 I ported the PEFile class to 64 bit, but I need to find a more stable way to locate the string table in memory. This is not so easy and I do not know when I can take time for this. If anyone with good reverse engineering skills wants to chime in, feel free to contact me ;-) Regards, Mathias
Therefore you need a doors licence isn't it? |
Re: The DOORS StringTable - Unveiled I tested on DOORS 9.6.0.0 64 Bit. Usage: #include <64bit.inc> #include <petools.inc> #include <stringTable.inc> printStringTable() Exception or other DXL Error = bad. Note: This will not run under any other DOORS version than 9.6 (64 Bit) for now. Consider this experimental and unfinished.
Attachments stringTable64.zip |
Re: The DOORS StringTable - Unveiled Mathias Mamsch - Thu Aug 04 18:30:20 EDT 2016 I tested on DOORS 9.6.0.0 64 Bit. Usage: #include <64bit.inc> #include <petools.inc> #include <stringTable.inc> printStringTable() Exception or other DXL Error = bad. Note: This will not run under any other DOORS version than 9.6 (64 Bit) for now. Consider this experimental and unfinished.
The show just goes on. Is there a solution for DOORS Client 9.6.1.6? I run into this error condition:
int stSearch[] = { 0x50545448 }
int *loc = searchSection(getDOORSPE(), ".data", stSearch)
if (loc == nullPtr) { error "String Table could not be found!"; halt }
Cheers, |
Re: The DOORS StringTable - Unveiled Twonky - Mon Oct 31 05:51:33 EDT 2016 The show just goes on. Is there a solution for DOORS Client 9.6.1.6? I run into this error condition:
int stSearch[] = { 0x50545448 }
int *loc = searchSection(getDOORSPE(), ".data", stSearch)
if (loc == nullPtr) { error "String Table could not be found!"; halt }
Cheers, There sure is. Unfortunately I do not have the time to take care of it currently. Therefore I suggest for debugging 64 bit code stay with DOORS 9.6.0 for now, until someone can find a reliable way to locate the string table in memory. If anyone with some reverse engineering skills wants to some instructions for doing this work, contact me. Regards, Mathias |
Re: The DOORS StringTable - Unveiled Mathias, Thank you for your effort in helping understand the string table. I am using DOORS 9.6.1.6. Is your tool supposed to work with this version? When I try to run this: #include <C:/tmp/64bit.inc> #include <C:/tmp/petools.inc> #include <C:/tmp/stringTable.inc> printStringTable() I am getting this failure: -R-E- DXL: <C:/tmp/stringTable.inc:73> String Table could not be found! -I- DXL: execution halted Thanks |
Re: The DOORS StringTable - Unveiled Gustavo Delfino - Wed Nov 09 10:45:41 EST 2016 Mathias, Thank you for your effort in helping understand the string table. I am using DOORS 9.6.1.6. Is your tool supposed to work with this version? When I try to run this: #include <C:/tmp/64bit.inc> #include <C:/tmp/petools.inc> #include <C:/tmp/stringTable.inc> printStringTable() I am getting this failure: -R-E- DXL: <C:/tmp/stringTable.inc:73> String Table could not be found! -I- DXL: execution halted Thanks As I said - I did not find a reliable way for locating the string table in memory yet for 64 bit versions. The modification I posted seems only to locate the string table correctly for DOORS 9.6.0.0. If someone with reverse engineering skills wants to chime in - currently I cannot find any time for the investigations. Regards, Mathias |