Jump to content

Stubroutine

From Wikipedia, the free encyclopedia

A stubroutine (also known as a stub function, null script, null subroutine, or null function) is a command script or program subroutine which does nothing but return a constant value. The term itself is a portmanteau of "stub" and "subroutine", and typically refers to a placeholder function or subroutine that is not yet fully implemented but provides the necessary interface (like inputs and outputs) for the rest of the program to function.

They are used during program development, where the functional implementation of routines is delayed while other routines are developed, which allows developers to continue building and testing other parts of the software even when certain functions or subroutines are not fully developed. This is also one of the techniques used by the software cracking community to bypass callbacks and license-checking code: the target program is disassembled and the appropriate code is substituted for a null subroutine that just returns the value expected by the caller.