Both the iPhone and Chronic Dev Teams have confirmed that their respective jailbreaking tools, Redsn0w and GreenPois0n are going open source, which means that the entire source code of the mentioned tools will be available to public for free. You can then use the source code to modify the tool to your own liking, or even improve it for the betterment of the jailbreaking community.
MuscleNerd confirmed it on behalf of the iPhone Dev Team:
MuscleNerd: @chpwn redsn0w will be open source soon 🙂
and P0sixninja on behalf of the Chronic Dev Team:
p0sixninja: Greenpois0n components will be updated/open sourced as soon as it’s out of beta.
GreenPois0n can be used to jailbreak iOS 4.1 on iPhone 4, 3GS, iPad and iPod touch 4G / 3G / 2G. Simply follow our step by step guide posted here (for Windows), or here (for Mac) and here (for Linux) to jailbreak iPhone 4, 3GS, iPad, iPod touch 4G / 3G / 2G on iOS 4.1 with GreenPois0n.