node/lib/metasm/metasm/cpu/ia32/compile_c.rb
# adds the metasm_intern_geteip function, which returns its own address in eax (used for PIC addressing)
adds the metasm_intern_geteip function, which returns its own address in eax (used for PIC addressing)
adds the metasm_intern_geteip function which returns its own address in eax ( used for PIC addressing )
def c_program_epilog
		if defined? @need_geteip_stub and @need_geteip_stub
			return if new_label('metasm_intern_geteip') != 'metasm_intern_geteip'	
			eax = Reg.new(0, @cpusz)
			label = new_label('geteip')
			@source << Label.new('metasm_intern_geteip')
			instr 'call', Expression[label]
			@source << Label.new(label)
			instr 'pop', eax
			instr 'add', eax, Expression['metasm_intern_geteip', :-, label]
			instr 'ret'
		end
	end
def c_program_epilog if defined? @need_geteip_stub and @need_geteip_stub return if new_label ( 'metasm_intern_geteip' ) != 'metasm_intern_geteip' eax = Reg . new ( 0 , @cpusz ) label = new_label ( 'geteip' ) @source << Label . new ( 'metasm_intern_geteip' ) instr 'call' , Expression [ label ] @source << Label . new ( label ) instr 'pop' , eax instr 'add' , eax , Expression [ 'metasm_intern_geteip' , :- , label ] instr 'ret' end end
adds the metasm_intern_geteip function, which returns its own address in eax (used for PIC addressing)
adds the metasm_intern_geteip function which returns its own address in eax ( used for PIC addressing )
# already defined elsewhere #File.open('m-dbg-precomp.c', 'w') { |fd| fd.puts @parser } #File.open('m-dbg-src.asm', 'w') { |fd| fd.puts @source }