node/lib/metasm/samples/dbg-apihook.rb
# patch the value of an argument
# only valid in pre_hook
# nr starts at 0
patch the value of an argument
only valid in pre_hook
nr starts at 0
patch the value of an argument only valid in pre_hook nr starts at 0
def patch_arg(nr, value)
		case @cur_abi
		when :fastcall
			case nr
			when 0
				@dbg.set_reg_value(:ecx, value)
				return
			when 1
				@dbg.set_reg_value(:edx, value)
				return
			else
				nr -= 2
			end
		when :thiscall
			case nr
			when 0
				@dbg.set_reg_value(:ecx, value)
				return
			else
				nr -= 1
			end
		end
		@dbg.func_arg_set(nr, value)
	end
def patch_arg ( nr , value ) case @cur_abi when :fastcall case nr when 0 @dbg . set_reg_value ( :ecx , value ) return when 1 @dbg . set_reg_value ( :edx , value ) return else nr -= 2 end when :thiscall case nr when 0 @dbg . set_reg_value ( :ecx , value ) return else nr -= 1 end end @dbg . func_arg_set ( nr , value ) end
patch the value of an argument
only valid in pre_hook
nr starts at 0
patch the value of an argument only valid in pre_hook nr starts at 0
nr
value