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



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/rex/proto/ms_dtyp.rb', line 455

def calc_app_data_length
  ace_header = parent&.parent&.header
  ace_body = parent&.parent&.body
  return 0 if ace_header.nil? || ace_body.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
  if ace_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 = ace_body.to_binary_s.length
    return ace_size - (ace_header_length + ace_body_length)
  end
end