node/lib/metasm/metasm/cpu/ia32/decode.rb
def fix_fwdemu_binding(di, fbd)
		if di.instruction.args.grep(ModRM).find { |m| m.seg and m.symbolic(di).target.lexpr =~ /^segment_base_/ }
			fbd = fbd.dup
			fbd[:incomplete_binding] = Expression[1]
		end

		case di.opcode.name
		when 'push', 'call'
			fbd = fbd.dup
			sz = opsz(di)/8
			esp = register_symbols[4]
			if i = fbd.delete(Indirection[esp, sz])
				fbd[Indirection[[esp, :-, sz], sz]] = i
			end
		when 'pop', 'ret' # nothing to do
		when /^(push|pop|call|ret|enter|leave|stos|movs|lods|scas|cmps)/
			fbd = fbd.dup
			fbd[:incomplete_binding] = Expression[1]	# TODO
		end
		fbd
	end
# patch a forward binding from the backtrace binding
# fixes fwdemu for push/pop/call/ret
patch a forward binding from the backtrace binding
fixes fwdemu for push/pop/call/ret
patch a forward binding from the backtrace binding fixes fwdemu for push / pop / call / ret
def fix_fwdemu_binding(di, fbd)
		if di.instruction.args.grep(ModRM).find { |m| m.seg and m.symbolic(di).target.lexpr =~ /^segment_base_/ }
			fbd = fbd.dup
			fbd[:incomplete_binding] = Expression[1]
		end
		case di.opcode.name
		when 'push', 'call'
			fbd = fbd.dup
			sz = opsz(di)/8
			esp = register_symbols[4]
			if i = fbd.delete(Indirection[esp, sz])
				fbd[Indirection[[esp, :-, sz], sz]] = i
			end
		when 'pop', 'ret' 
		when /^(push|pop|call|ret|enter|leave|stos|movs|lods|scas|cmps)/
			fbd = fbd.dup
			fbd[:incomplete_binding] = Expression[1]	
		end
		fbd
	end
def fix_fwdemu_binding ( di , fbd ) if di . instruction . args . grep ( ModRM ) . find { | m | m . seg and m . symbolic ( di ) . target . lexpr =~ / ^segment_base_ / } fbd = fbd . dup fbd [ :incomplete_binding ] = Expression [ 1 ] end case di . opcode . name when 'push' , 'call' fbd = fbd . dup sz = opsz ( di ) / 8 esp = register_symbols [ 4 ] if i = fbd . delete ( Indirection [ esp , sz ] ) fbd [ Indirection [ [ esp , :- , sz ] , sz ] ] = i end when 'pop' , 'ret' when / ^(push|pop|call|ret|enter|leave|stos|movs|lods|scas|cmps) / fbd = fbd . dup fbd [ :incomplete_binding ] = Expression [ 1 ] end fbd end
patch a forward binding from the backtrace binding
fixes fwdemu for push/pop/call/ret
patch a forward binding from the backtrace binding fixes fwdemu for push / pop / call / ret
# nothing to do # TODO
di
fbd