0

I have a binary file with a file extension of CATPart. This in essence is a native Catia file format. I was trying to extract the version of Catia from which the CATPart is associated with. Now looking at the CatPart file in notepad++ there are many ASCII strings which are visible to notepad++ in the file.

Now there is a string called LastSaveVersion which is contained in the file and which is visible in notepad++ but the value associated appears to be masked with SO NUL NUL NUL characters.

Is it possible to read this binary in c# and search for that string "LastSaveVersion" and retrieve it's value. I don't know the binary make up of the CATPart binary file.

Code example much appreciated.

Here's a sample of what I see looking at the CATPart file in notepad++. If you scroll to the right you will see the LastSaveVersion.

 t o r a g e P r o p e r t y     B   (    4 C o n t _ 0 _ e 6 4 _ 5 1 8 9 0 f a 9 _ 1 a b 4 5  M   DASSAULT-SYSTEMES   CATIA   041803P                                                                                    4CATDocumentProperty€    "   "    4CATSymbolPropertyà    "    4
CATOctetArrayà    "Y   ;;o; ; ; ; ;
;G;e;n;e;r;i;c;L;o;c;a;t;e;A; ; ; ;;D;o;c;I;d;9; ;;;F;i;l;e;;C;A;T;P;a;r;t;); ;C;:;\;U;s;e;r;s;\;P;u;b;l;i;c;\;P;W;B;_;X;M;A;P;\;0;0;0;0;0;1;2;2;.;C;A;T;P;a;r;tŸ"    "    "    !  !  Ÿà    "   à    ":   ;;o; ; ; ; ;
;G;e;n;e;r;i;c;L;o;c;a;t;e;"; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;
; ;L;i;t;e;r;a;l;s;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    ">   ;;o; ; ; ; ;
;G;e;n;e;r;i;c;L;o;c;a;t;e;&; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;; ;P;r;o;d;u;c;t;M;o;d;e;l;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    "9   ;;o; ; ; ; ;
;G;e;n;e;r;i;c;L;o;c;a;t;e;!; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;; ;M;e;c;h;M;o;d;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    "A   ;;;  ;Ü;d;; ; ;;;5;Ü;G;¡; ; ; ;; ; ; ; ;;C;A;T;I;A;!; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;; ;M;e;c;h;M;o;d;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    "F   ;;;   ;Ü;d;; ; ;;;5;Ü;J;§; ; ; ;; ; ; ; ;;C;A;T;I;A;&; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;; ;P;r;o;d;u;c;t;M;o;d;e;l;.;f;e;a;tŸ"    "    "   ! !  Ÿà    "   à    "B   ;;;€;†;ð;; ; ;n;ñ;5;Ú;ë;À; ;;q;·; ; ; ; ;;C;A;T;I;A;"; ; ; ;;D;o;c;I;d;; ;;;F;i;l;e;;f;e;a;t;
; ;L;i;t;e;r;a;l;s;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    "@   ;;o; ; ; ; ;
;G;e;n;e;r;i;c;L;o;c;a;t;e;(; ; ; ;;D;o;c;I;d; ; ;;;F;i;l;e;;f;e;a;t;; ;C;A;T;H;y;b;r;i;d;S;h;a;p;e;.;f;e;a;tŸ"    "    "   !  !  Ÿà    "   à    "H   ;;;€;›;è;%; ; ;X;K;6;ú;@;Ø; ;;;ž; ; ; ; ;;C;A;T;I;A;(; ; ; ;;D;o;c;I;d; ; ;;;F;i;l;e;;f;e;a;t;; ;C;A;T;H;y;b;r;i;d;S;h;a;p;e;.;f;e;a;tŸ"    "    "   !  !  Ÿ$   $   $   $   $   $   $   $   Ÿ6FINJPL       CATSummaryInformation    LastSaveVersion      <Version>5/<Version><Release>19/<Releas
David Egan
  • 424
  • 2
  • 8
  • 23
  • 2
    Also text example would be much appreciated – Sid Jul 06 '17 at 15:16
  • 2
    Are you sure they're ASCII? – Chris Dunaway Jul 06 '17 at 20:47
  • It ain't text so a text-editor is not the best tool for this. It can give you a rough idea though. But look for a Hex viewer or something like that. – H H Jul 07 '17 at 07:43
  • No I am not sure they are ASCII notepad++ display them as ASCII characters. I am pretty sure the file from which I am reading is a binary file of some sorts. I don't know the makeup of this file format. – David Egan Jul 07 '17 at 07:46

0 Answers0