Favourites could be generated by other than XBMC.

CUtil::SplitExecFunction() is what you want.  That'll get you the function name (ActivateWindow etc.) as well as the (unquoted) parameters in a parameter vector.  You can then fairly simply check things off (convert first param of ActivateWindow if StringUtils::IsNaturalNumber() etc.)