A method and system for automatically generating a CAA secondary development registration information configuration file for a 3DE platform

By constructing hexadecimal feature codes pattern1 and pattern2, the 3DE platform CAA secondary development registration information configuration file is automatically generated, which solves the problem of easy errors in manual configuration and improves development quality and efficiency.

CN118860509BActive Publication Date: 2025-09-26CHANGJIANG SURVEY PLANNING DESIGN & RES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410825637.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-09-26
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

In the existing technology, the registration configuration of CAA components and interfaces of the Dassault 3DE platform relies on manual configuration, which is prone to errors and difficult to parse, resulting in abnormal program operation and algorithm performance becoming a bottleneck in large-scale projects.

Method used

By constructing hexadecimal signature patterns 1 and 2, parsing the registration information of CAA interfaces and components, reverse engineering the registration information from PE files, and automatically generating configuration files, the inefficiency and errors of manual configuration are avoided.

Benefits of technology

The completeness and accuracy of CAA component and interface registration information are achieved, which improves development quality and efficiency, frees up programmers' energy, and enhances the development experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860509B_ABST
    Figure CN118860509B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of three-dimensional design and development, and discloses a method for configuring a registration information configuration file based on a 3DE platform component application architecture. By reversely extracting component and interface registration information from a compiled CAA module PE file, the method realizes automatic creation of the configuration file while ensuring the completeness and accuracy of the registration information, thereby avoiding inefficient manual configuration by programmers, which is prone to omissions or errors. This helps to free up the programmers' energy and time, allowing them to focus on developing business logic implementations and improving the CAA development quality and development experience. Based on the same idea, the present invention also provides a system for automatically generating a 3DE platform CAA secondary development registration information configuration file. The above method is executed through a functional module, which is suitable for use by programmers in the secondary development of the 3DE platform component application architecture (CAA).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of three-dimensional design and development, and specifically discloses a method and system for automatically generating a 3DE platform CAA secondary development registration information configuration file. Background Art

[0002] The Dassault Systemes 3DE platform is the mainstream 3D design and BIM application platform in today's water conservancy and hydropower industry. Featuring four key components: collaborative design, analytical calculations, construction simulation, and business intelligence, it boasts powerful functionality and widespread application. The 3DE platform's secondary development suite consists of CAA+RADE. The CAA component application architecture, developed based on component-oriented programming, enables binary-level reuse and modular development, making it a mainstream approach to large-scale industrial software development. RADE, a plug-in for the Microsoft Visual Studio integrated development environment (IDE), provides CAA development functionality, including code creation, compilation and linking, unit testing, and debugging.

[0003] However, Dassault System Center's CAA components and interfaces are not managed using the Microsoft COM component registry. Instead, they are managed in their own system using specialized registration files. These files are named after the framework they are in, with suffixes like "dic" (for system components) or "dico" (for user components). Interface registration configuration files have suffixes like "iid" to facilitate client registration, discovery, and invocation. Currently, CAA component and interface registration configuration files rely primarily on programmers to configure them. Manual configuration is tedious, prone to omissions and errors, and can even lead to conflicts and duplications, often resulting in program failures and making troubleshooting difficult.

[0004] Conventional thinking suggests that information related to component implementation and interface declarations can be extracted from the CAA module source code, such as through keyword or string retrieval or regular expression pattern matching. However, due to the flexible and rich syntax of C / C++, such as predefined macro expansion, templating, polymorphic inheritance, and encapsulation, the final textual form of the source code is highly uncertain. Direct semantic parsing of the source code to extract information such as component implementation and interface declarations is difficult, placing high demands on the algorithm, and resulting in low completeness and poor accuracy. Furthermore, when the project source code exceeds a certain size, algorithm performance becomes a bottleneck, and parsing efficiency and accuracy are worse than manual operations, making the gains unprofitable. Summary of the Invention

[0005] To overcome the above shortcomings, the present invention provides a method for automatically generating a 3DE platform CAA secondary development registration information configuration file, comprising the following steps:

