parameters: (self, read_address, read_size)
return_statement: return result
docstring: >>> c.read_memory(0x100000, 4)
          b'\\x07\\x00\\x00\\xeb'
docstring_summary: >>> c.read_memory(0x100000, 4)
          b'\\x07\\x00\\x00\\xeb'
docstring_tokens: >>> c . read_memory ( 0x100000 4 ) b \\ x07 \\ x00 \\ x00 \\ xeb
function: def read_memory(self, read_address, read_size):
          """
          >>> c.read_memory(0x100000, 4)
          b'\\x07\\x00\\x00\\xeb'
          """
          result = bytes()
          while read_size > 0:
              temp_read_size = min(read_size, MAX_REQUEST_DATA_SIZE)
              request_data = struct.pack("II", read_address, temp_read_size)
              request, request_id = self._generate_header(RequestType.ReadMemory, len(request_data))
              request += request_data
              self.socket.sendto(request, (self.address, CITRA_PORT))
  
              raw_reply = self.socket.recv(MAX_PACKET_SIZE)
              reply_data = self._read_and_validate_header(raw_reply, request_id, RequestType.ReadMemory)
  
              if reply_data:
                  result += reply_data
                  read_size -= len(reply_data)
                  read_address += len(reply_data)
              else:
                  return None
  
          return result
function_tokens: def read_memory ( self , read_address , read_size ) : result = bytes ( ) while read_size > 0 : temp_read_size = min ( read_size , MAX_REQUEST_DATA_SIZE ) request_data = struct . pack ( "II" , read_address , temp_read_size ) request , request_id = self . _generate_header ( RequestType . ReadMemory , len ( request_data ) ) request += request_data self . socket . sendto ( request , ( self . address , CITRA_PORT ) ) raw_reply = self . socket . recv ( MAX_PACKET_SIZE ) reply_data = self . _read_and_validate_header ( raw_reply , request_id , RequestType . ReadMemory ) if reply_data : result += reply_data read_size -= len ( reply_data ) read_address += len ( reply_data ) else : return None return result