Add from_hook

Signed-off-by: Yen-Chin Lee <coldnew.tw@gmail.com>