file_rock 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/file_rock.rb +6 -132
- data/lib/filerock/core.rb +133 -0
- data/lib/filerock/enc.rb +34 -3
- data/lib/filerock/vars.rb +113 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19254375c3c43dbae40291377ea356d432d3d28e
|
4
|
+
data.tar.gz: e8f79318fc21f07261b3810451672d4555acf70b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb539bac9d3bb37cdd21b6067cef040af9fce6d30dd46fa504a6162ae881ecc5c11bda91e9ae7e650e2cd4d26c90b8ed3c22eb58ff7cde9b96aeba3aa70ed68
|
7
|
+
data.tar.gz: 326358f4753c6eac1ed80e6dfe39c14d99a1b87db86518c3fe5eeeee510b38321fe15f28f27c4e21720aa6602903d82ca0ade39be09953c6ebeb524d5218bdfb
|
data/lib/file_rock.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# file_rock.rb
|
2
2
|
#
|
3
|
-
# Copyright (C)
|
3
|
+
# Copyright (C) July 3, 2014
|
4
4
|
#
|
5
5
|
# Author: Abbas Taghiloei AKA MR.0x41 <ox41_a@yahoo.com>
|
6
6
|
#
|
@@ -8,7 +8,7 @@
|
|
8
8
|
#
|
9
9
|
# The MIT License (MIT)
|
10
10
|
#
|
11
|
-
# Copyright (c) [2014] [file_rock v 0.0.
|
11
|
+
# Copyright (c) [2014] [file_rock v 0.0.2 Ruby Gem]
|
12
12
|
#
|
13
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -33,138 +33,12 @@ raise "Please, use ruby 2.0.0 or later." if RUBY_VERSION < "2.0.0"
|
|
33
33
|
|
34
34
|
require 'digest'
|
35
35
|
require 'filerock/enc'
|
36
|
+
require 'filerock/vars'
|
37
|
+
require 'filerock/core'
|
36
38
|
|
37
39
|
class FileRock
|
38
40
|
def initialize(sett = {})
|
39
|
-
|
40
|
-
@sett = @sett.merge(sett)
|
41
|
-
if(@sett["file"] == nil)
|
42
|
-
raise 'No file address input. Please send the file address as an input.'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
def header
|
46
|
-
i = @sett['size']
|
47
|
-
head = Enc.tohex(IO.binread(@sett["file"]))[0..i]
|
48
|
-
if(@sett["space"] =~ /ON/i)
|
49
|
-
head = head.gsub(/(.{2})(?=.)/, '\1 \2')
|
50
|
-
end
|
51
|
-
return head
|
52
|
-
end
|
53
|
-
def footer
|
54
|
-
i = @sett["size"]
|
55
|
-
foot = Enc.tohex(IO.binread(@sett["file"])).reverse![0..i].reverse!
|
56
|
-
if(@sett["space"] =~ /ON/i)
|
57
|
-
foot = foot.gsub(/(.{2})(?=.)/, '\1 \2')
|
58
|
-
end
|
59
|
-
return foot
|
60
|
-
end
|
61
|
-
def create_checksum_MD5(blocksize = nil)
|
62
|
-
if(blocksize.is_a? String)
|
63
|
-
raise "Wrong method argument, You should send an integrer."
|
64
|
-
end
|
65
|
-
if(blocksize.nil?)
|
66
|
-
checksum_MD5 = Digest::MD5.hexdigest(File.read(@sett["file"]))
|
67
|
-
return checksum_MD5
|
68
|
-
else
|
69
|
-
open(@sett["file"],"rb"){|file| checksum_MD5 = Digest::MD5.hexdigest(file.read(blocksize))}
|
70
|
-
return checksum_MD5
|
71
|
-
end
|
72
|
-
end
|
73
|
-
def create_checksum_SHA1(blocksize = nil)
|
74
|
-
if(blocksize.is_a? String)
|
75
|
-
raise "Wrong method argument, You should send an integrer."
|
76
|
-
end
|
77
|
-
if(blocksize.nil?)
|
78
|
-
checksum_SHA1 = Digest::SHA1.hexdigest(File.read(@sett["file"]))
|
79
|
-
return checksum_SHA1
|
80
|
-
else
|
81
|
-
open(@sett["file"],"rb"){|file| checksum_SHA1 = Digest::SHA1.hexdigest(file.read(blocksize))}
|
82
|
-
return checksum_SHA1
|
83
|
-
end
|
84
|
-
end
|
85
|
-
def create_checksum_SHA512(blocksize = nil)
|
86
|
-
if(blocksize.is_a? String)
|
87
|
-
raise "Wrong method argument, You should send an integrer."
|
88
|
-
end
|
89
|
-
if(blocksize.nil?)
|
90
|
-
checksum_SHA512 = Digest::SHA512.hexdigest(File.read(@sett["file"]))
|
91
|
-
return checksum_SHA512
|
92
|
-
else
|
93
|
-
open(@sett["file"],"rb"){|file| checksum_SHA512 = Digest::SHA512.hexdigest(file.read(blocksize))}
|
94
|
-
return checksum_SHA512
|
95
|
-
end
|
96
|
-
end
|
97
|
-
def check_checksum(checksum, blocksize = nil)
|
98
|
-
if(checksum.length == 32)
|
99
|
-
if(blocksize.nil?)
|
100
|
-
checksum_MD5 = Digest::MD5.hexdigest(File.read(@sett["file"]))
|
101
|
-
else
|
102
|
-
open(@sett["file"],"rb"){|file| checksum_MD5 = Digest::MD5.hexdigest(file.read(blocksize))}
|
103
|
-
end
|
104
|
-
if(checksum == checksum_MD5)
|
105
|
-
return true
|
106
|
-
else
|
107
|
-
return false
|
108
|
-
end
|
109
|
-
elsif(checksum.length == 40)
|
110
|
-
if(blocksize.nil?)
|
111
|
-
checksum_SHA1 = Digest::SHA1.hexdigest(File.read(@sett["file"]))
|
112
|
-
else
|
113
|
-
open(@sett["file"],"rb"){|file| checksum_SHA1 = Digest::SHA1.hexdigest(file.read(blocksize))}
|
114
|
-
end
|
115
|
-
if(checksum == checksum_SHA1)
|
116
|
-
return true
|
117
|
-
else
|
118
|
-
return false
|
119
|
-
end
|
120
|
-
elsif(checksum.length == 128)
|
121
|
-
if(blocksize.nil?)
|
122
|
-
checksum_SHA512 = Digest::SHA512.hexdigest(File.read(@sett["file"]))
|
123
|
-
else
|
124
|
-
open(@sett["file"],"rb"){|file| checksum_SHA512 = Digest::SHA512.hexdigest(file.read(blocksize))}
|
125
|
-
end
|
126
|
-
if(checksum == checksum_SHA512)
|
127
|
-
return true
|
128
|
-
else
|
129
|
-
return false
|
130
|
-
end
|
131
|
-
else
|
132
|
-
raise "Unknown Checksum Algorithm."
|
133
|
-
end
|
134
|
-
end
|
135
|
-
def type?
|
136
|
-
header = ["jP", "ftyp3gp", "ftypisom","ftypqt", "ftyp3gp5", "IIXPR","MMXPR", "MSISAMDatabase", "StandardACEDB","StandardJetDB", ".dss","APPR", "SKF", "dt2ddtd",
|
137
|
-
"org.bitcoin.pr", ".DOC", ".NeroISO",".WKS", "DiskDescripto", "MicrosoftDeveloperStudio","SCCA", "#!AMR","#?RADIANCE.", "%PDF", "%bitmap",".REC", "8BPS", "KEYB",
|
138
|
-
"MZ", "ElfFile", "GIF89a", "GIF87a", "MSFT", "NESM", "REGEDIT", "REVNUM:,", "SMARTDRW", "dswfile", "moov", "PAGEDU64"]
|
139
|
-
type = ["JPEG-2000", "3GPP", "MPEG-4","QuickTime movie file", "MPEG-4 video files", "Quark Express document","Quark Express document", "Microsoft Money file",
|
140
|
-
"Microsoft Access 2007 file", "Microsoft Access file", "Digital Speech Standard", "Approach index file","SkinCrafter skin file", "DesignTools 2D Design file",
|
141
|
-
"MultiBit Bitcoin wallet file","DeskMate Document file", "Nero CD Compilation", "DeskMate Worksheet","Windows prefetch file", "VMware 4 Virtual Disk description file",
|
142
|
-
"Microsoft Developer Studio project file", "Adaptive Multi-Rate ACELP", "Radiance High Dynamic Range image file","Adobe Portable Document Format and Forms Document file",
|
143
|
-
"Fuzzy bitmap (FBM) file", "RealPlayer video file (V11 and later)","Photoshop image file", "Keyboard driver file", "Windows/DOS executable file","Windows Vista event log",
|
144
|
-
"Graphics interchange format file", "Graphics interchange format file","OLE, SPSS, or Visual C++ type library file", "NES Sound file",
|
145
|
-
"Windows NT Registry and Registry Undo files", "Antenna data file", "SmartDraw Drawing file", "Microsoft Visual Studio workspace file", "QuickTime movie file",
|
146
|
-
"Windows 64-bit memory dump"]
|
147
|
-
hexhead = ["FFFFFFFFFFFFFFFFFFFF000002", "1F8B08","1F9D", "1FA0", "FFD8FFE0","5F27A889", "34CDB2A1", "4D444D5093A7", "504B0304140008000800", "A1B2C3D4", "A1B2CD34",
|
148
|
-
"D4C3B2A1"]
|
149
|
-
hextype = ["Alcohol 120 CD image", "GZIP archive file", "Compressed tape archive file using standard","Compressed tape archive file using LZH", "JPEG/JFIF graphics file",
|
150
|
-
"Jar archive","Extended tcpdump (libpcap) capture file (Linux/Unix)", "Windows heap dump file", "Java archive",
|
151
|
-
"tcpdump (libpcap) capture file (Linux/Unix)", "Extended tcpdump (libpcap) capture file (Linux/Unix)", "WinDump (winpcap) capture file (Windows)"]
|
152
|
-
i = 0
|
153
|
-
typetestheadassci = IO.binread(@sett["file"])[0..42]
|
154
|
-
while(i < header.size)
|
155
|
-
if(typetestheadassci =~ /#{header[i]}/i)
|
156
|
-
return type[i]
|
157
|
-
end
|
158
|
-
i += 1
|
159
|
-
end
|
160
|
-
i = 0
|
161
|
-
typetestheadhex = Enc.tohex(IO.binread(@sett["file"]))[0..42]
|
162
|
-
while(i < header.size)
|
163
|
-
if(typetestheadhex =~ /#{hexhead[i]}/i)
|
164
|
-
return hextype[i]
|
165
|
-
end
|
166
|
-
i += 1
|
167
|
-
end
|
168
|
-
return nil
|
41
|
+
vars(sett)
|
169
42
|
end
|
43
|
+
include Core
|
170
44
|
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
module Core
|
2
|
+
include VARS
|
3
|
+
def header
|
4
|
+
i = @sett[:size]
|
5
|
+
head = Enc.tohex(IO.binread(@sett[:file]))[0..i]
|
6
|
+
if(@sett[:space] =~ /ON/i)
|
7
|
+
head = head.gsub(/(.{2})(?=.)/, '\1 \2')
|
8
|
+
end
|
9
|
+
return head
|
10
|
+
end
|
11
|
+
def footer
|
12
|
+
i = @sett[:size]
|
13
|
+
foot = Enc.tohex(IO.binread(@sett[:file])).reverse![0..i].reverse!
|
14
|
+
if(@sett[:space] =~ /ON/i)
|
15
|
+
foot = foot.gsub(/(.{2})(?=.)/, '\1 \2')
|
16
|
+
end
|
17
|
+
return foot
|
18
|
+
end
|
19
|
+
def create_checksum_MD5(blocksize = nil)
|
20
|
+
if(blocksize.is_a? String)
|
21
|
+
raise "Wrong method argument, You should send an integrer."
|
22
|
+
end
|
23
|
+
if(blocksize.nil?)
|
24
|
+
checksum_MD5 = Digest::MD5.hexdigest(File.read(@sett[:file]))
|
25
|
+
return checksum_MD5
|
26
|
+
else
|
27
|
+
open(@sett[:file],"rb"){|file| checksum_MD5 = Digest::MD5.hexdigest(file.read(blocksize))}
|
28
|
+
return checksum_MD5
|
29
|
+
end
|
30
|
+
end
|
31
|
+
def create_checksum_SHA1(blocksize = nil)
|
32
|
+
if(blocksize.is_a? String)
|
33
|
+
raise "Wrong method argument, You should send an integrer."
|
34
|
+
end
|
35
|
+
if(blocksize.nil?)
|
36
|
+
checksum_SHA1 = Digest::SHA1.hexdigest(File.read(@sett[:file]))
|
37
|
+
return checksum_SHA1
|
38
|
+
else
|
39
|
+
open(@sett[:file],"rb"){|file| checksum_SHA1 = Digest::SHA1.hexdigest(file.read(blocksize))}
|
40
|
+
return checksum_SHA1
|
41
|
+
end
|
42
|
+
end
|
43
|
+
def create_checksum_SHA512(blocksize = nil)
|
44
|
+
if(blocksize.is_a? String)
|
45
|
+
raise "Wrong method argument, You should send an integrer."
|
46
|
+
end
|
47
|
+
if(blocksize.nil?)
|
48
|
+
checksum_SHA512 = Digest::SHA512.hexdigest(File.read(@sett[:file]))
|
49
|
+
return checksum_SHA512
|
50
|
+
else
|
51
|
+
open(@sett[:file],"rb"){|file| checksum_SHA512 = Digest::SHA512.hexdigest(file.read(blocksize))}
|
52
|
+
return checksum_SHA512
|
53
|
+
end
|
54
|
+
end
|
55
|
+
def check_checksum(checksum, blocksize = nil)
|
56
|
+
if(checksum.length == 32)
|
57
|
+
if(blocksize.nil?)
|
58
|
+
checksum_MD5 = Digest::MD5.hexdigest(File.read(@sett[:file]))
|
59
|
+
else
|
60
|
+
open(@sett[:file],"rb"){|file| checksum_MD5 = Digest::MD5.hexdigest(file.read(blocksize))}
|
61
|
+
end
|
62
|
+
if(checksum == checksum_MD5)
|
63
|
+
return true
|
64
|
+
else
|
65
|
+
return false
|
66
|
+
end
|
67
|
+
elsif(checksum.length == 40)
|
68
|
+
if(blocksize.nil?)
|
69
|
+
checksum_SHA1 = Digest::SHA1.hexdigest(File.read(@sett[:file]))
|
70
|
+
else
|
71
|
+
open(@sett[:file],"rb"){|file| checksum_SHA1 = Digest::SHA1.hexdigest(file.read(blocksize))}
|
72
|
+
end
|
73
|
+
if(checksum == checksum_SHA1)
|
74
|
+
return true
|
75
|
+
else
|
76
|
+
return false
|
77
|
+
end
|
78
|
+
elsif(checksum.length == 128)
|
79
|
+
if(blocksize.nil?)
|
80
|
+
checksum_SHA512 = Digest::SHA512.hexdigest(File.read(@sett[:file]))
|
81
|
+
else
|
82
|
+
open(@sett[:file],"rb"){|file| checksum_SHA512 = Digest::SHA512.hexdigest(file.read(blocksize))}
|
83
|
+
end
|
84
|
+
if(checksum == checksum_SHA512)
|
85
|
+
return true
|
86
|
+
else
|
87
|
+
return false
|
88
|
+
end
|
89
|
+
else
|
90
|
+
raise "Unknown Checksum Algorithm."
|
91
|
+
end
|
92
|
+
end
|
93
|
+
def type?
|
94
|
+
i = 0
|
95
|
+
typetestheadassci = IO.binread(@sett[:file])[0..50]
|
96
|
+
while(i < @header.size)
|
97
|
+
if(typetestheadassci =~ /#{@header[i]}/i)
|
98
|
+
return @type[i]
|
99
|
+
end
|
100
|
+
i += 1
|
101
|
+
end
|
102
|
+
i = 0
|
103
|
+
typetestheadhex = Enc.tohex(IO.binread(@sett[:file]))[0..42]
|
104
|
+
while(i < @header.size)
|
105
|
+
if(typetestheadhex =~ /#{@hexhead[i]}/i)
|
106
|
+
return @hextype[i]
|
107
|
+
end
|
108
|
+
i += 1
|
109
|
+
end
|
110
|
+
return nil
|
111
|
+
end
|
112
|
+
def inside_craving?
|
113
|
+
allinf = []
|
114
|
+
i = 0
|
115
|
+
typetestheadassci = IO.binread(@sett[:file])
|
116
|
+
while(i < @header.size)
|
117
|
+
if(typetestheadassci =~ /#{@header[i]}/i)
|
118
|
+
allinf << @type[i]
|
119
|
+
end
|
120
|
+
i += 1
|
121
|
+
end
|
122
|
+
i = 0
|
123
|
+
typetestheadhex = Enc.tohex(IO.binread(@sett[:file]))
|
124
|
+
while(i < @header.size)
|
125
|
+
if(typetestheadhex =~ /#{@hexhead[i]}/i)
|
126
|
+
allinf << @hextype[i]
|
127
|
+
end
|
128
|
+
i += 1
|
129
|
+
end
|
130
|
+
allinf.delete(nil)
|
131
|
+
return allinf
|
132
|
+
end
|
133
|
+
end
|
data/lib/filerock/enc.rb
CHANGED
@@ -1,9 +1,40 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# file_rock.rb
|
2
|
+
#
|
3
|
+
# Copyright (C) July 3, 2014
|
4
|
+
#
|
5
|
+
# Author: Abbas Taghiloei AKA MR.0x41 <ox41_a@yahoo.com>
|
6
|
+
#
|
7
|
+
# == License
|
8
|
+
#
|
9
|
+
# The MIT License (MIT)
|
10
|
+
#
|
11
|
+
# Copyright (c) [2014] [file_rock v 0.0.2 Ruby Gem]
|
12
|
+
#
|
13
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
+
# of this software and associated documentation files (the "Software"), to deal
|
15
|
+
# in the Software without restriction, including without limitation the rights
|
16
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
+
# copies of the Software, and to permit persons to whom the Software is
|
18
|
+
# furnished to do so, subject to the following conditions:
|
19
|
+
#
|
20
|
+
# The above copyright notice and this permission notice shall be included in all
|
21
|
+
# copies or substantial portions of the Software.
|
22
|
+
#
|
23
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
29
|
+
# SOFTWARE.
|
30
|
+
#
|
31
|
+
|
32
|
+
module Enc
|
33
|
+
def Enc.tohex(bit)
|
3
34
|
bit = bit.each_byte.map { |b| b.to_s(16) }.join
|
4
35
|
return bit
|
5
36
|
end
|
6
|
-
def
|
37
|
+
def Enc.toascii(bit)
|
7
38
|
bit = bit.scan(/../).map { |x| x.hex.chr }.join
|
8
39
|
return bit
|
9
40
|
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# file_rock.rb
|
2
|
+
#
|
3
|
+
# Copyright (C) July 3, 2014
|
4
|
+
#
|
5
|
+
# Author: Abbas Taghiloei AKA MR.0x41 <ox41_a@yahoo.com>
|
6
|
+
#
|
7
|
+
# == License
|
8
|
+
#
|
9
|
+
# The MIT License (MIT)
|
10
|
+
#
|
11
|
+
# Copyright (c) [2014] [file_rock v 0.0.2 Ruby Gem]
|
12
|
+
#
|
13
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
+
# of this software and associated documentation files (the "Software"), to deal
|
15
|
+
# in the Software without restriction, including without limitation the rights
|
16
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
+
# copies of the Software, and to permit persons to whom the Software is
|
18
|
+
# furnished to do so, subject to the following conditions:
|
19
|
+
#
|
20
|
+
# The above copyright notice and this permission notice shall be included in all
|
21
|
+
# copies or substantial portions of the Software.
|
22
|
+
#
|
23
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
29
|
+
# SOFTWARE.
|
30
|
+
#
|
31
|
+
|
32
|
+
module VARS
|
33
|
+
def vars(sett)
|
34
|
+
@sett = {:space => "ON", :size => 23}
|
35
|
+
@sett = @sett.merge(sett)
|
36
|
+
@header = ["jP", "ftyp3gp", "ftypisom", "ftypqt", "ftyp3gp5", "ftypmp42", "ftypMSNV", "ftypM4A", "IIXPR", "MMXPR", "MSISAM Database", "Standard ACE DB",
|
37
|
+
"Standard Jet DB", "APPR", "dt2ddtd", "org.bitcoin.pr", "NeroISO", "RTS COMPRESSED IMAGE", "Disk Descripto", "Microsoft Developer Studio", "bitmap",
|
38
|
+
"LfLe",
|
39
|
+
"8BPS", ":VERSION", "<!doctyp", "<MakerFile", "ACSD", "AES", "AMYO", "AOL Feedbag", "AOLDB", "AOLIDX", "AOLINDEX", "AOLVM100", "BEGIN:VCARD",
|
40
|
+
"BLI223", "BOOKMOBI", "Blink by D.T.S", "CBFILE", "CD001", "CISO", "CPT7FILE", "CPTFILE", "CREG", "Calculux Indoor", "Client UrlCache MMF Ver",
|
41
|
+
"ELITE Commander", "ENTRYVCD", "ERFSSAVEDATAFILE", "ElfFile", "GF1PATCH", "GIF87a", "GIF89a",
|
42
|
+
"Genetec Omnicast", "ITOLITLS", "ITSF", "MSFT", "MSWIM", "MZ", "MsRcf", "NAVTRAFFIC", "NESM", "NITF0", "Name:", "OPCLDAT", "OPLDatabaseFile",
|
43
|
+
"PAGEDU64", "PAGEDUMP", "PEST", "PGPdMAIN", "PKLITE", "PKSFX", "PMCC", "PNCIUNDO", "PMOCCMOC", "PUFX", "RAZATDB1", "REGEDIT", "RTSS",
|
44
|
+
"SCMI", "SHOW", "SMARTDRW", "SPFI", "SPVB", "SQLOCONVHD", "SQLite format 3", "StuffIt (c)1997", "riff", "pdf", "JFIF", "Exif", "SPIFF"]
|
45
|
+
|
46
|
+
@type = ["Various JPEG-2000 image file format",
|
47
|
+
"3rd Generation Partnership Project 3GPP", "ISO Base Media file (MPEG-4) v1", "QuickTime movie file", "MPEG-4 video file",
|
48
|
+
"MPEG-4 video/QuickTime file", "MPEG-4 video file", "Apple Lossless Audio Codec file", "Quark Express document", "Quark Express document",
|
49
|
+
"Microsoft Money file", "Microsoft Access 2007 file", "Microsoft Access file", "Approach index file", "DesignTools 2D Design file",
|
50
|
+
"MultiBit Bitcoin wallet file", "Nero CD Compilation", "Runtime Software compressed disk image",
|
51
|
+
"VMware 4 Virtual Disk description file (split disk)", "Microsoft Developer Studio project file",
|
52
|
+
"Fuzzy bitmap (FBM) file", "Windows Event Viewer file", "Photoshop image file", "Surfplan kite project file",
|
53
|
+
"AOL HTML mail file", "Adobe FrameMaker file", "Miscellaneous AOL parameter and information files", "AES Crypt file format",
|
54
|
+
"Harvard Graphics symbol graphic", "AOL and AIM buddy list file", "AOL database files: address book (ABY) and user configuration data (MAIN.IDX)",
|
55
|
+
"AOL client preferences/settings file (MAIN.IND)", "AOL address book index file", "AOL personal file cabinet (PFC) file", "vCard file",
|
56
|
+
"Thomson Speedtouch series WLAN router firmware", "Palmpilot resource file", "BLINK compressed archive",
|
57
|
+
"WordPerfect dictionary file (unconfirmed)", "ISO-9660 CD Disc Image", "Compressed ISO (CISO) CD image", "Corel Photopaint file",
|
58
|
+
"Corel Photopaint file",
|
59
|
+
"Windows 9x registry hive", "Calculux Indoor lighting design software project file", "Microsoft Internet Explorer cache file (index.dat) file",
|
60
|
+
"Elite Plus Commander saved game file", "VideoVCD (GNU VCDImager) file", "Kroll EasyRecovery Saved Recovery State file",
|
61
|
+
"Windows Vista event log file", "Advanced Gravis Ultrasound patch file", "Graphics interchange format file", "Graphics interchange format file",
|
62
|
+
"Genetec video archive", "Microsoft Reader eBook file", "Microsoft Compiled HTML Help File",
|
63
|
+
"OLE, SPSS, or Visual C++ type library file", "Microsoft Windows Imaging Format file", "Windows/DOS executable file",
|
64
|
+
"VMapSource GPS Waypoint Database", "TomTom traffic data file", "NES Sound file",
|
65
|
+
"National Imagery Transmission Format (NITF) file", "Agent newsreader character map file", "1Password 4 Cloud Keychain encrypted attachment",
|
66
|
+
"Psion Series 3 Database file", "Windows 64-bit memory dump", "Windows memory dump", "PestPatrol data/scan strings", "PGP disk image",
|
67
|
+
"PKLITE compressed ZIP archive (see also PKZIP)", "PKSFX self-extracting executable compressed file", "Windows Program Manager group file",
|
68
|
+
"Norton Disk Doctor undo file", "Microsoft Windows User State Migration Tool (USMT)", "Puffer encrypted archive",
|
69
|
+
"Shareaza (Windows P2P client) thumbnail", "Windows NT Registry and Registry Undo files", "Windows NT Netmon capture file",
|
70
|
+
"Img Software Set Bitmap", "Harvard Graphics DOS Ver. 2/x Presentation file", "SmartDraw Drawing file", "StorageCraft ShadownProtect backup file",
|
71
|
+
"MultiBit Bitcoin blockchain file", "DB2 conversion file", "SQLite database file", "StuffIt compressed archive",
|
72
|
+
"Sonic Foundry Acid Music File (Sony)", "Adobe Portable Document Format and Forms Document file", "JPEG/JFIF graphics file",
|
73
|
+
"JPEG/JFIF graphics file", "JPEG/JFIF graphics file"]
|
74
|
+
|
75
|
+
@hexhead = ["5C41B1FF", "00FFFFFFFFFFFFFFFFFFFF0000020001", "02647373", "07534B46", "0D444F43", "0E574B53", "53434341", "1A45DFA3",
|
76
|
+
"1A45DFA3934282886D6174726F736B61",
|
77
|
+
"213C617263683E0A", "2142444E", "2321414D52", "233F52414449414E43450A", "25504446", "2E524543", "2E524D46", "2E736E64",
|
78
|
+
"3026B2758E66CF11A6D900AA0062CE6C", "377ABCAF271C",
|
79
|
+
"37E45396C9DBD607", "3C7E363C5C255F30675371683B", "43232B44A4434DA5486472", "43525553482076", "44415800", "44424648",
|
80
|
+
"444D5321", "455646090D0AFF", "464158434F5645522D564552", "4644424800", "464C5601", "464F524D00", "47504154", "4A4152435300",
|
81
|
+
"4D41523100", "4D494C4553", "4D4C5357", "4D52564E", "4D535F564F494345", "4D6963726F736F667420432F432B2B20", "4E422A00",
|
82
|
+
"504943540008", "514649FB", "5245564E554D3A2C", "526172211A0700", "526172211A070100", "FFD8FFE8", "FFD8FFE1", "FEEDFEED", "FEEDFACF",
|
83
|
+
"FEEDFACE", "FD377A585A00", "F9BEB4D9", "E4525C7B8CD8A74DAEB15378D02996D3", "D7CDC69A", "D4C3B2A1", "CF11E0A1B11AE100", "CECECECE",
|
84
|
+
"CD20AAAA02", "CAFEBABE", "C5D0D3C6", "C3ABCDAB", "BEBAFECA0F50616C6D53472044617461", "B5A2B0B3B3B0A5B5", "B46E6844", "B168DE3A",
|
85
|
+
"B04D4643", "AC9EBD8F0000", "A1B2CD34", "A1B2C3D4", "A0461DF0", "89504E470D0A1A0A", "72656766", "504B"]
|
86
|
+
|
87
|
+
@hextype = ["Mujahideen Secrets 2 encrypted file", "Alcohol 120% CD image", "Digital Speech Standard", "SkinCrafter skin file",
|
88
|
+
"DeskMate Document file", "DeskMate Worksheet", "Windows prefetch file", "WebM video file", "Matroska stream file",
|
89
|
+
"Unix archiver (ar) files and Microsoft Program Library",
|
90
|
+
"Microsoft Outlook Personal Folder File", "Adaptive Multi-Rate ACELP", "Radiance High Dynamic Range image file",
|
91
|
+
"Adobe Portable Document Format and Forms Document file", "RealPlayer video file (V11 and later)", "RealMedia streaming media file",
|
92
|
+
"NeXT/Sun Microsystems Law audio file", "Microsoft Windows Media Audio/Video File", "7-Zip compressed file", "zisofs compression format",
|
93
|
+
"ASCII85 (aka BASE85) encoded file", "RagTime document file", "Crush compressed archive", "DAX Compressed CD image", "Palm Zire photo database",
|
94
|
+
"Amiga DiskMasher compressed archive", "Expert Witness Compression Format (EWF) file", "Microsoft Fax Cover Sheet",
|
95
|
+
"Fiasco database definition file", "Flash video file", "Audio Interchange File", "GIMP (GNU Image Manipulation Program) pattern file",
|
96
|
+
"JARCS compressed archive", "Mozilla archive",
|
97
|
+
"Milestones v1.0 project management and scheduling software", "Skype localization data file", "VMware BIOS (non-volatile RAM) state file",
|
98
|
+
"Sony Compressed Voice File", "Microsoft C++ debugging symbols file", "MS Windows journal file",
|
99
|
+
"ADEX Corp. ChromaGraph Graphics Card Bitmap Graphic file", "QEMU Qcow Disk Image", "Antenna data file", "RAR (v4.x) compressed archive file",
|
100
|
+
"RAR (v5) compressed archive file", "Digital camera JPG", "Digital camera JPG", "JavaKeyStore file", "Apple OS X ABI Mach-O binary file (64-bit)",
|
101
|
+
"Apple OS X ABI Mach-O binary file (32-bit)", "XZ archive file", "Bitcoin-Qt blockchain block file", "Microsoft OneNote note",
|
102
|
+
"Windows graphics metafile", "WinDump (winpcap) capture file (Windows)", "Perfect Office document", "Java Cryptography Extension keystore file",
|
103
|
+
"Norton Anti-Virus quarantined virus file", "Java bytecode file (also used by Apple iOS apps)", "Adobe encapsulated PostScript file",
|
104
|
+
"MS Agent Character file", "Palm Desktop DateBook file", "Windows calendar file", "Acronis True Image file", "Graphics Multipage PCX bitmap file",
|
105
|
+
"Windows 95 password file", "Quicken data file", "Extended tcpdump (libpcap) capture file (Linux/Unix)",
|
106
|
+
"tcpdump (libpcap) capture file (Linux/Unix)", "PowerPoint presentation subheader (MS Office)", "Portable Network Graphics file",
|
107
|
+
"Windows NT registry hive file", "Microsoft Office Open XML Format (OOXML) Document"]
|
108
|
+
|
109
|
+
if(@sett[:file] == nil)
|
110
|
+
raise 'No file address input. Please send the file address as an input.'
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_rock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A-Taghiloei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Gem to get files Header, Footer, Type(via headers), create file checksum,
|
14
|
-
check file checksum and ... .
|
14
|
+
check file checksum, Carving and ... .
|
15
15
|
email: ox41_a@yahoo.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
@@ -19,6 +19,8 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- lib/file_rock.rb
|
21
21
|
- lib/filerock/enc.rb
|
22
|
+
- lib/filerock/vars.rb
|
23
|
+
- lib/filerock/core.rb
|
22
24
|
homepage: http://www.opensec.ir
|
23
25
|
licenses:
|
24
26
|
- MIT
|