add a chunkhook mechanism to codemac