Hi @sravya shivapuram ,
As far as I know, you can only open the wsp file as a cab and modify the files from there. The downside is that all the code will be compiled into assemblies and there will be no way to extract the code from them.
You could create a new Visual Studio web part project and add the assemblies from the wsp file and see if there are any open facing classes or members that can be accessed and go from there.
For more information
https://social.msdn.microsoft.com/Forums/office/en-US/0dd0bf72-638a-4840-9540-f6d0307bb786/how-to-edit-existing-wsp?forum=sharepointdevelopmentlegacy
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.