Method: Rex::OLE::MiniFAT#allocate_sector

Defined in:
lib/rex/ole/minifat.rb

#allocate_sectorObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rex/ole/minifat.rb', line 37

def allocate_sector
  idx = @entries.index(SECT_FREE)

  if (not idx)
    # add a sector worth
    idx = @entries.length
    @stg.header.idx_per_sect.times {
      @entries << SECT_FREE
    }
  end

  # default mini-sectors to end of chain
  @entries[idx] = SECT_END
  idx
end