Method: HardsploitAPI_PARALLEL#write_command_Memory_WithoutMultiplexing

Defined in:
lib/HardsploitAPI/Modules/NO_MUX_PARALLEL_MEMORY/HardsploitAPI_NO_MUX_PARALLEL_MEMORY.rb

#write_command_Memory_WithoutMultiplexing(address, data) ⇒ Object



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 #16 bits
	packet.push (1500/6.66).floor  #latency at 1500ns

	packet.push  ((address & 0xFF000000) >> 24 ) #AddStart3
	packet.push  ((address & 0x00FF0000) >> 16 ) #AddStart2
	packet.push  ((address & 0x0000FF00) >> 8 )  #AddStart1
	packet.push  ((address & 0x000000FF) >> 0)   #AddStart0
	packet.push 0x20 #Memory write command
	packet.push  ((data & 0xFF00) >> 8 )  #Data HIGHT BYTE
	packet.push  ((data & 0xFF) >> 0)  #Data LOW BYTE


	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