require "twib/interface.rb" require "twib/switch/debug.rb" module Twib module Interfaces class ITwibDebugger < Interface module Command QUERY_MEMORY = 10 READ_MEMORY = 11 WRITE_MEMORY = 12 LIST_THREADS = 13 GET_DEBUG_EVENT = 14 GET_THREAD_CONTEXT = 15 BREAK_PROCESS = 16 CONTINUE_DEBUG_EVENT = 17 SET_THREAD_CONTEXT = 18 GET_NSO_INFOS = 19 WAIT_EVENT = 20 end def query_memory(addr) Hash[ [:base, :size, :memory_type, :memory_attribute, :permission, :device_ref_count, :ipc_ref_count].zip( send(Command::QUERY_MEMORY, [addr].pack("Q<")).wait_ok.payload.unpack("Q