node/lib/metasm/metasm/exe_format/coff_decode.rb
def decode(coff)
			super(coff)
			len = coff.decode_word
			len -= 8
			if len < 0 or len % 2 != 0
				puts "W: COFF: Invalid relocation table length #{len+8}" if $VERBOSE
				coff.curencoded.read(len) if len > 0
				@relocs = []
				return
			end

			@relocs = coff.curencoded.read(len).unpack(coff.endianness == :big ? 'n*' : 'v*').map { |r| Relocation.new(r&0xfff, r>>12) }
			#(len/2).times { @relocs << Relocation.decode(coff) }	# tables may be big, this is too slow
		end
# decodes a relocation table from coff.encoded.ptr
decodes a relocation table from coff.encoded.ptr
decodes a relocation table from coff . encoded . ptr
def decode(coff)
			super(coff)
			len = coff.decode_word
			len -= 8
			if len < 0 or len % 2 != 0
				puts "W: COFF: Invalid relocation table length #{len+8}" if $VERBOSE
				coff.curencoded.read(len) if len > 0
				@relocs = []
				return
			end
			@relocs = coff.curencoded.read(len).unpack(coff.endianness == :big ? 'n*' : 'v*').map { |r| Relocation.new(r&0xfff, r>>12) }
		end
def decode ( coff ) super ( coff ) len = coff . decode_word len -= 8 if len < 0 or len % 2 != 0 puts "W: COFF: Invalid relocation table length #{len+8}" if $VERBOSE coff . curencoded . read ( len ) if len > 0 @relocs = [ ] return end @relocs = coff . curencoded . read ( len ) . unpack ( coff . endianness == :big ? 'n*' : 'v*' ) . map { | r | Relocation . new ( r & 0xfff , r >> 12 ) } end
decodes a relocation table from coff.encoded.ptr
decodes a relocation table from coff . encoded . ptr
#(len/2).times { @relocs << Relocation.decode(coff) }	# tables may be big, this is too slow
coff