首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Unlock a VBA password protected Excel file By HKL,

Unlock a VBA password protected Excel file By HKL,

作者头像
hiplon
发布2020-07-22 10:44:16
5240
发布2020-07-22 10:44:16
举报
文章被收录于专栏:VNFVNF

Unlock a VBA password protected Excel file

##(怎样解除受VBA密码保护的Excel文件)

Ever felt the need to open a VBA protected excel file… maybe one of your old files that contained an excellent routine! How do you come out of that pain?

当你想要打开一个VBA加密的文件。这篇文章可能会帮助到你。。

Important: This article is for educational purposes. Try this method for opening ONLY your own files, as I did too!

(只能用于测试自己的文件!!)

以下是正文内容。这些英文比较简单。只翻译一些主要步骤。其他就自己看吧。

So how does Excel store the file contents – cell data including formulas and formats, conditional formatting, VBA code, etc. etc. Lets investigate.

Create a new Excel file MyTest.xlsm and enter some dummy test data in the first sheet. (先新建一个xlsm文件。)

Add some formulas and conditional formatting (if you want to really understand the details).)(自己输入一些内容)

Let us now see how excel stores this data in the file.

Open the file in notepad or a hex editor.(用记事本打开该文件,推荐用notepad++)

Did you notice the first 2 characters? “PK”. (前两字“PK”)

So Excel compresses its file contents. Now we know why there is not much difference if you compress an Office 2007 file.

Lets look into the compressed contents. Rename the file extension from .xlsm to .zip。(改文件后缀为zip)

Open the MyFile.zip file. (打开改后缀后的文件)

Wow! its an extensive structure with xml files to store the workbook, worksheets, calculations, sharedstrings, etc.

This is how the XML of the Sheet1 looks

Lets explore more. Lets go back to our original file and add some VBA code to it.

Add a password and protect the VBA code.(添加个VBA密码)

Save the file and redo the same steps as earlier to open the xml file structure.

We now have another XML file called vbaProject.bin.(之前的xml文件都变成了个vbaProject.bin)

This is the file that I need to recover.

Lets investigate further.

Open this file “vbaProject.bin” in a Hex Editor (there are lots of free ones out there… the one I use is Hex Editor Neo

(用 Hex Editor Neo打开文件 “vbaProject.bin”)

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Unlock a VBA password protected Excel file
  • 当你想要打开一个VBA加密的文件。这篇文章可能会帮助到你。。
    • (只能用于测试自己的文件!!)
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档