syspy 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tds_package_stream.rb +4 -4
- metadata +1 -1
data/lib/tds_package_stream.rb
CHANGED
@@ -62,7 +62,7 @@ module Syspy
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def handle_package(io)
|
65
|
-
token =
|
65
|
+
token = Bytes.uint(io)
|
66
66
|
token_class = TdsTokens.token_class(token)
|
67
67
|
if(token_class)
|
68
68
|
length = TdsTokens.fixed_length(token)
|
@@ -88,7 +88,7 @@ module Syspy
|
|
88
88
|
}
|
89
89
|
|
90
90
|
# read IP version and header length
|
91
|
-
ver_len =
|
91
|
+
ver_len = Bytes.uint(io)
|
92
92
|
version = ver_len >> 4
|
93
93
|
|
94
94
|
raise "Invalid IP version: #{version}" unless version == 4 || version == 6
|
@@ -96,7 +96,7 @@ module Syspy
|
|
96
96
|
header_length = (ver_len & 0x0F) * 4
|
97
97
|
|
98
98
|
# skip TOS
|
99
|
-
|
99
|
+
Bytes.uint(io)
|
100
100
|
|
101
101
|
# get package length
|
102
102
|
content_length = Bytes.uint16be(io)
|
@@ -111,7 +111,7 @@ module Syspy
|
|
111
111
|
io.read(12)
|
112
112
|
|
113
113
|
# get header length
|
114
|
-
tcp_offset = (
|
114
|
+
tcp_offset = (Bytes.uint(io) >> 4) * 4
|
115
115
|
|
116
116
|
# consume remaining tcp header
|
117
117
|
io.read(tcp_offset - 13)
|