首页 > 作文

VBA工程加密PJ方式(两种)

更新时间:2023-04-04 00:25:21 阅读: 评论:0

两种方式破解vba加密代码

第一种:

sub vbapassword1() '你要解保护的excel文件路径    filename = application.getopenfilename("excel文件(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt", , "vba破解")    if dir(filename) = "" then        msgbox "没找到相关文件,清重新设置。"        exit sub    el        filecopy filename, filename & ".bak" '备份文件。    end if    dim getdata as string * 5    open filename for binary as #1    dim cmgs as long    dim dpbo as long    for i = 1 to lof(1)        get #1, i, getdata        if getdata = "cmg=""" then cmgs = i        if getdata = "[host" then dpbo = i - 2: exit for    next    if cmgs = 0 then        msgbox "请先对vba编码设置一个保护密码...", 32, "提示"        exit sub    end if 工作措施怎么写   dim st as string * 2    dim s20 as string * 1    '取得一个0d0a十六进制字串    get #1, cmgs - 2, st    '取得一个20十六制字串    get #1, dpbo + 16, s20    '替换加密部份机码    for i = cmgs to dpbo step 2        put #1, i, st    next    '加入不配对符号    if (dpbo - cmgs) mod 2 <> 0 then        put #1, dpbo + 1, s20    end if    msgbox "文件解密成功......", 32, "提示"    clo #1end sub

第二种:

option explicit    private declare sub movememory lib "kernel32" alias "rtlmovememory" (destination as long, source as long, byval length as long)    private declare function virtualprotect lib "kernel32" (lpaddress as long, byval dwsize as long, byval flnewprotect as long, lpfloldprotect as long) as long    private declare function getmodulehandlea lib "kernel32" (byval lpmodulename as string) as long    private declare function getprocaddress lib "kernel32" (万圣夜什么意思byval hmodule as long, byval lpprocname as string) as long    private declare function dialogboxparam lib "ur32" alias "dialogboxparama" (byval hinstance as long, byval ptemplatename as long, byval hwndparent as long, byval lpdialogfunc as long, byval dwinitparam as long) as integer    dim hookbytes(0 to 5) as byte    dim originbytes(0 to 5) as byte    dim pfunc as long    dim flag as booleanprivate function getptr(byval value as long) as long    getptr = valueend functionpublic sub recoverbytes()    if flag then movememory byval pfunc, byval varptr(originbytes(0)), 6end subpublic function hook() as boolean    dim tmpbytes(0 to 5) as byte    dim p as long    dim originprotect as long    hook = fal    pfunc = getprocaddress(getmodulehandlea("ur32.dll"), "dialogboxparama")    if virtualprotect(byval pfunc, 6, &h40, originprotect) <> 0 then        movememory byval varptr(tmpbytes(0)), byval pfunc, 6        if tmpbytes(0) <> &h68 then            movememory byval varptr(originbytes(0)), byval pfunc, 6            p = getptr(addressof mydialogboxparam)            hookbytes(0) = &h68            movememory byval varptr(hookbytes(1)), byval varptr(p), 4            hookbytes(5) = &hc3            movememory byval pfunc, byval varptr(hookbytes(0)), 6            flag = true            hook = true        end if    e肃然起敬nd ifend functionprivate function mydialogboxparam(byval hinstance as long, _byval ptemplatename as long, byval hwndparent as long, _byval lpdialogfunc as long, byval dwinit安全教育与培训制度param as long) as integer    if ptemplatename = 4070 then        mydialogboxparam = 1    el        recoverbytes        mydialogboxparam = dialogboxparam(hinstance, ptemplatename, hwndparent, lpdialogfunc, dwinitparam)        hook   长春科技学院 end ifend functionsub crack()    if hook then msgbox "破解成功"end sub

本文来自博客园,作者:张翰博,转载请注明原文链接:/d/file/titlepic/15638693.html

本文发布于:2023-04-04 00:25:19,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/af8cb0e3ec43ccc16db65eff61f4eb07.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:VBA工程加密PJ方式(两种).doc

本文 PDF 下载地址:VBA工程加密PJ方式(两种).pdf

标签:文件   两种   字串   提示
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图