xaba 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a4a201394557976db4185f74720f9d5fbe0a3f6d5ba46d5d915293fc9e2a79a
4
- data.tar.gz: 7d47f78b0a26305abd7aa7537dfbe81e28a145847656bb0ae2a5eb7d8d6830ba
3
+ metadata.gz: 9df8a823fee400fe703057e64d921db3b5e7c52c7233761892a175c05a93c22e
4
+ data.tar.gz: d1a03cc98cdd036672f17b896a8727e0a91a9f4d55dd68a3a4b1f841a84963af
5
5
  SHA512:
6
- metadata.gz: 5da843576b823b0e7eef843a1e230c78c42be8910f5955e470137b98132eccd9bbc6b807d36020c3b0617890279b22b17555209d8a91244f8fadf66fb87af49a
7
- data.tar.gz: c0ba45f8f366439ba38db54038ad4e0a180e3b222462ed21a7d2b5a06c67349c2a938640ce90e576d88d4e1f01ec17295f4c0d23dd9f550372ad6b354ace9c08
6
+ metadata.gz: 776708e3436e8c48e27ca1397265bf6f0b4dc829bd49c62d18e966325b40a237fcd10e6e090eba55a18e85459acb8a0838a3fc67375087f708c8ffacea59ac2a
7
+ data.tar.gz: 23b0c9b7ffbf222be6b27932ddf068548482b3f54f0311528835f3c21ad65e0acef4771dbc824dacb0346e1bd7694b9f9e1b16847780c353639b70cd1f6e19bb
data/Gemfile.lock CHANGED
@@ -10,34 +10,35 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  ast (2.4.2)
13
- diff-lcs (1.5.0)
13
+ diff-lcs (1.5.1)
14
14
  extlz4 (0.3.4)
15
15
  iostruct (0.0.5)
16
- json (2.7.1)
16
+ json (2.7.2)
17
17
  language_server-protocol (3.17.0.3)
18
- parallel (1.24.0)
19
- parser (3.3.0.4)
18
+ parallel (1.25.1)
19
+ parser (3.3.2.0)
20
20
  ast (~> 2.4.1)
21
21
  racc
22
- racc (1.7.3)
22
+ racc (1.8.0)
23
23
  rainbow (3.1.1)
24
- rake (13.1.0)
25
- regexp_parser (2.9.0)
26
- rexml (3.2.6)
27
- rspec (3.12.0)
28
- rspec-core (~> 3.12.0)
29
- rspec-expectations (~> 3.12.0)
30
- rspec-mocks (~> 3.12.0)
31
- rspec-core (3.12.2)
32
- rspec-support (~> 3.12.0)
33
- rspec-expectations (3.12.3)
24
+ rake (13.2.1)
25
+ regexp_parser (2.9.2)
26
+ rexml (3.3.0)
27
+ strscan
28
+ rspec (3.13.0)
29
+ rspec-core (~> 3.13.0)
30
+ rspec-expectations (~> 3.13.0)
31
+ rspec-mocks (~> 3.13.0)
32
+ rspec-core (3.13.0)
33
+ rspec-support (~> 3.13.0)
34
+ rspec-expectations (3.13.0)
34
35
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.12.0)
36
- rspec-mocks (3.12.6)
36
+ rspec-support (~> 3.13.0)
37
+ rspec-mocks (3.13.1)
37
38
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.12.0)
39
- rspec-support (3.12.1)
40
- rubocop (1.60.1)
39
+ rspec-support (~> 3.13.0)
40
+ rspec-support (3.13.1)
41
+ rubocop (1.64.1)
41
42
  json (~> 2.3)
42
43
  language_server-protocol (>= 3.17.0)
43
44
  parallel (~> 1.10)
@@ -45,27 +46,32 @@ GEM
45
46
  rainbow (>= 2.2.2, < 4.0)
46
47
  regexp_parser (>= 1.8, < 3.0)
47
48
  rexml (>= 3.2.5, < 4.0)
48
- rubocop-ast (>= 1.30.0, < 2.0)
49
+ rubocop-ast (>= 1.31.1, < 2.0)
49
50
  ruby-progressbar (~> 1.7)
50
51
  unicode-display_width (>= 2.4.0, < 3.0)
51
- rubocop-ast (1.30.0)
52
- parser (>= 3.2.1.0)
53
- rubocop-capybara (2.20.0)
52
+ rubocop-ast (1.31.3)
53
+ parser (>= 3.3.1.0)
54
+ rubocop-capybara (2.21.0)
54
55
  rubocop (~> 1.41)
