twib 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 924247a04b085caf05ae7d219f48f90ef2c557ee
4
- data.tar.gz: e4891c0e24c2ad24b7dd872c824634986458c475
2
+ SHA256:
3
+ metadata.gz: 8a26649a38a5e8d6c227549582134bce5b80bb0ad05937148f81d6cd6f8fe5b0
4
+ data.tar.gz: b3e043a2df363f1dfa4106c2bbe0728b0f6623fd0abf2a5e8fa1f01badbd7127
5
5
  SHA512:
6
- metadata.gz: a8dc7d5c50a42e2313eb906011be19a6492a95ed57c4b9c0381e18e0af51272d9dc9c165e3377539640d5a8850202d1515e6fa8dfb8638a4793f6d266140f742
7
- data.tar.gz: d0616b86d2658ff4abc5eaf18e9deaf4e47b8ce99002e7d2a2ef1fd889fea27550ebce839a2f1aab2190759fb5822d41409fff7b17aed3aeeb6029f2948604ed
6
+ metadata.gz: 4c3f1ddf2bcbed2e237e48b6ca51266d4908dde541859ac5527e4616ea5a5c5b897c430fc44e14bc3f326cb86081c0eb71d21318640d9215eeb0b48468007191
7
+ data.tar.gz: 723fcacd98e07f863c3f290fcf59f44319c5c944f9d1b5083e1b7ccc9b144d8453a1efa1276260dd6f8e235d1b51607128679fc79d9f1e24203c594fe905281d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twib (0.1.2)
4
+ twib (0.1.3)
5
5
  msgpack
6
6
 
7
7
  GEM
@@ -34,4 +34,4 @@ DEPENDENCIES
34
34
  twib!
35
35
 
36
36
  BUNDLED WITH
37
- 1.16.1
37
+ 1.16.2
@@ -97,7 +97,7 @@ module Twib
97
97
  # Connects to twibd using the standard UNIX socket address.
98
98
  # @return [TwibConnection]
99
99
  def self.connect_unix
100
- return self.new(UNIXSocket.new("/var/run/twibd.sock"))
100
+ return self.new(UNIXSocket.new(ENV["TWIB_UNIX_FRONTEND_PATH"] || "/var/run/twibd.sock"))
101
101
  end
102
102
 
103
103
  # Creates a TwibConnection using the specified socket
@@ -41,7 +41,9 @@ module Twib
41
41
  # @param size [Integer] How many bytes to read
42
42
  # @return [String]
43
43
  def read_memory(addr, size)
44
- send(Command::READ_MEMORY, [addr, size].pack("Q<Q<")).wait_ok.payload
44
+ response = send(Command::READ_MEMORY, [addr, size].pack("Q<Q<")).wait_ok.payload
45
+ length = response.unpack("Q<")[0]
46
+ return response[8, length]
45
47
  end
46
48
 
47
49
  # Writes to process memory at the given address.
@@ -49,7 +51,7 @@ module Twib
49
51
  # @param string [String] Data to write
50
52
  # @return [String]
51
53
  def write_memory(addr, string)
52
- send(Command::WRITE_MEMORY, [addr].pack("Q<") + string).wait_ok
54
+ send(Command::WRITE_MEMORY, [addr, string.bytesize].pack("Q<Q<") + string).wait_ok
53
55
  string
54
56
  end
55
57
 
@@ -87,7 +89,7 @@ module Twib
87
89
  # @param flags [Integer] See http://www.switchbrew.org/index.php?title=SVC#ContinueDebugFlagsOld
88
90
  # @return [self]
89
91
  def continue_debug_event(flags, thread_ids=[])
90
- send(Command::CONTINUE_DEBUG_EVENT, ([flags] + thread_ids).pack("L<Q<*")).wait_ok
92
+ send(Command::CONTINUE_DEBUG_EVENT, ([flags, thread_ids.length] + thread_ids).pack("L<Q<Q<*")).wait_ok
91
93
  self
92
94
  end
93
95
 
@@ -14,7 +14,9 @@ module Twib
14
14
  # Lists devices known to twibd.
15
15
  # @return [Array<Hash>]
16
16
  def list_devices
17
- MessagePack.unpack(send(Command::LIST_DEVICES).wait_ok.payload)
17
+ response = send(Command::LIST_DEVICES).wait_ok.payload
18
+ size = response.unpack("Q<")[0]
19
+ MessagePack.unpack(response[8, size])
18
20
  end
19
21
  end
20
22
  end
@@ -1,3 +1,3 @@
1
1
  module Twib
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - misson20000
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-11 00:00:00.000000000 Z
11
+ date: 2019-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.6.12
114
+ rubygems_version: 2.7.7
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Twili bridge client for Ruby