@@ -138,6 +138,7 @@ def get_state1(data)
138
138
end
139
139
state
140
140
end
141
+
141
142
def get_state2 ( data )
142
143
if data [ 16 ..17 ] == '04'
143
144
state = 'STOP'
@@ -149,6 +150,7 @@ def get_state2(data)
149
150
end
150
151
state
151
152
end
153
+
152
154
def get_cpu ( rhost , rport , devicetype )
153
155
connect ( true , 'RHOST' => rhost , 'RPORT' => rport )
154
156
state = 'unknown'
@@ -158,7 +160,8 @@ def get_cpu(rhost, rport, devicetype)
158
160
send_recv_once ( "\x01 \x00 \x02 \x00 \x00 \x00 \x1c \x00 \x03 \x00 \x03 \x00 \x00 \x00 \x00 \x00 \x0c \x00 \x00 \x00 \x07 \x00 \x05 \x00 \x06 \x00 \x08 \x00 \x10 \x00 \x02 \x00 \x11 \x00 \x0e \x00 \x0f \x00 \r \x00 \x16 @\x16 \x00 " )
159
161
## Query packet
160
162
data = send_recv_once ( "\x01 \x00 \x02 \x00 \x00 \x00 \x08 \x00 \x03 \x00 \x03 \x00 \x00 \x00 \x00 \x00 \x02 \x00 \x00 \x00 \x02 \x40 \x0b \x40 " )
161
- state = get_state1 ( data ) elsif devicetype == '39x'
163
+ state = get_state1 ( data )
164
+ elsif devicetype == '39x'
162
165
init_phase2
163
166
data = send_recv_once ( "\xcc \x01 \x00 \x0f @\x07 \x00 \x00 \xea \xfa " )
164
167
state = get_state2 ( data )
@@ -168,7 +171,8 @@ def get_cpu(rhost, rport, devicetype)
168
171
state
169
172
end
170
173
171
- def set_cpu ( rhost , rport , action , state , devicetype ) connect ( true , 'RHOST' => rhost , 'RPORT' => rport )
174
+ def set_cpu ( rhost , rport , action , state , devicetype )
175
+ connect ( true , 'RHOST' => rhost , 'RPORT' => rport )
172
176
if devicetype == '15x'
173
177
init_phase1 ## Several packets (21)
174
178
send_recv_once ( "\x01 \x00 \x02 \x00 \x00 \x00 \x1c \x00 \x03 \x00 \x03 \x00 \x00 \x00 \x00 \x00 \x0c \x00 \x00 \x00 \x07 \x00 \x05 \x00 \x06 \x00 \x08 \x00 \x10 \x00 \x02 \x00 \x11 \x00 \x0e \x00 \x0f \x00 \r \x00 \x16 @\x16 \x00 " )
@@ -178,7 +182,8 @@ def set_cpu(rhost, rport, action, state, devicetype) connect(true, 'RHOST' =>
178
182
else
179
183
print_status ( '--> Sending STOP now' )
180
184
send_recv_once ( "\x01 \x00 \x02 \x00 \x00 \x00 \x00 \x00 \x01 \x00 \x07 \x00 \x00 \x00 \x00 \x00 " )
181
- end elsif devicetype == '39x'
185
+ end
186
+ elsif devicetype == '39x'
182
187
init_phase2 ## Several packets (6)
183
188
if action == 'START' || ( action == 'REV' && state == 'STOP' )
184
189
print_status ( '--> Sending COLD start now' )
0 commit comments