node/lib/metasm/metasm/disassemble.rb
def detect_function_thunk_noreturn(addr)
		5.times {
			return if not di = di_at(addr)
			if di.opcode.props[:saveip] and not di.block.to_subfuncret
				if di.block.to_normal.to_a.length == 1
					taddr = normalize(di.block.to_normal.first)
					if di_at(taddr)
						@function[taddr] ||= DecodedFunction.new
						return detect_function_thunk(taddr)
					end
				end
				break
			else
				from = di.block.from_normal.to_a + di.block.from_subfuncret.to_a
				if from.length == 1
					addr = from.first
				else break
				end
			end
		}
	end
# this is called when reaching a noreturn function call, with the call address
# it is responsible for detecting the actual 'call' instruction leading to this
# noreturn function, and eventually mark the call target as a thunk
this is called when reaching a noreturn function call, with the call address
it is responsible for detecting the actual 'call' instruction leading to this
noreturn function, and eventually mark the call target as a thunk
this is called when reaching a noreturn function call with the call address it is responsible for detecting the actual ' call ' instruction leading to this noreturn function and eventually mark the call target as a thunk
def detect_function_thunk_noreturn(addr)
		5.times {
			return if not di = di_at(addr)
			if di.opcode.props[:saveip] and not di.block.to_subfuncret
				if di.block.to_normal.to_a.length == 1
					taddr = normalize(di.block.to_normal.first)
					if di_at(taddr)
						@function[taddr] ||= DecodedFunction.new
						return detect_function_thunk(taddr)
					end
				end
				break
			else
				from = di.block.from_normal.to_a + di.block.from_subfuncret.to_a
				if from.length == 1
					addr = from.first
				else break
				end
			end
		}
	end
def detect_function_thunk_noreturn ( addr ) 5 . times { return if not di = di_at ( addr ) if di . opcode . props [ :saveip ] and not di . block . to_subfuncret if di . block . to_normal . to_a . length == 1 taddr = normalize ( di . block . to_normal . first ) if di_at ( taddr ) @function [ taddr ] ||= DecodedFunction . new return detect_function_thunk ( taddr ) end end break else from = di . block . from_normal . to_a + di . block . from_subfuncret . to_a if from . length == 1 addr = from . first else break end end } end
this is called when reaching a noreturn function call, with the call address
it is responsible for detecting the actual 'call' instruction leading to this
noreturn function, and eventually mark the call target as a thunk
this is called when reaching a noreturn function call with the call address it is responsible for detecting the actual ' call ' instruction leading to this noreturn function and eventually mark the call target as a thunk
addr