Browse Prior Art Database

Round Robin Hooking Technique

IP.com Disclosure Number: IPCOM000082925D
Original Publication Date: 1975-Mar-01
Included in the Prior Art Database: 2005-Feb-28
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Winters, RM: AUTHOR

Abstract

Many software measurement programs require hooks in the operating system to gain control when statistically significant events occur. The classic approach to setting hooks in the operating system is to overlay the operation code of the instruction hooked with an illegal OP code. The program check new Program Status Word (PSW) is modified to contain the entry point of the measurement program, which will receive control when the instruction is encountered. Because the illegal OP code must be retained for subsequent attempts to execute the instruction, the instruction is executed out-of-place by a generalized instruction simulation routine. The instruction simulation routine can account for one-third of the CPU time in processing a hook.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 70% of the total text.

Page 1 of 1

Round Robin Hooking Technique

Many software measurement programs require hooks in the operating system to gain control when statistically significant events occur. The classic approach to setting hooks in the operating system is to overlay the operation code of the instruction hooked with an illegal OP code. The program check new Program Status Word (PSW) is modified to contain the entry point of the measurement program, which will receive control when the instruction is encountered. Because the illegal OP code must be retained for subsequent attempts to execute the instruction, the instruction is executed out-of-place by a generalized instruction simulation routine. The instruction simulation routine can account for one-third of the CPU time in processing a hook.

A round-robin hooking technique can be used to solve this timing problem. When a hook is encountered, the previous hook is reset to an illegal OP code. The valid OP code of the hooked instruction is restored and the monitor exits to reexecute the hooked instruction. On the subsequent entry, the previous hook is reset and the process continues in this manner with no instruction simulation needed.

The following is a comparison of the steps that are required for the two techniques: Classic Techniques Round-Robin Hooking Techniques 1) Identify the hook 1) Identify the hook encountered. encountered. 2) Collect statistical 2) Collect statistical data. data. 3) Simulate the 3) Reset previous hook to instructio...