74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/HardsploitAPI/Modules/NO_MUX_PARALLEL_MEMORY/HardsploitAPI_NO_MUX_PARALLEL_MEMORY.rb', line 74
def write_command_Memory_WithoutMultiplexing(address,data)
packet = HardsploitAPI.prepare_packet
packet.push 0 packet.push (1500/6.66).floor
packet.push ((address & 0xFF000000) >> 24 ) packet.push ((address & 0x00FF0000) >> 16 ) packet.push ((address & 0x0000FF00) >> 8 ) packet.push ((address & 0x000000FF) >> 0) packet.push 0x20 packet.push ((data & 0xFF00) >> 8 ) packet.push ((data & 0xFF) >> 0)
result = HardsploitAPI.instance.sendAndReceiveDATA(packet,1000)
if result == USB_STATE::TIMEOUT_RECEIVE then
raise "TIMEOUT"
elsif result[4] == (data & 0xFF)
return readByteFromMemory(0)
else
raise "ERROR BAD RESPONSE"
end
end
|