[0006] Based on the interface prototype declared by the CAA interface, construct the hexadecimal signature pattern 1 of the interface implementation;

[0007] Based on the component prototype declared by the CAA component, construct the hexadecimal signature pattern2 implemented by the component;

[0008] Filter out the CAA dynamic library based on the symbol name in the export table of the target dynamic library's PE file (".dll" or related ".exe" file), and determine its corresponding CAA module based on the CAA dynamic library file name; parse the CAA dynamic library module to obtain the code segment, import table, and export table of the PE file;

[0009] Traverse the export table, find the entry that matches pattern1, and obtain information related to the interface registration, including the name and type of the interface;

[0010] Traverse the import table, obtain the relative address corresponding to the component meta-information registration characteristic symbol, and read the code segment of the corresponding module PE file; traverse the code segment, find the entry that matches pattern2, and obtain information related to component registration;

[0011] Verify the validity of interface and component registration information and write the valid registration information into the corresponding configuration file in a standard format.

[0012] Preferably, the step of searching for an entry matching pattern1 is to retrieve the symbolic name containing pattern1 in the export table; the information related to the interface registration, including the interface name and GUID value extracted from the symbolic name, is written in the standard format of "GUID value + interface name", separated by spaces, where the GUID value is {registry format} and the file name is the framework name + .iid suffix 。

[0013] Preferably, the step of searching for entries matching pattern2 is to retrieve function cross-references containing the relative address of pattern2 in the code segment; the component registration-related information includes the component main class name and component extension class name parsed through function cross-references, and the interface name derived through the symbol name containing the component declaration symbol in the export table.

[0014] Preferably, the method for retrieving the function cross-reference containing the relative address of pattern2 in the code segment includes setting the traversal step size to 0x10 and searching in sequence.

[0015] Preferably, the method of retrieving function cross-references containing the pattern2 relative address in the code segment includes searching only for functions whose function call parameters are greater than or equal to 0x38.

[0016] Based on the same idea, the present invention also provides a system for automatically generating a 3DE platform CAA secondary development registration information configuration file, including the following functional modules:

[0017] The signature construction module is used to construct a hexadecimal signature pattern 1 of the interface implementation based on the interface prototype declared by the CAA interface; and to construct a hexadecimal signature pattern 2 of the component implementation based on the component prototype declared by the CAA component;

[0018] The registration information acquisition module is used to filter out the CAA dynamic library based on the symbol name in the export table of the PE file of the target dynamic library, and determine the corresponding CAA module based on the CAA dynamic library file name; parse the CAA dynamic library module to obtain the code segment, import table and export table of the PE file; traverse the export table to find the entry that matches pattern1 and obtain information related to interface registration, including the name and type of the interface; traverse the import table to obtain the relative address corresponding to the component meta-information registration characteristic symbol and read the code segment of the corresponding module PE file; traverse the code segment to find the entry that matches pattern2 and obtain information related to component registration;

[0019] The registration information writing module is used to verify the validity of interface and component registration information and write the valid registration information into the corresponding configuration file in a standard format.

[0020] Preferably, the step of searching for entries matching pattern1 is to retrieve the symbolic name containing pattern1 in the export table; the information related to the interface registration, including the interface name and GUID value extracted from the symbolic name, is written in the standard format of: "GUID value + interface name", separated by spaces, where the GUID value is {registry format} and the file name is the framework name + .iid suffix.

[0021] Preferably, the step of searching for entries matching pattern2 is to retrieve function cross-references containing the relative address of pattern2 in the code segment; the component registration-related information includes the component main class name and component extension class name parsed through function cross-references, and the interface name derived through the symbol name containing the component declaration symbol in the export table.

[0022] Preferably, the method for retrieving the function cross-reference containing the relative address of pattern2 in the code segment includes setting the traversal step size to 0x10 and searching in sequence.

[0023] Preferably, the method of retrieving function cross-references containing the pattern2 relative address in the code segment includes searching only for functions whose function call parameters are greater than or equal to 0x38.

