forked from coderobe/VBiosFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add updater-polyglot extraction & zlib inflation; Switch from UEFIDum…
…p to UEFIExtract; Decrease verbosity;
- Loading branch information
Showing
8 changed files
with
124 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module VBiosFinder | ||
class Extract | ||
def self.polyglot file | ||
File.open file, "r:ASCII-8BIT" do |data| | ||
regex = /(.{4})\xAA\xEE\xAA\x76\x1B\xEC\xBB\x20\xF1\xE6\x51(.{1})/n | ||
input = data.read | ||
matches = regex.match input | ||
payload_size = matches.captures.first.unpack('V').first | ||
payload_offset = matches.offset(2).last | ||
data.seek payload_offset | ||
File.open "#{file}-polyglot", "w:ASCII-8BIT" do |outdata| | ||
outdata.write data.read | ||
end | ||
end | ||
end | ||
end | ||
class Test | ||
def self.polyglot file | ||
File.open file, "r:ASCII-8BIT" do |data| | ||
regex = /(.{4})\xAA\xEE\xAA\x76\x1B\xEC\xBB\x20\xF1\xE6\x51.{1}/n | ||
return !(regex.match(data.read).nil?) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "zlib" | ||
|
||
module VBiosFinder | ||
class Extract | ||
def self.zlib file | ||
File.open file, "r:ASCII-8BIT" do |data| | ||
File.open "#{file}-zlib", "w:ASCII-8BIT" do |outdata| | ||
outdata.write Zlib::Inflate.inflate(data.read) | ||
end | ||
end | ||
end | ||
end | ||
class Test | ||
def self.zlib file | ||
File.open file, "r:ASCII-8BIT" do |data| | ||
regex = /^\x78\x9C/n | ||
return !(regex.match(data.read).nil?) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters