Last 7 digits of the serial number for the Sony PCG series laptop can be entered at the web page shown to generate a new code.
For other models, with VGN shown below, after entering the wrong password 3 wrongl times, a number appears.
Sony PCG series can be unlocked by last 7 digit from serial number
Sony VGN-A series after 3 tries it generate random xxxx - 4-hex code
Sony VGN other series after 3 wrong tries it generate random 5x4 code, do not turn off laptop until get master password
For example: Sony VAIO VGN-SZ22 [268r-dkxj-38j7-9j2k] password: 33637436
If you enter the number in the web site below, it generates a code for you to use.
Let us know if this works for you.