55
- rubocop-factory_bot (2.25.1)
56
+ rubocop-factory_bot (2.26.0)
56
57
  rubocop (~> 1.41)
57
58
  rubocop-rake (0.6.0)
58
59
  rubocop (~> 1.0)
59
- rubocop-rspec (2.26.1)
60
+ rubocop-rspec (2.31.0)
60
61
  rubocop (~> 1.40)
61
62
  rubocop-capybara (~> 2.17)
62
63
  rubocop-factory_bot (~> 2.22)
64
+ rubocop-rspec_rails (~> 2.28)
65
+ rubocop-rspec_rails (2.29.0)
66
+ rubocop (~> 1.40)
63
67
  ruby-progressbar (1.13.0)
68
+ strscan (3.1.0)
64
69
  unicode-display_width (2.5.0)
65
70
  xxhash (0.5.0)
66
71
 
67
72
  PLATFORMS
68
73
  arm64-darwin-21
74
+ arm64-darwin-22
69
75
 
70
76
  DEPENDENCIES
71
77
  rake (~> 13.0)
data/exe/xaba CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "xaba"
4
+ require_relative "../lib/xaba"
5
5
 
6
6
  XABA::CLI.new.run
data/lib/xaba/cli.rb CHANGED
@@ -144,11 +144,14 @@ module XABA
144
144
  printf "%5d: %s\n", i, e.inspect
145
145
  end
146
146
  when 1
147
- printf "%4s %8s %8s %s\n", "idx", "compsz", "origsz", "name"
147
+ printf "%8s %8s %8s %8s %8s %8s %s\n", "idx", "doffset", "compsz", "origsz", "configsz", "dbgsz", "name"
148
148
  @manifest.assemblies.each_with_index do |a, i|
149
+ data_offset = @blob.descriptors[i].data_offset
149
150
  compsz = @blob.descriptors[i].data_size
150
151
  origsz = @blob.data_entries[i].original_size
151
- printf "%4d %8d %8d %s\n", a.blob_idx, compsz, origsz, a.name
152
+ configsz = @blob.descriptors[i].config_data_size
153
+ dbgsz = @blob.descriptors[i].debug_data_size
154
+ printf "%8d %8x %8d %8d %8d %8d %s\n", a.blob_idx, data_offset, compsz, origsz, configsz, dbgsz, a.name
152
155
  end
153
156
  else
154
157
  # minimal verbosity
@@ -172,6 +175,8 @@ module XABA
172
175
  decompressed = LZ4.block_decode(de.data)
173
176
  dll_fname = File.join(@options[:output], "#{name}.dll")
174
177
  File.binwrite dll_fname, decompressed
178
+
179
+ File.binwrite("#{dll_fname}.config", de.config) if de.config
175
180
  end
176
181
  end
177
182
 
@@ -13,8 +13,13 @@ module XABA
13
13
  @hash64_entries = @file_header.local_entry_count.times.map { HashEntry.read(f) }
14
14
 
15
15
  @data_entries = @descriptors.map do |d|
16
+ f.seek d.data_offset
16
17
  DataEntry.read(f).tap do |de|
17
18
  de.data = f.read(d.data_size - DataEntry::SIZE)
19
+ if d.config_data_offset != 0 && d.config_data_size != 0
20
+ f.seek d.config_data_offset
21
+ de.config = f.read(d.config_data_size)
22
+ end
18
23
  end
19
24
  end
20
25
  self
@@ -89,7 +94,7 @@ module XABA
89
94
  end
90
95
 
91
96
  class DataEntry < IOStruct.new("a4LL", :magic, :index, :original_size)
92
- attr_accessor :data
97
+ attr_accessor :data, :config
93
98
 
94
99
  def inspect
95
100
  super.sub(/^#<struct /, "<")
@@ -101,7 +106,7 @@ module XABA
101
106
 
102
107
  def self.read(f)
103
108
  r = super
104
- raise "invalid magic: #{r.magic}" if r.magic != "XALZ"
109
+ raise "invalid magic: #{r.magic.inspect}" if r.magic != "XALZ"
105
110
 
106
111
  r
107
112
  end
data/lib/xaba/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XABA
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xaba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "Zed" Zaikin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-20 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: extlz4
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.3.7
101
+ rubygems_version: 3.5.6
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: "(un)packer for Xamarin assemblies.blob"