Jump to content

PDN file signature


Recommended Posts

Hi 

 

I am trying to use active file recovery to recover .pdns however this has to be added as a custom signature:

https://www.file-recovery.com/recovery-user-signatures.htm

 

Does anyone have these details so active file recovery can recognise the pdn signature and thus recover accidentally deleted files?

 

Thank You

 

Kasim

Edited by Kasim
change title
Link to comment
Share on other sites

; ===========================================================================================================
;                                 Signature Templates Usage
; ===========================================================================================================
; Empty lines and lines starting with semicolon are ignored
; Sections order and lines order in sections are not important
; Letter case is not important (excepting RegExp fields)
; -----------------------------------------------------------------------------------------------------------
; Section TEMPLATES - required and contains fields numbering from one
;       - TEMPLATE### - points to the section where signature template is described
; -----------------------------------------------------------------------------------------------------------
; Section Template Header - required and contains fields:
;     - BEGIN - required. Points to the section describing begin of the signature file
;     - FOOTER - required. Points to the section describing end of the signature file
;     - MAX_SIZE - non-required. Maximum file size to force file-end, if no file-end signature is detected. By default it is 64Kb.
;     - GROUP - non required. If missed - template goes to User Defined templates group by default 
;     - DESCRIPTION - non required. This is a descriptive name of user template being displayed on a screen
;     - EXTENSION - non required. This is a file extension to be displayed on a screen.
;
; -----------------------------------------------------------------------------------------------------------
; Section describing file beginning (required), contains fields of the same type:
;
;     signature = offset_start | offset_end
;
;     signature      - expression (regular or RegExp-compatible). Expression max length is 1024 bytes.
;     offset_start   - acceptable minimal signature offset from the beginning of the file
;     offset_end     - acceptable maximum signature offset from the beginning of the file
; 
;     If there are several fields listed in signature beginning, logical AND operation applied to confirm file start.
;
; -----------------------------------------------------------------------------------------------------------
; Section describing file end (not required), contains fields of the same type:
;
;     signature [= bytes_to_append]
;
;     signature       - expression (regular or RegExp-compatible). Expression max length is 1024 bytes.
;     bytes_to_append - not required. How many bytes to append to the file after the signature is found
;
;     If there are several fields listed in signature beginning, logical OR operation applied to define file end.


; ===========================================================================================================
;                                                Examples
; ===========================================================================================================

[TEMPLATES]
TEMPLATE1 = PRIMITIVE_HTML
TEMPLATE2 = PRIMITIVE_JPG

[PRIMITIVE_HTML]
DESCRIPTION = Primitive HTML Signature
EXTENSION = html
BEGIN=HTML_BEGIN
FOOTER=HTML_FOOTER
MAX_SIZE = 655360


[HTML_BEGIN]
<html = 0 | 512
<head = 0 | 1024

[HTML_FOOTER]
</html> = 2

[PRIMITIVE_JPG]
BEGIN=BEGIN.TEST.JPG
GROUP = Images and Camera RAW files
DESCRIPTION = Primitive JPG files
FOOTER=FOOTER-.TEST.JPG
EXTENSION = test.jpg
MAX_SIZE = 3221225472  
[BEGIN.TEST.JPG]
\xFF\xD8\xFF = 0 | 0

[FOOTER-.TEST.JPG]
\xFF\xD9
    
Link to comment
Share on other sites

Just now, Kasim said:

; ===========================================================================================================
;                                 Signature Templates Usage
; ===========================================================================================================
; Empty lines and lines starting with semicolon are ignored
; Sections order and lines order in sections are not important
; Letter case is not important (excepting RegExp fields)
; -----------------------------------------------------------------------------------------------------------
; Section TEMPLATES - required and contains fields numbering from one
;       - TEMPLATE### - points to the section where signature template is described
; -----------------------------------------------------------------------------------------------------------
; Section Template Header - required and contains fields:
;     - BEGIN - required. Points to the section describing begin of the signature file
;     - FOOTER - required. Points to the section describing end of the signature file
;     - MAX_SIZE - non-required. Maximum file size to force file-end, if no file-end signature is detected. By default it is 64Kb.
;     - GROUP - non required. If missed - template goes to User Defined templates group by default 
;     - DESCRIPTION - non required. This is a descriptive name of user template being displayed on a screen
;     - EXTENSION - non required. This is a file extension to be displayed on a screen.
;
; -----------------------------------------------------------------------------------------------------------
; Section describing file beginning (required), contains fields of the same type:
;
;     signature = offset_start | offset_end
;
;     signature      - expression (regular or RegExp-compatible). Expression max length is 1024 bytes.
;     offset_start   - acceptable minimal signature offset from the beginning of the file
;     offset_end     - acceptable maximum signature offset from the beginning of the file
; 
;     If there are several fields listed in signature beginning, logical AND operation applied to confirm file start.
;
; -----------------------------------------------------------------------------------------------------------
; Section describing file end (not required), contains fields of the same type:
;
;     signature [= bytes_to_append]
;
;     signature       - expression (regular or RegExp-compatible). Expression max length is 1024 bytes.
;     bytes_to_append - not required. How many bytes to append to the file after the signature is found
;
;     If there are several fields listed in signature beginning, logical OR operation applied to define file end.


; ===========================================================================================================
;                                                Examples
; ===========================================================================================================

[TEMPLATES]
TEMPLATE1 = PRIMITIVE_HTML
TEMPLATE2 = PRIMITIVE_JPG

[PRIMITIVE_HTML]
DESCRIPTION = Primitive HTML Signature
EXTENSION = html
BEGIN=HTML_BEGIN
FOOTER=HTML_FOOTER
MAX_SIZE = 655360


[HTML_BEGIN]
<html = 0 | 512
<head = 0 | 1024

[HTML_FOOTER]
</html> = 2

[PRIMITIVE_JPG]
BEGIN=BEGIN.TEST.JPG
GROUP = Images and Camera RAW files
DESCRIPTION = Primitive JPG files
FOOTER=FOOTER-.TEST.JPG
EXTENSION = test.jpg
MAX_SIZE = 3221225472  
[BEGIN.TEST.JPG]
\xFF\xD8\xFF = 0 | 0

[FOOTER-.TEST.JPG]
\xFF\xD9
    

Something that answers the above format, this is apparently how it identifies the signature?

 

 

Thank You

 

Kasim

Link to comment
Share on other sites

IS this what i need:

 

magicStr = fh.read(4).decode('ascii')

if magicStr != 'PDN3':
    raise PDNReaderError('Invalid magic string for PDN file: %s' % magicStr)

    headerSizeStr = fh.read(3) + b'\x00'
    if len(headerSizeStr) != 4:
        raise PDNReaderError('Unable to read header size. File may be corrupted.')

How do I add the begin and the footer variables?

 

Thank You

Link to comment
Share on other sites

Umm, I'm not reading through some huge file and figuring out how to program this for you. If it works, it works. If it doesn't then I honestly don't know how to push you in the right direction with this utility that I've never heard of before and its scripting thing that I also haven't seen before. You'll have to ask elsewhere.

  • Like 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...