In the general case, that's not possible. The procedure I use starts with a sniff test, looking for regularity in the sequences of numbers or trying to make sense of them from their given names, numbers and the way they're used. If I can't determine it's just data, or find strong indication that it's code, I try to get ahold of the driver maintainer or the hardware designer. Ultimately, I have to go by whatever info I get and a sense of trust for whoever provides it and, in the worst case, make a conservative assumption that it may be software (instructions to configure a general-purpose computer to behave in a certain way) or a mix of software and pure data, and go with that.