I may be wrong, but this is what I have been told by my sources:
You are wasting your (and our) time, because the 'real' number can NOT be found programmatically, no matter how much you try! It is printed on the HD after the HD is produced, and only the HD factory knows the link between the 'real' serial number and the 'smart' serial number. This link is used to discover fraud. You have to use a keyboard or a barcode scanner to read the 'real' serial number.
>How to get real HD serial number