Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Safari Cookies - Erstellungsdatum (https://www.delphipraxis.net/113663-safari-cookies-erstellungsdatum.html)

Andreas L. 12. Mai 2008 18:35


Safari Cookies - Erstellungsdatum
 
Hi,
hier ein Auszug aus der Safari Cookies Datei "Cookies.plist".
Delphi-Quellcode:
   <dict>
      <key>Created</key>
      <real>228601976.75616455</real> //Erstellungszeitpunkt
      <key>Domain</key>
      <string>.google.com</string>
      <key>Expires</key>
      <date>2010-03-30T20:32:41Z</date>
      <key>Name</key>
      <string>PREF</string>
      <key>Path</key>
      <string>/</string>
      <key>Value</key>
      <string>...</string>
   </dict>
Ich möchte jetzt das Erstellungsdatum des Cookies ermitteln. Ich weiß nur nicht, was das für ein Format sein soll. Wenn ich das niedrige und hohe Byte von FileTime fülle erhalte ich z. B. als Jahr 1603. Vertausche ich die Werte bekomme ich z. B. 2052

Was könnte das noch für ein Format sein? Die Apple Seite liefert mit da keinerlei antworten.

Danke und Ciao,
Andy

toms 12. Mai 2008 18:38

Re: Safari Cookies - Erstellungsdatum
 
Zitat:

2010-03-30T20:32:41Z
Vielleicht so?

Datum = 30.03.2010
Zeit = 20:32:41

Edit: Habe gesehen, dass du den Erstellungszeitpunkt meinst

Andreas L. 13. Mai 2008 18:46

Re: Safari Cookies - Erstellungsdatum
 
Keiner eine Idee?

Andreas L. 20. Okt 2008 12:12

Re: Safari Cookies - Erstellungsdatum
 
*PUSH*

Andreas L. 28. Dez 2008 20:21

Re: Safari Cookies - Erstellungsdatum
 
Liste der Anhänge anzeigen (Anzahl: 1)
Ich hab jetzt ein Programm gefunden das, dass Datum richtig auslesen kann. Der Source ist leider in ?C++?. Ich denke das folgender Teil für die richtige Umwandlung verantwortlich ist, verstehe den Code aber nicht so ganz:

Code:
    // Check for Compare key and convert it to readable time
    if ( [key compare:@"Created"] == 0 ) {

    NSString *date_value = [dict objectForKey:@"Created"];

     if( date_value != nil ) {
     NSString *stringFromLastVisitedDate = date_value;
     NSDate *v_date = [[NSDate alloc] initWithTimeIntervalSinceReferenceDate:
            [stringFromLastVisitedDate doubleValue]];

      [[NSFileHandle fileHandleWithStandardOutput]
        writeData:
          [[NSString stringWithFormat: @"Created:\t%@ (%@)\n",v_date,value]
        dataUsingEncoding: NSASCIIStringEncoding]];
     }
   }
Wie kann ich das am besten in Delphi umsetzen?

Im Anhang ist der komplette Code des CookieParsers.

Der Jan 28. Dez 2008 21:25

Re: Safari Cookies - Erstellungsdatum
 
Also das ist weder C noch C++.
Evtl C#, damit kenn ich mich nicht aus. Aber ist ist mal ein schönes Beispiel der Thematik "Analyse eines Sourcecodes in unbekannter Sprache" :)

Der Jan 28. Dez 2008 21:33

Re: Safari Cookies - Erstellungsdatum
 
So wie es ausschaut, hast du in den "[]" schachtelbar immer diese Struktur
Delphi-Quellcode:
[Variablentyp Name(optional):Methode]
.

Also wenn du die Definitionen für diese Typen wie NSDate etc. nicht hast, sieht es wohl eher schlecht aus.

Nur so der Eindruck vom ersten durchlesen :)

Edit: Vielleicht hängst du mal etwas mehr von dem Sourcecode an, ich bezweifle, dass das gepostete die ganze "unit" ist.

Andreas L. 28. Dez 2008 21:59

Re: Safari Cookies - Erstellungsdatum
 
Zitat:

Zitat von Der Jan
So wie es ausschaut, hast du in den "[]" schachtelbar immer diese Struktur
Delphi-Quellcode:
[Variablentyp Name(optional):Methode]
.

Also wenn du die Definitionen für diese Typen wie NSDate etc. nicht hast, sieht es wohl eher schlecht aus.

Nur so der Eindruck vom ersten durchlesen :)

Edit: Vielleicht hängst du mal etwas mehr von dem Sourcecode an, ich bezweifle, dass das gepostete die ganze "unit" ist.

War ansonsten nur ein Makefile und das folgende DTD dabei.

Code:
<!ENTITY % plistObject "(array | data | date | dict | real | integer | string | true | false )" >
<!ELEMENT plist %plistObject;>
<!ATTLIST plist version CDATA "1.0" >


<!ELEMENT array (%plistObject;)*>
<!ELEMENT dict (key, %plistObject;)*>
<!ELEMENT key (#PCDATA)>


<!ELEMENT string (#PCDATA)>
<!ELEMENT data (#PCDATA)>
<!ELEMENT date (#PCDATA)>


<!ELEMENT true EMPTY>
<!ELEMENT false EMPTY>
<!ELEMENT real (#PCDATA)>
<!ELEMENT integer (#PCDATA)>
EDIT: Hab noch folgendes gefunden:
Zitat:

The Safari Forensic Tools project consists of a collection of command line
utilities written in Objective-C and PERL to parse the files created and used
by the Safari web browser.
Der Source stammt von http://jafat.sourceforge.net

Der Jan 29. Dez 2008 01:27

Re: Safari Cookies - Erstellungsdatum
 
Ich werde mir das auf jeden Fall mal mal genauer ansehen. Allerdings nicht heute oder morgen, hab ja Urlaub :)
Aber es sieht wirklich interessant aus.

Andreas L. 9. Feb 2009 13:04

Re: Safari Cookies - Erstellungsdatum
 
Nach langem grübeln hab ich immer noch nicht herausgefunden was das für ein Format sein soll. Hat denn wirklich niemand eine Idee?


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:23 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz