eculocate

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

otaclient.rb (246B)


      1 require 'socket'
      2 
      3 sock = TCPSocket.new("eculocate.local", 5000)
      4 
      5 rom_image = File.read(ARGV[1], mode: "rb")
      6 
      7 image_len = rom_image.size
      8 
      9 
     10 payload = "ROM0" + ("z" * 64) + [image_len].pack("L>") + rom_image
     11 
     12 sock.write(payload)
     13 
     14 puts sock.readline