Kasim Posted March 31, 2020 Share Posted March 31, 2020 (edited) 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 March 31, 2020 by Kasim change title Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted March 31, 2020 Share Posted March 31, 2020 The first four bytes of a PDN image file are 'PDN3' (in ASCII). Is that what you're looking for? Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Kasim Posted March 31, 2020 Author Share Posted March 31, 2020 ; =========================================================================================================== ; 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 Quote Link to comment Share on other sites More sharing options...
Kasim Posted March 31, 2020 Author Share Posted March 31, 2020 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 Quote Link to comment Share on other sites More sharing options...
Kasim Posted March 31, 2020 Author Share Posted March 31, 2020 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 Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 1, 2020 Share Posted April 1, 2020 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. 1 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Kasim Posted April 1, 2020 Author Share Posted April 1, 2020 (edited) Ok no probs, I think the first info is all thats needed. Edited April 1, 2020 by Kasim 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.