File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ function parseFileSig(filePath, signatures) {
62
62
const match = regex . exec ( hexString ) ;
63
63
if ( match ) {
64
64
console . log ( match . index ) ;
65
- return parseFileBody ( match , signature ) ;
65
+ return parseFileBody ( match , signature , match [ 1 ] . length ) ;
66
66
}
67
67
}
68
68
return null ;
@@ -71,11 +71,11 @@ function parseFileSig(filePath, signatures) {
71
71
function sigToRegex ( signature ) {
72
72
// Signatures are either at the very beginning of the file or after a CRLF following the header
73
73
// Signatures are NOT GUARANTEED to be at the beginning of the file
74
- return new RegExp ( `(^|\r\n )${ signature } ` , 'g' ) ;
74
+ return new RegExp ( `(^|0d0a )${ signature } ` , 'g' ) ;
75
75
}
76
76
77
- function parseFileBody ( match , signature ) {
78
- const body = signature + match . input . substring ( match . index + signature . length ) ;
77
+ function parseFileBody ( match , signature , offset ) {
78
+ const body = signature + match . input . substring ( match . index + signature . length + offset ) ;
79
79
const buffer = Buffer . from ( body , 'hex' ) ;
80
80
// console.log(buffer);
81
81
// fs.writeFileSync("test.png", buffer);
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ <h1>HTTP Cache File Signature Search</h1>
14
14
< h2 > Configure</ h2 >
15
15
< form >
16
16
< label for ="directoryPath "> Enter directory path:</ label > < br >
17
- < input class ="mb " id ="pathInput " type ="text " name ="directoryPath " placeholder ="e.g. %LocalAppData% \Mozilla\Firefox\Profiles\toy7mtpb.default-release\cache2\entries " required > < br >
17
+ < input class ="mb " id ="pathInput " type ="text " name ="directoryPath " placeholder ="e.g. C:\Users\username\AppData\Local \Mozilla\Firefox\Profiles\toy7mtpb.default-release\cache2\entries " required > < br >
18
18
19
19
< label for =""> Timeframe:</ label > < br >
20
20
< div class ="mb " id ="timeframes-container ">
You can’t perform that action at this time.
0 commit comments