From b96b5913320efcaf7a12617256ba7b3f77f24065 Mon Sep 17 00:00:00 2001 From: jens Date: Mon, 22 Feb 2016 13:12:34 +0100 Subject: [PATCH] Fixed stub emebedding --- Rakefile | 20 ++++++++------------ bin/ocra | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Rakefile b/Rakefile index ddf4a9a5..8b05a565 100644 --- a/Rakefile +++ b/Rakefile @@ -46,24 +46,20 @@ file 'bin/ocrasa.rb' => [ 'bin/ocra', 'share/ocra/stub.exe', 'share/ocra/stubw.e f.puts "__END__" stub = File.open("share/ocra/stub.exe", "rb") {|g| g.read} - stub64 = [stub].pack("m") - f.puts stub64.size + stub64 = [stub].pack("m0") f.puts stub64 - stub = File.open("share/ocra/stubw.exe", "rb") {|g| g.read} - stub64 = [stub].pack("m") - f.puts stub64.size - f.puts stub64 + stubw = File.open("share/ocra/stubw.exe", "rb") {|g| g.read} + stubw64 = [stubw].pack("m0") + f.puts stubw64 lzma = File.open("share/ocra/lzma.exe", "rb") {|g| g.read} - lzma64 = [lzma].pack("m") - f.puts lzma64.size + lzma64 = [lzma].pack("m0") f.puts lzma64 - lzma = File.open("share/ocra/edicon.exe", "rb") {|g| g.read} - lzma64 = [lzma].pack("m") - f.puts lzma64.size - f.puts lzma64 + edicon = File.open("share/ocra/edicon.exe", "rb") {|g| g.read} + edicon64 = [edicon].pack("m0") + f.puts edicon64 end end diff --git a/bin/ocra b/bin/ocra index b1b08f15..36f8b593 100644 --- a/bin/ocra +++ b/bin/ocra @@ -260,7 +260,7 @@ module Ocra # Returns a binary blob store embedded in the current Ruby script. def Ocra.get_next_embedded_image - DATA.read(DATA.readline.to_i).unpack("m")[0] + DATA.readline.chomp.unpack("m0")[0] end def Ocra.save_environment