feh-bin 0.1.2 → 0.1.3
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/README.md +4 -0
- data/lib/feh/bin.rb +21 -7
- data/lib/feh/bin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12f43b8f3478cbe44da84b86aedbbba2777cc505095841d3b81862c53df40d32
|
|
4
|
+
data.tar.gz: e06d68f95ad4bdc8675fc2dc9a4b46349c556a01fd0119907954c351a3b451a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5933e1059ebe9af2e92b33d6102af96ceb45b6b8fb639b041d8a7f38c7017057a278ae9164e04729c7c0866fdc8b575709980c8b5b13b21acaacd94f10003195
|
|
7
|
+
data.tar.gz: 95a60737d73dd0e0c26ef99a03310e436a656045b1da27f6148102db6d570f17a4c8f0b8f6ae1bda2c525b677a543f2dfa1e074be8e0ec0ff08c5ce7b7d037ca
|
data/README.md
CHANGED
data/lib/feh/bin.rb
CHANGED
|
@@ -41,13 +41,27 @@ module Feh
|
|
|
41
41
|
4.times {|j| xorkey[j] ^= buf[i + j]}
|
|
42
42
|
end
|
|
43
43
|
buf
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
#
|
|
50
|
-
#
|
|
44
|
+
else
|
|
45
|
+
:invalid_archive
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Unpacks a Fire Emblem Heroes .bin.lz file.
|
|
50
|
+
# Used for files that are XOR-encrypted for FEH but not LZ11-compressed.
|
|
51
|
+
# @param buf [Array<Integer>, String] content of the .bin.lz file
|
|
52
|
+
# @return [Array<Integer>] content of the unpacked archive
|
|
53
|
+
# @return [Symbol] error code if the input is not a valid .bin.lz file
|
|
54
|
+
def self.read_bin_lz04(buf)
|
|
55
|
+
buf = buf.bytes if buf.is_a?(String)
|
|
56
|
+
header = buf.shift(4)
|
|
57
|
+
xorseed = header[1] | (header[2] << 8) | (header[3] << 16)
|
|
58
|
+
if header.first == 0x04 && xorseed == buf.size
|
|
59
|
+
xorkey = [0x8083 * xorseed].pack('<I').bytes
|
|
60
|
+
(0...buf.size).step(4).each do |i|
|
|
61
|
+
4.times {|j| buf[i + j] ^= xorkey[j]}
|
|
62
|
+
4.times {|j| xorkey[j] ^= buf[i + j]}
|
|
63
|
+
end
|
|
64
|
+
buf
|
|
51
65
|
else
|
|
52
66
|
:invalid_archive
|
|
53
67
|
end
|
data/lib/feh/bin/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: feh-bin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Quinton Miller
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-09
|
|
11
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|