Class: Rex::Proto::MsDtyp::MsDtypSystemAuditObjectAceBody

Inherits:
MsDtypAceObjectBody
  • Object
show all
Defined in:
lib/rex/proto/ms_dtyp.rb

Overview

Instance Method Summary collapse

Instance Method Details

#calc_app_data_lengthObject



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/rex/proto/ms_dtyp.rb', line 190

def calc_app_data_length
  ace_header = parent&.header
  return 0 if ace_header.nil?
  ace_size = ace_header&.ace_size
  return 0 if ace_size.nil? or (ace_size == 0)

  ace_header_length = ace_header.to_binary_s.length
  body = parent&.body
  if body.nil?
    return 0 # Read no data as there is no body, so either we have done some data misalignment or we shouldn't be reading data.
  else
    ace_body_length = body.to_binary_s.length
    return ace_size - (ace_header_length + ace_body_length)
  end
end