[0024] Compared with the prior art, the present invention produces the following beneficial effects:

[0025] The present invention reversely extracts component and interface registration information from the compiled CAA module PE file. While ensuring the completeness and accuracy of the registration information, it realizes the automatic creation of configuration files, avoiding the inefficient manual configuration by programmers, which is prone to omissions or errors. This helps to free up programmers' energy and time, allowing them to focus on developing business logic implementation, improving CAA development quality and development experience, and has good practicality.

[0026] Since reverse analysis belongs to a traditional unpopular technical field, the machine code composed of hexadecimal converted from binary is difficult to understand, the learning threshold is high, it is difficult to get started, and the actual application scenarios are very limited. Direct technical implementation is very difficult. However, the technical solution of this application takes a different approach. By developing auxiliary plug-ins with the help of C / C++ related programming languages, it can well complete the CAA component and interface information parsing, has low requirements for operators, and can easily realize the automatic construction of component configuration files. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a schematic diagram of the process of retrieving a CAA module based on a PE file in an embodiment of the present invention;

[0028] Figure 2 1 is a flow chart of automatically generating an interface registration information configuration file according to an embodiment of the present invention;

[0029] Figure 3 This is a schematic diagram of the algorithm flow for building a component expansion set in an embodiment of the present invention;

[0030] Figure 4 It is a flow chart of generating a component registration information configuration file based on extended set data in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings. The described embodiments are part of the embodiments of the present invention, but not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any innovative efforts shall fall within the scope of protection of the present invention.

[0032] In conjunction with the instructions Figure 1-4 The specific steps of a method for automatically generating a 3DE platform CAA secondary development registration information configuration file are as follows:

[0033] Step 1: Build with CAA framework Framwork as the unit and traverse to obtain all dynamic libraries under the current framework.

[0034] Step 2: Determine whether the target dynamic library PE file is a CAA dynamic library. See the flowchart Figure 1 As shown, the detailed steps are:

[0035] ① Read the PE file and get the export table;

[0036] ② Traverse the export table, obtain the symbol name, and compare whether it has the CAA landmark symbol (module identification symbol unique to the Dassault 3DE platform):

[0037] DASSAULT_SYSTEMES_CAA2_LICENSING_***, where *** is the module name.

[0038] ③If the above-mentioned characteristic features exist, indicating that it is a CAA module, return true; otherwise, return false.

[0039] Step 3: If it is a CAA module, search for the interface registration information. Figure 2 , the detailed steps are:

[0040] ① Read the module PE file and obtain the export table;

[0041] ② Traverse the export table, obtain the symbol name, and compare whether there is an interface declaration symbol? IID_***@@3U_GUID@@A (converted into the corresponding hexadecimal feature code, it is pattern 1 mentioned in the invention content), where *** is the interface name, IID is the prefix, and GUID is the type.

[0042] ③If an interface declaration symbol exists, obtain the interface name, such as IntfName; then traverse the export table and search for the interface metadata class feature symbol——

[0043] Check whether "?MetaObject@***@@SAPEAVCATMetaClass@@XZ" exists, where *** is the interface name.

[0044] ④ If the interface metadata symbol also exists, it indicates that the interface is valid. Read the data pointed to by the interface declaration symbol (relative virtual address rva) to obtain the 16-byte GUID unique identifier;

