5/10/2023 0 Comments Delphi xe findinfiles![]() I hope this article gets you started on Delphi’s DCP-File. I just looped with a pattern of 60 Bytes here, that’s why i have an extra character here in front of the last name. Something to note here: The last entry, which is the DPK-Entry seems to have a Header with a length of 61. ![]() So if you’ve done everything right, you can get an output like this: The last element is always the Package-DPK unit. So to get a list of contained units here, you simply skipp 60 Bytes and read 2 strings per element based on the number of contained units in our header. I highlighted theses fields in Green/Brown and Blue/Orange. This pattern goes on with units like “”, where the NameSpace is “Foo.Bar”. ![]() But when your unit is dotted like “Foo.OtherUnit”, it’ll contain “Foo”. When your unit is not dotted, the second string is always empty and consists only of the NULL-Character. The first string is our Unit-Name, the second one seems to be some kind of NameSpace. And 2 zero-terminated strings after each block. To sum it up here, each element of this list contains of a 60 Byte-Blob i haven’t investigated, yet. After that, a list of contained units with their own header follows. So to get a list of required DCPs, you simply read zero-terminated string after zero-terminated string based on the number of required DCPs as noted in our header. This is because it is directly followed by a list of zero-terminated strings which include the names of required DCPs. Right after our BPL-Name, we’ll notice “RTL”. So to sum it up, our header looks like this in Delphi: The Orange box simply contains the lengths in Bytes of the BPL-Name which follows the header (Excluding the terminating NULL-Character). edward koo - thanks for pointing out the delphi 5 incompatibility with the overloaded ZString routines. Wait, we have to units, why does it tell me that there are 3? Quite simple, the DPK-File of your Package (In this case TestPackage.dpk) is included in this list, too. oleg matrozov - thanks for pointing out the missing loop condition (availin > 0) in ZInternalCompress and ZInternalDecompress and for prototyping and assisting with the TZBuffer classes. By fiddling around, you’ll notice that Green is the number of required DCPs and Blue the number of Contained Units. Green and Blue contain numbers, which change depending on the Number of contained Units and required DCPs. The Red-Field is our Signature as discussed before. I have outline the fields i already analyzed and describe them here. So our first 32 Bytes are for sure some kind of Header. By comparing different DCPs, you’ll notice, that the BPL-Name always starts at the same position (Byte 33). And this is the place where you’ll find the final BPL-Name. For example, for VCL150.bpl only a VCL.dcp exists. This is required when dealing with BPLs which have Postfixes. This is the name fo the BPL the linker will link to. YOu may validate this when loading a file to make sure you have a DCP. All DCP seem to start with it, so i declared it as our DCP-Signature. Something you’ll notice is, that the Stream starts with the 4 AnsiChars “PKX0”. Grab a Hex-Editor of your choice and look into it. This should do the job for experimenting. It requires only the RTL and has 2 empty units: MyUnit and Foo.OtherUnit. For analyzing a DCP, i created a new Package, called TestPackage.bpl. So let’s get started with our dirty work. I know that things might have changed from XE to XE8, but i hope this article is still helpfull to get anybody outside of XE started. Some searching didn’t reveal much (besides the same questions as i had). However, to do so, i had to work with DCPs, too. During the last past weeks, i wrote a Project-Analyzationtool, which is able to completely unwire all Unit-Dependencies and fix searchpathes. This includes name of BPL to link with, required DCPs and contained Units. Move up to the Professional edition or above to get additional features including components and drivers for database connectivity, a full commercial development license, and much more.During this Article, I’ll show how to read some very basic information from Delphi’s DCP-Files. For details on the differences between the editions, see the Product Editions page and Feature Matrix. See the Community Edition FAQs for additional details.ĭelphi is available in Community, Professional, Enterprise, and Architect editions. Once your company's total revenue reaches US$5,000, or your team expands to more than five developers, you can move up to an unrestricted commercial license with Professional edition.ĭelphiCE is also perfect for early stage startups who are bootstrapping their product vision before securing capital! Develop your professional app with the Community Edition knowing that you can skip the learning curve your competition faces when building for multiple platforms. If you're a small company or organization with up to US$5,000 per year in revenue, you can also use the Delphi Community Edition. If you're an individual, you may use Delphi Community Edition to create apps for your own use and apps that you can sell until your revenue reaches US$5,000 per year.
0 Comments
Leave a Reply. |