| 1. General description 2. Functions you can implement 3. Functions you can call |
Automate investigative tasks and extend the
functionality of X-Ways Forensics with X-Tensions.
The information below applies to X-Ways
Forensics 16.4 SR-3 and later, except where noted.
|
| Executive summary | The X-Ways Forensics X-Tensions API (application programming interface) allows you to use many of the advanced capabilities of the X-Ways Forensics computer software programmatically and extend them with your own functionality. For example, you could implement some specialized file carving for certain file types, automated triage functionality, alternative report generation, or automatically filter out unwanted search hits depending on your requirements etc. Among other things, X-Tensions allow you to:
You can use your programming language of choice, e.g. C++, Delphi, Visual Basic, VB.NET, Python, and do not have to learn any new scripting language. You can use your compiler of choice, for example Visual Studio Express (freeware, more information). Since an extension is not an interpreted script, but regular compiled executable code that is running in the address space of the application itself, you can expect highest performance, the same as with internally implemented functionality in X-Ways Forensics. X-Tensions give you easy and direct access to crucial and powerful functions deep inside our software. When X-Tensions functions can get called:
|
| Legalities |
You may distribute X-Tensions that you compile and/or their source code (ideally both) free of charge or even for a fee, under whatever license terms you see fit. X-Ways does not require any royalty payment. However, you have to accept that the terms, the functionality and the availability of the XWF X-Tensions API/engine may change in future versions of X-Ways Forensics. You are encouraged to submit your XWF extensions for download from the X-Ways web site. X-Ways does not check third party X-Tensions and will not be responsible for their quality or any damage caused by them. Please be advised that X-Tensions are executable files that run with the same rights as X-Ways Forensics and could be malware. |
| Technical details |
Your code needs to be compiled as a DLL, which will be loaded by X-Ways Forensics at run time. In each DLL you have to implement (and export) one or more out of the below-mentioned functions. Which function(s) you implement depends for example on when exactly you would like X-Ways Forensics to call them, such as either at the start or end of the volume snapshot refinement, dealing with the volume or the volume snapshot as a whole, or for each item in the volume snapshot separately when refining it. This part of the API is like a framework based on the Hollywood principle "don't call us, we call you". All exported X-Tension functions and internal XWF API functions use stdcall calling conventions under 32 bit. The API is available only in v16.4 and later of X-Ways Forensics and in the WinHex add-on for X-Ways Forensics, both 32-bit and 64-bit. 32-bit X-Tension DLLs should be placed in the same directory where X-Ways Forensics is run from, 64-bit DLLs in the \x64 subdirectory. The name of the DLL should be descriptive. For use in v16.4 should start with "XT" and must be less than 32 ASCII characters long. The data types used are described here. Up to 8 X-Tensions can be run simultaneously when refining the volume snapshot. Simultaneous instead of subsequent execution is not only convenient, but also saves time if each X-Tension opens and reads from all the files in the volume snapshot one after the other as caching is improved and no time is wasted on multiple identical open/close file operations. The X-Tensions DLL gets unloaded as soon as the overall operation has completed, so that when you are debugging your DLL, you can recompile it (overwrite the previous built) while X-Ways Forensics is still running. |
| Downloads |
C++ function definitions Sample X-Tension 1: 32-bit version, 64-bit version (outputs a few messages when refining the volume snapshot, filters out search hits, just for programmers of X-Tensions, not useful in the real world) Sample X-Tension 2: 32-bit version (creates a virtual file in the volume snapshot as a child object of another file, just for programmers of X-Tensions, not useful in the real world)
Luhn credit card check (last updated April 13, 2012): 32-bit version,
64-bit version
C++ source code |
| Submission | When you submit an
X-Tension (contact us), please
describe:
|
| X-Tension functions that you may export | Description |
|---|---|
| LONG
XT_Init( DWORD nVersion, DWORD nFlags, HANDLE hMainWnd PVOID lpReserved ); |
Mandatory to export. Will be called before anything else happens, to inform the DLL of the version of X-Ways Forensics that is loading the DLL. You may return -1 to prevent further use of the DLL, for example if certain functions that you require are not present (i.e. exported by a certain version of X-Ways Forensics). Otherwise you must return 1. nVersion: The higher word specifies the version number. For example 1640 means v16.4. The third highest byte specified the service release number. The lowest byte indicates the current language of the user interface of the calling program. nFlags: hMainWnd: Handle of the main window. lpReserved: Currently always NULL. |
|
LONG
XT_Done( PVOID lpReserved ); |
If exported (optional), will be called just before the DLL is unloaded to give you a chance to dispose any allocated memory, save certain data permanently etc. You should return 0. nReserved: currently always NULL. |
|
LONG
XT_About( HANDLE hParentWnd PVOID lpReserved ); |
If exported (optional), will be called when the user requests to see information about the DLL. You can display copyright notices, a version number, a brief description of the exported functionality, extensive help on how to use it, from where in X-Ways Forensics to call it with what settings etc. etc. You could even display a dialog window where the user can change settings for this X-Tension, which you store in the Windows registry or in a permanent file. You should return 0. nReserved: currently always NULL. |
| LONG
XT_Prepare( HANDLE hVolume, HANDLE hEvidence, DWORD nOpType, PVOID lpReserved ); |
If exported (optional), will be called immediately for a volume when volume snapshot refinement or some other action starts before items or search hits are processed individually.
Possible negative return values:
Positive return values/combination of flags: Full return value evaluation only for XT_ACTION_RVS. hEvidence, nReserved: currently always 0. nOpType: |
| LONG
XT_Finalize( HANDLE hVolume, HANDLE hEvidence, DWORD nOpType, PVOID lpReserved ); |
If exported (optional), will be called when volume snapshot refinement or another operation has completed. Return 0.
nOpType: see above |
| LONG
XT_ProcessItem( LONG nItemID, PVOID lpReserved ); |
If exported (optional), will be called for each file in the volume snapshot that is targeted for refinement or selected and targeted with the directory browser context menu. Implement and export this function if you merely need to retrieve information about the file and don't need to read its data. There is a slight performance benefit if the user does not select other refinement operations that do need to open the item and read its data, i.e. you save a little bit time if a file does not need to opened for reading. If XWF_OpenItem is implemented, you can still open the file to read its data if needed. Return -1 if you want X-Ways Forensics to stop the current operation (e.g. volume snapshot refinement), -2 if you want have X-Ways Forensics skip all other volume snapshot refinement operations for this file, otherwise 0. nReserved: currently always 0. |
| LONG
XT_ProcessItemEx( LONG nItemID HANDLE hItem, PVOID lpReserved ); |
If exported (optional), will be called for each item (file or directory) in the volume snapshot that is targeted for refinement or selected and targeted with the directory browser context menu. The item will be opened for reading prior to the function call. Implement and export this function if you need to read the item's data. Return -1 if you want X-Ways Forensics to stop the current operation (e.g. volume snapshot refinement), otherwise 0. nReserved: currently always 0. |
| LONG
XT_ViewFile( ... ); |
For potential future use. If exported (optional), will be called for each file that is to be viewed in a separate window or in Preview mode. The X-Tension can provide a human-readable representation of a binary file for example as plain text or HTML, or any other file format understood by the viewer component. Return 0 if you do not want to be responsible for providing a representation for this file, -1 if you want to indicate that an error occurred, 1 to signal success. |
| LONG
XT_ProcessSearchHit( struct SearchHitInfo* Info ); #pragma pack(2) struct SearchHitInfo { LONG iSize; LONG nItemID; LARGE_INTEGER nRelOfs; LARGE_INTEGER nAbsOfs; PVOID lpOptionalHitPtr; WORD nSearchTermID; WORD nLength; WORD nCodePage; WORD nFlags; HANDLE hOptionalItemOrVolume }; |
If exported (optional), will be called for each search hit, either when it is found or, in a future version of X-Ways Forensics, later if selected by the user in a search hit list. Return 0, except if you want X-Ways Forensics to abort the search (return -1) or if you want X-Ways Forensics to stop calling you (return -2). This function is not called if the search was initiated by the X-Tension itself (via XWF_Search).
iSize: Size of the record. The
record is packed. Currently In future versions of the API the record may be
larger if more fields are provided. |
| API functions that you may call | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Disk and I/O Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LARGE_INTEGER XWF_GetSize( HANDLE hVolumeOrItem, LPLARGE_INTEGER lpValidDataLen, ); |
Returns the size of a volume or the newly detected full size of the item (which may be different from the size that was known of the item before) and optionally retrieves the initialized size of the data stream of an item (valid data length, which may be available from NTFS, exFAT, and XWFS). Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_GetVolumeName( HANDLE hVolume, LPWSTR lpString, DWORD nType ); |
Retrieves the name of the volume in UTF-16, 255 characters at most. 3 types of names are available (1, 2 or 3). For example, 3 can be more generic than 2 ("Hard disk 1" instead of "WD12345678"). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID
XWF_GetVolumeInformation( HANDLE hVolume, LPLONG lpFileSystem, LPDWORD lpBytesPerSector, LPDWORD lpSectorsPerCluster, PLARGE_INTEGER lpClusterCount, PLARGE_INTEGER lpFirstClusterSectorNo, ); |
Retrieves various information about the volume. All parameters are optional.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOOL
XWF_GetSectorContents( HANDLE hVolume, LARGE_INTEGER nSectorNo, LPWSTR lpDescr, LPLONG lpItemID ); |
Retrieves information about a certain sector on a volume. Returns FALSE if the sector belongs to an unused/free cluster, otherwise TRUE. lpDescr: Retrieves a textual description of what this sector is used for. Can be the name and path of a file or something like "FAT 1". May be language specific. Use a buffer that has space for 511 characters and a terminating null. lpItemID: Optional. Retrieves the ID of the item in the volume snapshot that the sector is allocated to, if any, otherwise -1. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE XWF_OpenVolume( HANDLE hEvidence ); |
Opens the volume that is represented by the specified evidence object. Although we use the term "volume" here, it might just as well be a partitioned disk or an image of a partitioned disk or an image of a volume or a memory dump or a directory. Depends on the nature of the evidence object. That that from a remote network drive or from a disk opened without administrator rights or from a directory you cannot read any sectors. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE XWF_OpenItem( HANDLE hVolume, LONG nItemID, DWORD nFlags, ); |
Available in v16.5 and later. Opens the file or directory that is contained in the specified volume and that has the specified ID for reading. Set the 0x01 flag to open the item including its file slack space, if it has any. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID XWF_Close( HANDLE hVolumeOrItem ); |
Available in v16.5 and later. Closes a volume that was opened with the XWF_OpenVolume function or an item that was opened with the XWF_OpenItem function. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DWORD XWF_Read( HANDLE hVolumeOrItem, LARGE_INTEGER nOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, ); |
Reads the specified number of bytes from the specified position in the specified volume or item into the specified buffer. Returns the number of bytes read. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LARGE_INTEGER XWF_Write( HANDLE hVolume, LARGE_INTEGER nOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToWrite, ); |
Writes the specified number of bytes in the specified buffer at the specified position to the specified volume. Works only in WinHex, not in X-Ways Forensics. Returns the number of bytes written, or -1 if a complete failure occurred. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Evidence Object/Case Management Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE
XWF_GetFirstEvObj( LPVOID pReserved ); |
Retrieves the first evidence object in the case. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE
XWF_GetNextEvObj( HANDLE hEvidence ); |
Retrieves the next evidence object in the chain. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE
XWF_DeleteEvObj( HANDLE hEvidence ); |
Removes the specified evidence object from the case. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE
XWF_CreateEvObj( DWORD nType LONG nDiskID, LPWSTR lpPath, PVOID pReserved ); |
Available in v16.5 and later. Creates one or more evidence objects from one source (which can be a medium, disk/volume image, memory dump, or a directory/path) andd returns the first evidence object created, or NULL in case of an error. A case must already be loaded. If more than 1 evidence object is created (for example for a physical disk that contains partitions, which count as evidence objects themselves), use XWF_GetNextEvObj to find them.
nType: nDiskID: 3 for drive letter C:, 4 for drive letter D:, etc.; -3 for physical hard disk 0, -4 for physical hard disk 1, etc., currently must be 0 for an image, memory dump, or directory lpPath: Path in case of a file or directory, otherwise NULL. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LARGE_INTEGER
XWF_GetEvObjProp( HANDLE hEvidence, LONG nPropType, PVOID pBuffer, LONG nBufSize ); |
Retrieves information about the specified evidence object. The buffer size for strings is to be specified in characters (UTF-16), otherwise in bytes. Not currently implemented.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LONG
XWF_SetEvObjProp( HANDLE hEvidence, LONG nPropType, PVOID pBuffer, ); |
Sets information about the specified evidence object. See above for possible values of nPropType. Only those marked * cannot be used with this function. Strings must be null-terminated. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Volume Snapshot Management Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID
XWF_SelectVolumeSnapshot( HANDLE hVolume ); |
Defines to which volume's volume snapshot subsequent calls of the below functions apply if you wish to change that. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_GetItemCount( LPVOID pReserved ); |
Retrieves the number of items in the volume snapshot (files and directories). Item IDs are consecutive 0-based. That means the ID of the first item has the ID 0 and the last item in a volume snapshot has the ID (GetItemCount-1). You address each and every item in that range, be it a file or directory, by specifying its ID. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_GetSpecialItemID( DWORD nSpecialItem ); |
Returns the ID of a special item in the volume snapshot, or -1 if the requested special item is not present in the volume snapshot. Useful when adding more items to the volume snapshot that need to have a parent. nSpecialItem: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DWORD
XWF_GetVSHashType( HANDLE hEvidence ); |
Retrieves the type of the hash values that the items in the volume snapshot of the specified evidence objects have. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_CreateItem( LPWSTR lpName, DWORD nCreationFlags ); |
Creates a new item (file or directory) in the volume snapshot. May be called when refining the volume snapshot. Returns the ID of the newly created item, or -1 if an error occurred (e.g. out of memory). Should be followed by calls to XWF_SetItemParent, XWF_SetItemInformation, and/or XWF_SetItemOfs. nCreationFlags: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_AttachExternalFile( LPWSTR lpExternalFilePath, LPWSTR lpName, DWORD nCreationFlags ); |
Adds an external file to the volume snapshot. Returns the ID of the newly created item, or -1 if an error occurred (e.g. out of memory). Should be followed by a call to XWF_SetItemParent and XWF_SetItemInformation. Not currently implemented. nCreationFlags: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Volume Snapshot Item Property Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LPWSTR
XWF_GetItemName( LONG nItemID ); |
Retrieves a pointer to the null-terminated name of the specified item (file or directory) in UTF-16. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID
XWF_SetItemName( LONG nItemID, LPWSTR lpName ); |
Renames an item. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LARGE_INTEGER
XWF_GetItemSize( LONG nItemID ); |
Retrieves the size of the item (file or directory) in bytes. -1 means unknown size. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_SetItemSize( LONG nItemID, LARGE_INTEGER nSize ); |
Sets the size of the item in bytes. -1 means unknown size. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_GetItemOfs( LONG nItemID, LPLARGE_INTEGER lpDefOfs, LPLARGE_INTEGER lpStartSector ); |
Retrieves the offset of the file system data structure (e.g. NTFS FILE record) where the item is defined. If negative, the absolute value is the offset where a carved file starts on the volume. Also retrieves the number of the sector in which the data of the item starts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_SetItemOfs( LONG nItemID, LARGE_INTEGER nDefOfs, LARGE_INTEGER nStartSector ); |
Sets the above-mentioned offset and sector number. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LARGE_INTEGER
XWF_GetItemInformation( LONG nItemID, LONG nInfoType, LPBOOL lpSuccess, ); |
Returns information about an item (file or directory), such as the original ID or attributes that the item had in its defining file system. What information is actually returned depends on nInfoType. The function indicates success or failure via lpSuccess. #define XWF_ITEM_INFO_ORIG_ID 1
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOOL
XWF_SetItemInformation( LONG nItemID, LONG nInfoType, LARGE_INTEGER nInfoValue ); |
Sets information about an item (file or directory). For possible values of nInfoType see above and for additional ones below: v16.5 and later: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DWORD
XWF_GetItemType( LONG nItemID, LPWSTR lpTypeDescr, LONG nBufferLen ); |
Retrieves a description of the type of the specified file and returns information about the status of the type detection of the file (0=not verified, 1=too small, 2=totally unknown, 3=confirmed, 4=not confirmed, >5=newly identified). -1 means error. The type description parameter can be NULL if not required. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID XWF_SetItemType( LONG nItemID, LPWSTR lpTypeDescr, LONG nTypeStatus ); |
Sets a description of the type of the specified file (or specify NULL if not required) and information about the status of the type detection of the file (see above). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_GetItemParent( LONG nItemID ); |
Returns the ID of the parent of the specified item, or -1 if the item is the root directory. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID
XWF_SetItemParent( LONG nChildItemID, LONG nParentItemID ); |
Sets the parent of the specified child item. You may specify -1 for the virtual "Path unknown" directory as the parent, or -2 for the "Carved files" directory. If the parent is a file that does not have child objects yet, you should use XWF_SetItemInformation to mark it has having child objects. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_GetReportTableAssocs( LONG nItemID, LPWSTR lpBuffer, LONG nBufferLen ); |
Retrieves the names of the report tables that the specified item is associated with. Returns the number of associations of that file. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_AddToReportTable( LONG nItemID, LPWSTR lpReportTableName, DWORD nFlags ); |
Associates the specified file with the specified report table. If the report table does not exist yet, it will be created. Returns 1 if the file was successfully and newly associated with the report table, 2 if that association existed before, or 0 in case of failure. nFlags: Flags for the report
table, have an effect only if the report table did not exist yet at that
time |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LPWSTR
XWF_GetComment( LONG nItemID ); |
Retrieves a pointer to the comment of an item, if any. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOOL
XWF_AddComment( LONG nItemID, LPWSTR lpComment, DWORD nHowToAdd ); |
Adds the specified comment to the specified item. nHowToAdd: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BOOL
XWF_GetExtractedMetadata( LONG nItemID, LPWSTR lpBuffer, LONG nBufferLen ); |
Retrieves the extracted metadata of an item, if any. Not yet implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BOOL
XWF_SetExtractedMetadata( LONG nItemID, LPWSTR lpComment, DWORD nFlags ); |
Sets the extracted metadata of an item. Not yet implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
DWORD
XWF_GetHashValue( LONG nItemID, LPVOID lpBuffer ); |
Retrieves the hash value of an item, if it has any. Not yet implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BOOL
XWF_SetHashValue( LONG nItemID, LPWSTR lpComment, DWORD nFlags ); |
Adds the specified hash value to the specified item. Not yet implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
VOID
XWF_SetItemDataRuns( LONG nItemID, LPVOID lpBuffer ); |
Provides extents for an item so that X-Ways Forensics knows how to open it and read its data from the volume if it's neither a contiguous carved file nor defined by any file system data structure nor attached from an external source. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Search-Related Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_Search( struct SearchInfo* SInfo struct CodePages* CPages ); #pragma pack(2) struct SearchInfo { LONG iSize; HANDLE hVolume; LPWSTR lpSearchTerms; DWORD nFlags; DWORD nSearchWindow; }; #pragma pack(2) |
Available in v16.5 and later. Must only be called from XT_Prepare or XT_Finalize. Runs a simultaneous search for multiple search terms in the specified volume. The volume must be associated with an evidence object. Note that if this function is called as part of volume snapshot refinement, it can be called automatically for all selected evidence objects if the user applies the X-Tension to all selected evidence objects. Returns a negative value in case of an error. hVolume: currently must be 0, function is always applied to the active volume lpSearchTerms: delimited by line breaks; will be added to the case if not yet existing
nFlags: Can be combined only as known from the user
interface.
nSearchWindow: 0 for standard
search window length |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DWORD
XWF_GetSearchHitCount( HANDLE hVolume ); |
Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DWORD
XWF_GetSearchHitInfo( HANDLE hVolume, DWORD nSearchHitNo, struct SearchHitInfo* Info ); |
Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
LONG
XWF_AddSearchTerm( LPWSTR lpSearchTermDescr, DWORD nFlags ); |
Creates a new search term or (if flag 0x00000001 is specified) returns the ID of an existing search term if there is one with the same name. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_GetSearchTerm( WORD nSearchTermID, ... ); |
Retrieves information about a search term. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_CreateSearchHit( ... ); |
Creates a new search hit. Not currently implemented. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ... | ... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Evidence File Container Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HANDLE
XWF_CreateContainer( LPWSTR lpFileName, DWORD nFlags LPVOID pReserved ); |
Available in v16.5 and later. Creates a new or opens an existing evidence file container. Currently only 1 container can be open at a time for filling. If a container is open already when this function is called, it will be closed automatically.
nFlags: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_CopyToContainer( HANDLE hContainer, HANDLE hItem, DWORD nFlags DWORD nMode LARGE_INTEGER nStartOfs LARGE_INTEGER nEndOfs LPVOID pReserved ); |
Available in v16.5 and later. Copies a file to an evidence file container. Returns 0 if successful, otherwise an error code. If the error code is negative, you should not try to fill the container further.
nFlags:
nMode: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LONG
XWF_CloseContainer( HANDLE hContainer, LPVOID pReserved ); |
Available in v16.5 and later. Closes a container. Returns 1 if succesful. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Miscellaneous Functions |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_OutputMessage( LPWSTR lpMessage, DWORD nFlags ); |
Outputs the specified message in the Messages window. You may use this function for example to alert the user of errors or to output debug information. nFlags: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_ShowProgress( LPWSTR lpCaption, DWORD nFlags ); |
Creates a progress indicator window with the specified caption. You should call PeekMessage, TranslateMessage, DispatchMessage occasionally to allow for the main window to remain responsive. You must not use any of the progress indicator functions when implementing XT_ProcessItem or XT_ProcessItemEx or when calling XWF_* functions that create a progress bar themselves. nFlags: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_SetProgressPercentage( DWORD nPercent ); |
Sets the progress in percent. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_SetProgressDescription( LPWSTR lpStr, ); |
Displays descriptive text about the progress. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BOOL
XWF_ShouldStop( ); |
When a progress indicator window is on the screen and you call PeekMessage etc. regularly, you can use this function, to check whether the user wants to abort the operation . |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VOID
XWF_HideProgress( ); |
Closes the progress indicator window. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If you are missing certain functionality here that is available via the user interface of X-Ways Forensics, please contact us and describe in a few words for what function you suggest and for what purpose they would be useful. Perhaps it can be exposed in a future version of X-Ways Forensics. Thank you.
Further conceivable functions could be dealing with evidence objects, the hash database, retrieving internally used paths of X-Ways Forensics etc.