[0045] ⑤Convert the parsed information into an interface registration item. The registration item format is "GUID value + interface name", separated by spaces. The GUID is in the registry format with curly braces {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. The example is as follows:

[0046] {23e479a6-2385-40bf-9b91-f9356d59d6ed}MyIntf

[0047] ⑥ Write the interface registration item into the Framwork framework interface registration file. The file name is the framework name + .iid suffix. If an interface registration item already exists, a warning will be prompted and it will be overwritten; if it does not exist, it will be added.

[0048] Step 4: If it is a CAA module, continue searching for component registration information. Since component registration information consists of a triplet of component main class name, interface, and extension class, it is parsed in two steps:

[0049] Step 4.1: Build component extension set, see Figure 3 As shown, the detailed steps are:

[0050] ① Read the module PE file and obtain the import table import.

[0051] ② Traverse the import table and obtain the component meta-information registration feature symbol - JS0GROUP.dll! The relative address corresponding to fct_RetrieveMetaObject.

[0052] ③Read the module PE file and obtain the code segment text.

[0053] ④ Traverse the code segment and search for the function cross-reference of the relative address of the characteristic symbol. The characteristic code is 0xFF 0x150x00 0x00 0x00 0x00 (i.e. pattern 2 mentioned in the invention content of the specification), and the last four bytes are the offset relative offset;

[0054] To improve search performance, two optimization methods are used in combination. Method 1 sets the traversal step size to 0x10, as the x64 (64-bit processor architecture) fast calling convention aligns the RSP (register pointer) with memory. Method 2 first searches for 0x480x830xEC**, where ** represents the number of function parameters. This method only searches for functions with call parameters greater than or equal to 0x38. This method eliminates 60% of invalid traversals and significantly improves search efficiency.

[0055] ⑤ If the feature symbol cross-reference XRef is found, parse the string parameters corresponding to the rcx and r9 registers, which are the component extension name ExtClass and the component main class name MainClass respectively, and save them to the component extension set Set for subsequent query use.

[0056] Step 4.2: Build component registration information, see the flowchart Figure 4 As shown, the detailed steps are:

[0057] ① Read the module PE file and obtain the export table.

[0058] ② Traverse the export table, obtain the symbol name, and compare whether there is a component declaration symbol CreateTIE*** or CreateBOA***, where *** is the component intermediate class name, which is spliced ​​from the interface name ItfClass and the extension name ExtClass.

[0059] ③ From the component extension set Set obtained in Step 4.1, traverse and query the component main class name MainClass mapped by the extension name ExtClass; if the result exists, it indicates that the component registration item is valid, and use ExtClass to split the intermediate class name to obtain the interface name ItfClass. At this point, the component main class name, extension name, interface name and other information are fully obtained.

[0060] ④ Convert the parsed information into component registration items in the format of "main class name + interface name + module name (lib prefix, without .dll suffix)", separated by spaces, as shown below:

[0061] MainClass ItfClass libModname

[0062] ⑤Write the component registration items into the framework component registration file. The file name is the framework name + .dico suffix. If a component registry item already exists, a warning will be prompted and it will be overwritten; if it does not exist, it will be added.

[0063] A system for automatically generating a 3DE platform CAA secondary development registration information configuration file simply uses a virtual module to express the above method. The basic content remains unchanged, and the embodiments of the system will not be described in detail here.

[0064] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computers containing computer-usable program code, or on available storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.).

[0065] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0066] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0068] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for automatically generating a 3DE platform CAA secondary development registration information configuration file, characterized in that The following steps are involved: According to the interface prototype of the CAA interface declaration, the interface declaration symbol is converted into the corresponding hexadecimal feature code, which is pattern 1; Based on the component prototype declared by the CAA component, construct the hexadecimal signature code 0xFF 0x150x00 0x000x00 0x00 implemented by the component, which is pattern 2. The last four bytes are the relative offset. Filter out the CAA dynamic library based on the symbol name in the export table of the PE file of the target dynamic library, and determine its corresponding CAA module based on the CAA dynamic library file name; parse the CAA dynamic library module to obtain the code segment, import table, and export table of the PE file; Traverse the export table, find the entry that matches pattern1, and obtain information related to the interface registration, including the name and type of the interface; Traverse the import table, obtain the relative address corresponding to the component meta-information registration characteristic symbol, and read the code segment of the corresponding module PE file; traverse the code segment, find the entry that matches pattern2, and obtain information related to component registration; Verify the validity of interface and component registration information and write the valid registration information into the corresponding configuration file in a standard format.

2. The method for automatically generating a 3DE platform CAA secondary development registration information configuration file according to claim 1, characterized in that: The step of searching for entries matching pattern1 is to retrieve the symbolic name containing pattern1 in the export table; the information related to the interface registration, including the interface name and GUID value extracted from the symbolic name, is written in the standard format of "GUID value + interface name", separated by spaces, where the GUID value is {registry format} and the file name is the framework name + .iid suffix.

3. The method for automatically generating a 3DE platform CAA secondary development registration information configuration file according to claim 2, characterized in that: The step of searching for entries matching pattern2 is to retrieve function cross-references in the code segment containing the relative address of pattern2; the component registration-related information includes the component main class name and component extension class name parsed through function cross-references, and the interface name derived through the symbol name containing the component declaration symbol in the export table.

4. The method for automatically generating a 3DE platform CAA secondary development registration information configuration file according to claim 3, characterized in that: The method of searching for the function cross-reference having the relative address of pattern2 in the code segment includes setting the traversal step size to 0x10 and searching in sequence.

5. The method for automatically generating a 3DE platform CAA secondary development registration information configuration file as claimed in claim 3, characterized in that: The method of retrieving function cross-references in the code segment that have a relative address of pattern2 includes searching only for functions whose function call parameters are greater than or equal to 0x38.

6. A system for automatically generating a 3DE platform CAA secondary development registration information configuration file, characterized in that: Includes the following functional modules: The signature construction module is used to convert the interface declaration symbol into the corresponding hexadecimal signature code (pattern 1) based on the interface prototype declared by the CAA interface. It also constructs the component implementation hexadecimal signature code 0xFF 0x15 0x00 0x00 0x00 0x00 (pattern 2) based on the component prototype declared by the CAA component. The last four bytes are the relative offset. The registration information acquisition module is used to filter out the CAA dynamic library based on the symbol name in the export table of the PE file of the target dynamic library, and determine the corresponding CAA module based on the CAA dynamic library file name; parse the CAA dynamic library module to obtain the code segment, import table and export table of the PE file; traverse the export table to find the entry that matches pattern1 and obtain information related to interface registration, including the name and type of the interface; traverse the import table to obtain the relative address corresponding to the component meta-information registration characteristic symbol and read the code segment of the corresponding module PE file; traverse the code segment to find the entry that matches pattern2 and obtain information related to component registration; The registration information writing module is used to verify the validity of interface and component registration information and write the valid registration information into the corresponding configuration file in a standard format.

7. The system for automatically generating a 3DE platform CAA secondary development registration information configuration file as claimed in claim 6, characterized in that: The step of searching for entries matching pattern1 is to retrieve the symbolic name containing pattern1 in the export table; the information related to the interface registration, including the interface name and GUID value extracted from the symbolic name, is written in the standard format of "GUID value + interface name", separated by spaces, where the GUID value is {registry format} and the file name is the framework name + .iid suffix.

8. The system for automatically generating a 3DE platform CAA secondary development registration information configuration file as claimed in claim 7, characterized in that: The step of searching for entries matching pattern2 is to retrieve function cross-references in the code segment containing the relative address of pattern2; the component registration-related information includes the component main class name and component extension class name parsed through function cross-references, and the interface name derived through the symbol name containing the component declaration symbol in the export table.

9. The system for automatically generating a 3DE platform CAA secondary development registration information configuration file as claimed in claim 8, characterized in that: The method of searching for the function cross-reference having the relative address of pattern2 in the code segment includes setting the traversal step size to 0x10 and searching in sequence.

10. The system for automatically generating a 3DE platform CAA secondary development registration information configuration file according to claim 8, characterized in that: The method of retrieving function cross-references in the code segment that have a relative address of pattern2 includes searching only for functions whose function call parameters are greater than or equal to 0x38.

Citation Information

Patent Citations

  • Fully automatic module integration system and method based on component factory

    CN105487850A

  • Template management method and system based on 3DPerience platform

    CN116451498A