吾爱汇编

 找回密码
 立即注册

QQ登录

绑定QQ避免忘记帐号

查看: 658|回复: 4

[原创逆向图文] Sql Prompt全版本爆破实战

[复制链接]
壹佰 发表于 2024-4-7 13:45 | 显示全部楼层 |阅读模式

作为一款数据库领域常用的智能提示和格式化插件,SQL Prompt带给我们太多的方便。
网上一般会有一些离线注册的方案,操作不方便,也很挑版本。
今天尝试了一下新的破解思路,效果很不错,特分享给大家。


先介绍一下破解思路:


用dnSpy查了一下程序各个动态库的功能,发现最重要的一个库文件是:RedGate.Client.ActivationPluginShim.dll。
其下有一个重要的类型RedGate.Client.ActivationPluginShim.License。
我们只要保证其三个属性IsLicensed、IsTrial、HasFeature返回合适的值即可。


然后复原一下破解过程:


用Visual Studio新建一个.net 4x的类库项目SqlPromptCrack,添加一个名为SqlPromptHook的类,
用Nuget安装我最近发布的Crane.MethodHook v1.0.6版,最后SqlPromptHook类的完整代码如下:


[C#] 纯文本查看 复制代码
using System;
using System.Reflection;

namespace SqlPromptCrack
{
    public class SqlPromptHook
    {
        public static bool HookEnabled = false;
        private static Type Type_LicensingClientGui;
        public static void CheckAndHook()
        {
            if (HookEnabled == false)
            {
                var codeBase = Assembly.GetCallingAssembly().Location;
                var filePath = System.IO.Path.Combine(codeBase.Substring(0, codeBase.LastIndexOf("\\")), "RedGate.Client.ActivationPluginShim.dll");
                var assembly = Assembly.LoadFrom(filePath).GetName();

                var licenseType = Assembly.Load(assembly).GetType("RedGate.Client.ActivationPluginShim.Licence");
                var licensingClientGuiType = Assembly.Load(assembly).GetType("RedGate.Client.ActivationPluginShim.LicensingClientGui");
                Type_LicensingClientGui = licensingClientGuiType;

                Crane.MethodHook.MethodHookManager.Instance.AddHook(
                    new Crane.MethodHook.MethodHook(
                        licenseType.GetProperty("IsLicensed", BindingFlags.Public | BindingFlags.Instance).GetMethod,
                        typeof(SqlPromptHook).GetMethod(nameof(IsLicensedNew), BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(object) }, null)
                    )
                );
                Crane.MethodHook.MethodHookManager.Instance.AddHook(
                    new Crane.MethodHook.MethodHook(
                        licenseType.GetProperty("IsTrial", BindingFlags.Public | BindingFlags.Instance).GetMethod,
                        typeof(SqlPromptHook).GetMethod(nameof(IsTrialNew), BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(object) }, null)
                    )
                );
                Crane.MethodHook.MethodHookManager.Instance.AddHook(
                    new Crane.MethodHook.MethodHook(
                        licenseType.GetMethod("HasFeature", BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(string) }, null),
                        typeof(SqlPromptHook).GetMethod(nameof(HasFeatureNew), BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(object), typeof(string) }, null)
                    )
                );
                Crane.MethodHook.MethodHookManager.Instance.AddHook(
                    new Crane.MethodHook.MethodHook(
                        licensingClientGuiType.GetMethod("ShowManagementUi", BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(bool) }, null),
                        typeof(SqlPromptHook).GetMethod(nameof(ShowManagementUiNew), BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(object), typeof(bool) }, null)
                    )
                );

                Crane.MethodHook.MethodHookManager.Instance.StartHook();

                HookEnabled = true;
            }
        }

        public static bool IsLicensedNew(object license)
        {
            return true;
        }

        public static bool IsTrialNew(object license)
        {
            return false;
        }

        public static bool HasFeatureNew(object license, string free)
        {
            return true;
        }

        public static void ShowManagementUiNew(object obj, bool modal)
        {
            try
            {
                var methodInfo = Type_LicensingClientGui.GetMethod("ShowHtmlModal", BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[]
                {
                    typeof(string),
                    typeof(int),
                    typeof(int)
                }, null);
                methodInfo?.Invoke(obj, new object[] { GetHtml("Congratulations!!!", "This product is CRACKED. You can use it without any license."), 660, 360 });
            }
            finally
            {

            }
        }

        private static string GetHtml(string title, string message)
        {
            return string.Format("\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta charset=\"UTF-8\">\r\n    <title>Redgate Client Status</title>\r\n    <style>{0}</style>\r\n    <style>{1}</style>\r\n</head>\r\n\r\n<body class=\"ie7\">\r\n    <div class=\"band scheme--darkest-grey\">\r\n        <!-- Base64 encoding of redgate_logo_100x24 (Gatebase).png -->\r\n        <img class=\"logo\" src=\"data:image/png;base64,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\"/>\r\n        <div class=\"header\">\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"band\">\r\n\r\n        <div class=\"band__inner-container padded\">\r\n        <h2>{2}</h2>\r\n        <p>{3}</p>\r\n    </div>\r\n\r\n</body>\r\n\r\n</html>", new object[] { "\r\n/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=\"button\"],input[type=\"reset\"],input[type=\"submit\"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=\"checkbox\"],input[type=\"radio\"]{box-sizing:border-box;padding:0}input[type=\"number\"]::-webkit-inner-spin-button,input[type=\"number\"]::-webkit-outer-spin-button{height:auto}input[type=\"search\"]{-webkit-appearance:textfield;box-sizing:content-box}input[type=\"search\"]::-webkit-search-cancel-button,input[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,h1,h2,h3,h4,h5,h6,p,blockquote,pre,dl,dd,ol,ul,form,fieldset,legend,figure,table,th,td,caption,hr{margin:0;padding:0}abbr[title],dfn[title]{cursor:help}u,ins{text-decoration:none}ins{border-bottom:1px solid}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}img{max-width:100%;font-style:italic;vertical-align:middle}.gm-style img,img[width],img[height]{max-width:none}.image-center{display:block;margin-top:0;margin-right:auto;margin-bottom:36px;margin-bottom:2.25rem;margin-left:auto}mark{font-style:italic;font-weight:bold}pre{white-space:pre;white-space:pre-wrap;white-space:pre-line;word-wrap:break-word}hr{clear:both;border-top:1px;border-right:0;border-bottom:0;border-left:0;min-height:0;height:1px;border-style:solid}hr.dashed{border-style:dashed}hr.dotted{border-style:dotted}ul,ol,dd{margin-left:24px;margin-left:1.5rem}li{margin-bottom:24px;margin-bottom:1.5rem}dt{font-weight:bold}ul ul,ul ol,ul dl,ol ul,ol ol,ol dl,dl ul,dl ol,dl dl{margin-top:12px;margin-top:0.75rem}li>ul,li>ol{margin-bottom:0px;margin-bottom:0rem}html{font-size:100%;overflow-y:scroll;min-height:100%}h1,h2,h3,h4,h5,h6,ul,ol,dl,blockquote,p,address,table,fieldset,figure,pre,hr{margin-bottom:24px;margin-bottom:1.5rem}h3,h4,h5,h6{margin-bottom:12px;margin-bottom:0.75rem}h1:not(.visually-hidden)+h2,h1:not(.visually-hidden)+h3,h1:not(.visually-hidden)+h4,h1:not(.visually-hidden)+h5,h2:not(.visually-hidden)+h3,h2:not(.visually-hidden)+h4,h2:not(.visually-hidden)+h5,h3:not(.visually-hidden)+h4,h3:not(.visually-hidden)+h5,h4:not(.visually-hidden)+h5,.main-heading:not(.visually-hidden)+.sub-heading,.sub-heading:not(.visually-hidden)+.sub-heading,h1:not(.visually-hidden)+.sub-heading,h2:not(.visually-hidden)+.sub-heading{margin-top:-24px;margin-top:-1.5rem}h3:not(.visually-hidden)+h4,h3:not(.visually-hidden)+h5,h4:not(.visually-hidden)+h5,h3:not(.visually-hidden)+.sub-heading{margin-top:-12px;margin-top:-0.75rem}.bg--cover{background-position:center;background-size:cover;background-repeat:no-repeat}.band{position:relative;width:100%;overflow:hidden;clear:both}.band__inner-container,.band__inner-container--tight,.band__inner-container--loose{clear:both;padding-top:96px;padding-top:6rem;padding-bottom:96px;padding-bottom:6rem;width:100%;max-width:1000px;margin:auto}.band__inner-container:before,.band__inner-container:after,.band__inner-container--tight:before,.band__inner-container--loose:before,.band__inner-container--tight:after,.band__inner-container--loose:after{content:\" \";display:table}.band__inner-container:after,.band__inner-container--tight:after,.band__inner-container--loose:after{clear:both}.band__inner-container,.band__inner-container--tight,.band__inner-container--loose{*zoom:1}.band__inner-container--tight{padding-top:48px;padding-top:3rem;padding-bottom:48px;padding-bottom:3rem}.band__inner-container--loose{padding-top:240px;padding-top:15rem;padding-bottom:240px;padding-bottom:15rem}.border{border-style:solid;border-width:1px}.border-top{border-top-style:solid;border-top-width:1px}.border-right{border-right-style:solid;border-right-width:1px}.border-bottom{border-bottom-style:solid;border-bottom-width:1px}.border-left{border-left-style:solid;border-left-width:1px}.clearfix,.grid__row{clear:both}.clearfix:before,.clearfix:after,.grid__row:before,.grid__row:after{content:\" \";display:table}.clearfix:after,.grid__row:after{clear:both}.clearfix,.grid__row{*zoom:1}.code{white-space:pre-wrap}\r\n\r\n.spaced{margin:24px;margin:1.5rem}\r\n.spaced-h{margin-left:24px;margin-left:1.5rem;margin-right:24px;margin-right:1.5rem}\r\n.spaced-left{margin-left:24px;margin-left:1.5rem}\r\n.spaced-right{margin-right:24px;margin-right:1.5rem}\r\n.spaced-v{margin-top:24px;margin-top:1.5rem;margin-bottom:24px;margin-bottom:1.5rem}\r\n.spaced-top{margin-top:24px;margin-top:1.5rem}\r\n.spaced-bottom{margin-bottom:24px;margin-bottom:1.5rem}\r\n.spaced--tight{margin:12px;margin:0.75rem}\r\n.spaced-h--tight{margin-left:12px;margin-left:0.75rem;margin-right:12px;margin-right:0.75rem}\r\n.spaced-left--tight{margin-left:12px;margin-left:0.75rem}\r\n.spaced-right--tight{margin-right:12px;margin-right:0.75rem}\r\n.spaced-v--tight{margin-top:12px;margin-top:0.75rem;margin-bottom:12px;margin-bottom:0.75rem}\r\n.spaced-top--tight{margin-top:12px;margin-top:0.75rem}\r\n.spaced-bottom--tight{margin-bottom:12px;margin-bottom:0.75rem}\r\n.spaced--loose{margin:96px;margin:6rem}\r\n.spaced-h--loose{margin-left:96px;margin-left:6rem;margin-right:96px;margin-right:6rem}\r\n.spaced-left--loose{margin-left:96px;margin-left:6rem}\r\n.spaced-right--loose{margin-right:96px;margin-right:6rem}\r\n.spaced-v--loose{margin-top:96px;margin-top:6rem;margin-bottom:96px;margin-bottom:6rem}\r\n.spaced-top--loose{margin-top:96px;margin-top:6rem}\r\n.spaced-bottom--loose{margin-bottom:96px;margin-bottom:6rem}\r\n.spaced--none{margin:0px;margin:0rem}\r\n.spaced-h--none{margin-left:0px;margin-left:0rem;margin-right:0px;margin-right:0rem}\r\n.spaced-left--none{margin-left:0px;margin-left:0rem}\r\n.spaced-right--none{margin-right:0px;margin-right:0rem}\r\n.spaced-v--none{margin-top:0px;margin-top:0rem;margin-bottom:0px;margin-bottom:0rem}\r\n.spaced-top--none{margin-top:0px;margin-top:0rem}\r\n.spaced-bottom--none{margin-bottom:0px;margin-bottom:0rem}\r\n\r\n.padded{padding:24px;padding:1.5rem}\r\n.padded-h{padding-left:24px;padding-left:1.5rem;padding-right:24px;padding-right:1.5rem}\r\n.padded-left{padding-left:24px;padding-left:1.5rem}\r\n.padded-right{padding-right:24px;padding-right:1.5rem}\r\n.padded-v{padding-top:24px;padding-top:1.5rem;padding-bottom:24px;padding-bottom:1.5rem}\r\n.padded-top{padding-top:24px;padding-top:1.5rem}\r\n.padded-bottom{padding-bottom:24px;padding-bottom:1.5rem}\r\n.padded--tight{padding:12px;padding:0.75rem}\r\n.padded-h--tight,.nav--drawer__open{padding-left:12px;padding-left:0.75rem;padding-right:12px;padding-right:0.75rem}\r\n.padded-left--tight{padding-left:12px;padding-left:0.75rem}\r\n.padded-right--tight{padding-right:12px;padding-right:0.75rem}\r\n.padded-v--tight,.nav--drawer__open{padding-top:12px;padding-top:0.75rem;padding-bottom:12px;padding-bottom:0.75rem}\r\n.padded-top--tight{padding-top:12px;padding-top:0.75rem}\r\n.padded-bottom--tight{padding-bottom:12px;padding-bottom:0.75rem}\r\n.padded--loose{padding:96px;padding:6rem}\r\n.padded-h--loose{padding-left:96px;padding-left:6rem;padding-right:96px;padding-right:6rem}\r\n.padded-left--loose{padding-left:96px;padding-left:6rem}\r\n.padded-right--loose{padding-right:96px;padding-right:6rem}\r\n.padded-v--loose{padding-top:96px;padding-top:6rem;padding-bottom:96px;padding-bottom:6rem}\r\n.padded-top--loose{padding-top:96px;padding-top:6rem}\r\n.padded-bottom--loose{padding-bottom:96px;padding-bottom:6rem}\r\n.padded--none{padding:0px;padding:0rem}\r\n.padded-h--none{padding-left:0px;padding-left:0rem;padding-right:0px;padding-right:0rem}\r\n.padded-left--none{padding-left:0px;padding-left:0rem}\r\n.padded-right--none{padding-right:0px;padding-right:0rem}\r\n.padded-v--none{padding-top:0px;padding-top:0rem;padding-bottom:0px;padding-bottom:0rem}\r\n.padded-top--none{padding-top:0px;padding-top:0rem}\r\n.padded-bottom--none{padding-bottom:0px;padding-bottom:0rem}\r\n\r\n.pin{position:absolute}.pin-top{position:absolute;top:0}.pin-right{position:absolute;right:0}.pin-bottom{position:absolute;bottom:0}.pin-left{position:absolute;left:0}.pin-top-right{position:absolute;top:0;right:0}.pin-bottom-right{position:absolute;bottom:0;right:0}.pin-bottom-left{position:absolute;bottom:0;left:0}.pin-top-left{position:absolute;top:0;left:0}.pin-to-right-of-middle{position:absolute;left:52%}.pin-to-left-of-middle{position:absolute;right:52%}.display--inline,.nav-bar--center ul{display:inline ;display:inline-block ;width:auto }.display--block{display:block }.float-left{float:left }.float-right,.nav-bar--right{float:right }.absolute{position:absolute }.absolute-top{position:absolute ;top:0 }.absolute-top-right{position:absolute ;top:0 ;right:0 }.absolute-top-left,.google-map{position:absolute ;top:0 ;left:0 }.absolute-bottom{position:absolute ;bottom:0 }.absolute--bottom-right{position:absolute ;bottom:0 ;right:0 }.absolute--bottom-left{position:absolute ;bottom:0 ;left:0 }.absolute--left{position:absolute ;left:0 }.absolute--right{position:absolute ;left:0 }.relative{position:relative }.spaced-bottom--none{margin-bottom:0 }.center{left:50%;top:50%;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.center--h{left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.center--v{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.overflow-visible{overflow:visible }.overflow-hidden{overflow:hidden }.hidden{display:none ;visibility:hidden }.invisible{visibility:hidden }.visually-hidden{clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute ;width:1px}.visually-hidden.focusable:active,.visually-hidden.focusable:focus{clip:auto;height:auto;position:static;margin:0;overflow:visible;width:auto}hr{border-color:#dcdcdc}html{background-color:#fff;color:#767676;border-color:#dcdcdc}.border,.border-top,.border-right,.border-bottom,.border-left{border-color:inherit}.scheme--white{background-color:#fff;border-color:#dcdcdc}.scheme--white hr{border-color:#dcdcdc}.scheme--white h1,.scheme--white .alpha{color:#373737}.scheme--white .sub-heading{color:#767676}.scheme--white h2,.scheme--white .beta{color:#373737}.scheme--white h3,.scheme--white .gamma{color:#373737}.scheme--white h4,.scheme--white .delta{color:#373737}.scheme--white h5,.scheme--white .epsilon{color:#373737}.scheme--white h6,.scheme--white .zeta{color:#373737}.scheme--white p,.scheme--white ul,.scheme--white ol,.scheme--white dd,.scheme--white label{color:#767676}.scheme--white a{color:#767676;border-color:#3c85df}.scheme--white a:active,.scheme--white a:hover{color:#73c0ef}.scheme--white h1 a,.scheme--white h2 a,.scheme--white h3 a,.scheme--white h4 a,.scheme--white h5 a,.scheme--white .main-heading a,.scheme--white .sub-heading a{border-bottom-color:transparent}.scheme--white h1 a:hover,.scheme--white h2 a:hover,.scheme--white h3 a:hover,.scheme--white h4 a:hover,.scheme--white h5 a:hover,.scheme--white .main-heading a:hover,.scheme--white .sub-heading a:hover{color:#000;border-bottom-color:#73c0ef}.scheme--white input,.scheme--white select,.scheme--white textarea{color:#222}.scheme--lightest-grey{background-color:#f2f2f2;border-color:#dcdcdc}.scheme--lightest-grey .tabs{border-bottom-color:#dcdcdc}.scheme--lightest-grey .tabs li.active{background-color:#f2f2f2}.scheme--lightest-grey .tabs li.active a{border-top-color:#3c85df;border-bottom-color:#f2f2f2;background-color:#f2f2f2}.scheme--lightest-grey .pagination{-webkit-font-smoothing:antialiased}.scheme--lightest-grey input,.scheme--lightest-grey select,.scheme--lightest-grey textarea{color:#222}.scheme--darkest-grey{background-color:#373737;border-color:#767676;color:#ebebeb;-webkit-font-smoothing:antialiased}.scheme--darkest-grey hr{border-color:#767676}.scheme--darkest-grey h1,.scheme--darkest-grey .alpha,.scheme--darkest-grey .main-heading{color:#fff}.scheme--darkest-grey h2,.scheme--darkest-grey .beta,.scheme--darkest-grey .sub-heading{color:#ebebeb}.scheme--darkest-grey h3,.scheme--darkest-grey .gamma{color:#ebebeb}.scheme--darkest-grey h4,.scheme--darkest-grey .delta{color:#ebebeb}.scheme--darkest-grey h5,.scheme--darkest-grey .epsilon{color:#ebebeb}.scheme--darkest-grey h6,.scheme--darkest-grey .zeta{color:#ebebeb}.scheme--darkest-grey p,.scheme--darkest-grey ul,.scheme--darkest-grey ol,.scheme--darkest-grey dd,.scheme--darkest-grey label{color:#dcdcdc}.scheme--darkest-grey a{color:#ebebeb;border-color:#3c85df}.scheme--darkest-grey a:active,.scheme--darkest-grey a:hover{color:#73c0ef}.scheme--darkest-grey h1 a,.scheme--darkest-grey h2 a,.scheme--darkest-grey h3 a,.scheme--darkest-grey h4 a,.scheme--darkest-grey h5 a,.scheme--darkest-grey .main-heading a,.scheme--darkest-grey .sub-heading a{border-bottom-color:transparent}.scheme--darkest-grey h1 a:hover,.scheme--darkest-grey h2 a:hover,.scheme--darkest-grey h3 a:hover,.scheme--darkest-grey h4 a:hover,.scheme--darkest-grey h5 a:hover,.scheme--darkest-grey .main-heading a:hover,.scheme--darkest-grey .sub-heading a:hover{color:#fff;border-bottom-color:#73c0ef}.scheme--darkest-grey .tabs{border-bottom-color:#dcdcdc}.scheme--darkest-grey .tabs li.active{background-color:#373737}.scheme--darkest-grey .tabs li.active a{border-top-color:#3c85df;border-bottom-color:#373737;background-color:#373737;color:#fff}.scheme--darkest-grey .tabs a{background-color:#dcdcdc;border-top-color:#dcdcdc;border-bottom-color:#dcdcdc;color:#373737}.scheme--darkest-grey .pagination{-webkit-font-smoothing:antialiased}.scheme--darkest-grey input,.scheme--darkest-grey select,.scheme--darkest-grey textarea{color:#222}.scheme--darkest-grey table{background-color:#373737;color:#ebebeb}.scheme--darkest-grey th{background-color:#767676;color:#ebebeb}.scheme--darkest-grey th,.scheme--darkest-grey td{border-color:#767676}.scheme--darkest-grey tr:hover{background-color:#767676}.scheme--lightest-blue{background-color:#dceffb;color:#2a5e9d;border-color:#bad6e7 }.scheme--lightest-blue hr{border-color:#bad6e7 }.scheme--lightest-blue h1,.scheme--lightest-blue .alpha{color:#183559}.scheme--lightest-blue h2,.scheme--lightest-blue .beta{color:#183559}.scheme--lightest-blue h3,.scheme--lightest-blue .gamma{color:#183559}.scheme--lightest-blue h4,.scheme--lightest-blue .delta{color:#183559}.scheme--lightest-blue h5,.scheme--lightest-blue .epsilon{color:#183559}.scheme--lightest-blue h6,.scheme--lightest-blue .zeta{color:#183559}.scheme--lightest-blue p,.scheme--lightest-blue ul,.scheme--lightest-blue ol,.scheme--lightest-blue dd,.scheme--lightest-blue label{color:#2a5e9d}.scheme--lightest-blue a{color:#2a5e9d;border-color:#73c0ef}.scheme--lightest-blue a:active,.scheme--lightest-blue a:hover{color:#3c85df}.scheme--lightest-blue h1 a,.scheme--lightest-blue h2 a,.scheme--lightest-blue h3 a,.scheme--lightest-blue h4 a,.scheme--lightest-blue h5 a,.scheme--lightest-blue .main-heading a,.scheme--lightest-blue .sub-heading a{color:#183559;border-bottom-color:transparent}.scheme--lightest-blue h1 a:hover,.scheme--lightest-blue h2 a:hover,.scheme--lightest-blue h3 a:hover,.scheme--lightest-blue h4 a:hover,.scheme--lightest-blue h5 a:hover,.scheme--lightest-blue .main-heading a:hover,.scheme--lightest-blue .sub-heading a:hover{color:#000;border-bottom-color:#73c0ef}.scheme--lightest-blue .tabs{border-bottom-color:#73c0ef}.scheme--lightest-blue .tabs li.active{background-color:#dceffb}.scheme--lightest-blue .tabs li.active a{border-top-color:#3c85df;border-bottom-color:#dceffb;background-color:#dceffb}.scheme--lightest-blue .tabs a{background-color:#73c0ef;border-top-color:#73c0ef;border-bottom-color:#73c0ef}.scheme--lightest-blue .pagination{-webkit-font-smoothing:antialiased}.scheme--lightest-blue input,.scheme--lightest-blue select,.scheme--lightest-blue textarea{color:#222}.scheme--blue{background-color:#3c85df;border-color:#2a5e9d;color:#fff;-webkit-font-smoothing:antialiased}.scheme--blue hr{border-color:#fff}.scheme--blue h1,.scheme--blue .alpha{color:#fff}.scheme--blue h2,.scheme--blue .beta{color:#fff}.scheme--blue h3,.scheme--blue .gamma{color:#fff}.scheme--blue h4,.scheme--blue .delta{color:#fff}.scheme--blue h5,.scheme--blue .epsilon{color:#fff}.scheme--blue p,.scheme--blue ul,.scheme--blue ol,.scheme--blue dd,.scheme--blue label{color:#fff}.scheme--blue a{color:#b9dff7;border-color:#183559}.scheme--blue a:active,.scheme--blue a:hover{color:#183559}.scheme--blue h1 a,.scheme--blue h2 a,.scheme--blue h3 a,.scheme--blue h4 a,.scheme--blue h5 a,.scheme--blue .main-heading a,.scheme--blue .sub-heading a{border-bottom-color:transparent}.scheme--blue h1 a:hover,.scheme--blue h2 a:hover,.scheme--blue h3 a:hover,.scheme--blue h4 a:hover,.scheme--blue h5 a:hover,.scheme--blue .main-heading a:hover,.scheme--blue .sub-heading a:hover{color:#fff;border-bottom-color:#73c0ef}.scheme--blue .tabs{border-bottom-color:#dceffb}.scheme--blue .tabs li.active{background-color:#3c85df}.scheme--blue .tabs li.active a{border-top-color:#fff;border-bottom-color:#3c85df;background-color:#3c85df;color:#fff}.scheme--blue .tabs a{background-color:#dceffb;border-top-color:#dceffb;border-bottom-color:#dceffb;color:#3c85df}.scheme--blue .pagination{-webkit-font-smoothing:antialiased}.scheme--darkest-blue{background-color:#183559;border-color:#767676;color:#ebebeb;-webkit-font-smoothing:antialiased}.scheme--darkest-blue hr{border-color:#767676}.scheme--darkest-blue h1,.scheme--darkest-blue .alpha{color:#ebebeb}.scheme--darkest-blue h2,.scheme--darkest-blue .beta{color:#ebebeb}.scheme--darkest-blue h3,.scheme--darkest-blue .gamma{color:#ebebeb}.scheme--darkest-blue h4,.scheme--darkest-blue .delta{color:#ebebeb}.scheme--darkest-blue h5,.scheme--darkest-blue .epsilon{color:#ebebeb}.scheme--darkest-blue p,.scheme--darkest-blue ul,.scheme--darkest-blue ol,.scheme--darkest-blue dd,.scheme--darkest-blue label{color:#dcdcdc}.scheme--darkest-blue a{color:#ebebeb;border-color:#3c85df}.scheme--darkest-blue a:active,.scheme--darkest-blue a:hover{color:#73c0ef}.scheme--darkest-blue h1 a,.scheme--darkest-blue h2 a,.scheme--darkest-blue h3 a,.scheme--darkest-blue h4 a,.scheme--darkest-blue h5 a,.scheme--darkest-blue .main-heading a,.scheme--darkest-blue .sub-heading a{border-bottom-color:transparent}.scheme--darkest-blue h1 a:hover,.scheme--darkest-blue h2 a:hover,.scheme--darkest-blue h3 a:hover,.scheme--darkest-blue h4 a:hover,.scheme--darkest-blue h5 a:hover,.scheme--darkest-blue .main-heading a:hover,.scheme--darkest-blue .sub-heading a:hover{color:#fff;border-bottom-color:#3c85df}.scheme--darkest-blue .tabs{border-bottom-color:#dceffb}.scheme--darkest-blue .tabs li.active{background-color:#183559}.scheme--darkest-blue .tabs li.active a{border-top-color:#3c85df;border-bottom-color:#183559;background-color:#183559;color:#fff}.scheme--darkest-blue .tabs a{background-color:#dceffb;bo[...string is too long...]", "\r\nhtml {\r\n    min-width: 10px;\r\n    font-size: 80%;\r\n    color: #373737;\r\n    font-family: Arial, Helvetics, sans-serif;\r\n    overflow: auto;\r\n}\r\n\r\nbody {\r\n    min-width: 10px;\r\n    overflow: auto;\r\n}\r\n\r\ninput, textarea {\r\n    color: #000;\r\n}\r\n\r\n#serialKey {\r\n    text-transform: uppercase;\r\n}\r\n\r\n#serialKey::-webkit-input-placeholder {\r\n    text-transform: none;\r\n}\r\n\r\n#serialKey::-moz-placeholder {\r\n    text-transform: none;\r\n}\r\n\r\n#serialKey:-ms-input-placeholder {\r\n    text-transform: none;\r\n}\r\n\r\n#serialKey.placeholder {\r\n    text-transform: none;   /* needed by jQuery.placeholder for IE8 & below */\r\n}\r\n\r\n.placeholder {\r\n    color: #aaa;\r\n}\r\n\r\nimg.logo {\r\n    float: left;\r\n    margin-right: 12px;\r\n    padding: 12px;\r\n    background: #c00;\r\n    height:48px;\r\n}\r\n\r\n.header {\r\n    margin: 0;\r\n    background: #373737;\r\n    font-size: 16px;\r\n    line-height: 24px;\r\n    overflow: hidden;\r\n}\r\n\r\n.header .user-display-name {\r\n    display: none;\r\n    max-width: 60%;\r\n    float: right;\r\n    margin: 0 12px;\r\n    font-size:smaller;\r\n    line-height:48px;\r\n    color: #ffffff;\r\n    white-space: nowrap;\r\n    overflow: hidden;\r\n    text-overflow: ellipsis;\r\n}\r\n\r\nh2 {\r\n    font-weight: lighter;\r\n    line-height:1;\r\n}\r\n\r\n.grid__col, h5 {\r\n    border-color: #b6b6b6;\r\n}\r\n\r\n.grid__col:first-of-type {\r\n    padding-left: 0;\r\n}\r\n\r\n.grid__col--span-1-of-2 {\r\n    width: 50%;\r\n}\r\n\r\n.grid__col--span-1-of-2 input {\r\n    width: 88%;\r\n}\r\n\r\ninput.span-2-col {\r\n    width: 89.5%;\r\n}\r\n\r\nlabel {\r\n    text-transform:none;\r\n    font-size:1em;\r\n    font-weight:normal;\r\n    letter-spacing:normal;\r\n}\r\n\r\nul li {\r\n    margin-bottom: 2px;\r\n}\r\n\r\na.button {\r\n    margin-bottom: 0;\r\n    margin-right:20px;\r\n    position: relative;\r\n    cursor: pointer;\r\n}\r\n\r\na.button:disabled {\r\n    cursor: default;\r\n}\r\n\r\n.validation-error {\r\n    border-color: #C00000;   \r\n}\r\n\r\ninput {\r\n    padding: 6px;\r\n    border-radius: 5px;\r\n    border-color: #767676;\r\n    font-size: 100%;\r\n    width: 94%;\r\n}\r\n\r\n.button, input[type=\"submit\"], .button--text, .button--text:hover{padding:6px 12px !important}\r\na.button--wide {\r\n    padding: 6px 24px !important;\r\n}\r\n\r\n/* Dev tweaks */\r\n\r\n.inline-block {\r\n    display: inline-block;\r\n}\r\n\r\n.centered-img {\r\n    position: fixed;\r\ntop: 50%;\r\n    left: 50%;\r\n    /* bring your own prefixes */\r\n    transform: translate(-50%, -50%);\r\n}\r\n\r\ninput, select, textarea {\r\n    margin-bottom: 12px;\r\n}\r\n\r\n    textarea:disabled {\r\n        color: #e2e2e2;\r\n    }\r\n\r\n::-webkit-scrollbar {\r\n    background-color: #f1f1f1; /* Bug in CEF - produces red if not fixed */\r\n}\r\n\r\n::-webkit-input-placeholder {\r\n   color: #b6b6b6;\r\n}\r\n\r\n:-moz-placeholder { /* Firefox 18- */\r\n   color: #b6b6b6;  \r\n}\r\n\r\n::-moz-placeholder {  /* Firefox 19+ */\r\n   color: #b6b6b6;  \r\n}\r\n\r\n:-ms-input-placeholder {  \r\n   color: #b6b6b6;  \r\n}\r\n.product-list {\r\n    margin-left: 0;\r\n    list-style-position: inside;\r\n}\r\n\r\n.product-list li,\r\n#licence-messages p {\r\n    white-space: nowrap;\r\n    overflow: hidden;\r\n    text-overflow: ellipsis;\r\n}\r\n\r\n.animation-fade-in {\r\n    animation: fade-in 1s;\r\n    -ms-animation: fade-in 1s;\r\n    -webkit-animation: fade-in 1s;\r\n    -moz-animation: fade-in 1s;\r\n    -o-animation: fade-in 1s;\r\n}\r\n@keyframes fade-in {\r\n    from { opacity: 0; }\r\n    to   { opacity: 1; }\r\n}\r\n@-ms-keyframes fade-in {\r\n    from { opacity: 0; }\r\n    to   { opacity: 1; }\r\n}\r\n@-webkit-keyframes fade-in {\r\n    from { opacity: 0; }\r\n    to   { opacity: 1; }\r\n}\r\n@-moz-keyframes fade-in {\r\n    from { opacity: 0; }\r\n    to   { opacity: 1; }\r\n}\r\n@-o-keyframes fade-in {\r\n    from { opacity: 0; }\r\n    to   { opacity: 1; }\r\n}", title, message });
        }
    }
}



用Release模式编译后将生成的SqlPromptCrack.dll和引用的Crane.MethodHook.dll这两个文件,
复制到sql prompt的安装根目录下,一般是C:\Program Files (x86)\Red Gate\SQL Prompt 10这个目录。


然后使用dnSpy打开C:\Program Files (x86)\Red Gate\SQL Prompt 10目录下的Ninject.dll文件。


找到Ninject.Modules.NinjectModule类,在其构造函数后面加入以下代码:


[C#] 纯文本查看 复制代码
var codeBase = System.Reflection.Assembly.GetExecutingAssembly().Location;
var filePath = System.IO.Path.Combine(codeBase.Substring(0, codeBase.LastIndexOf("\\")), "SqlPromptCrack.dll");
var assembly = System.Reflection.Assembly.LoadFrom(filePath);
var hook = assembly.GetType("SqlPromptCrack.SqlPromptHook");
var method = hook.GetMethod("CheckAndHook", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
method?.Invoke(null, null);



最后,保存模块即可。


这时候再启动SQL management studio,发现sql prompt便无须注册,可以使用全功能了。


fakename.png
fakename.png


为什么选择在Ninject.dll文件中注入破解代码?
那是因为,每次sql prompt更新时,只有这个文件的版本和内容没有更新过,但是文件还是会被覆盖。


所以记得保存好这个修改后的Ninject.dll文件,后续sql prompt版本更新后,只要替换这个Ninject.dll就可以了,
而我们前面拷贝过来的SqlPromptCrack.dll和引用的Crane.MethodHook.dll文件,在每次更新时都不会被覆盖的。



好了,有兴趣的话,自己动手去试一试吧。

评分

参与人数 8HB +18 THX +5 收起 理由
NOP + 1
布鲁斯李 + 2 + 1 [吾爱汇编论坛52HB.COM]-感谢楼主热心分享,小小评分不成敬意!
身心自在 + 1
消逝的过去 + 2
weekmio + 1
再来壹瓶 + 1 [吾爱汇编论坛52HB.COM]-学破解防破解,知进攻懂防守!
太阳神 + 2 + 1 [吾爱汇编论坛52HB.COM]-吃水不忘打井人,给个评分懂感恩!
Shark恒 + 10 + 1 [吾爱汇编论坛52HB.COM]-感谢楼主热心分享,小小评分不成敬意!

查看全部评分

吾爱汇编论坛-学破解,防破解!知进攻,懂防守!逆向分析,软件安全!52HB.COM
学编程的闹钟 发表于 2024-4-8 14:18 | 显示全部楼层
吾爱汇编论坛-学破解,防破解!知进攻,懂防守!逆向分析,软件安全!52HB.COM
lies 发表于 2024-4-8 15:02 | 显示全部楼层

谢谢教程!
吾爱汇编论坛-学破解,防破解!知进攻,懂防守!逆向分析,软件安全!52HB.COM
布鲁斯李 发表于 2024-4-25 15:04 | 显示全部楼层
吾爱汇编论坛-学破解,防破解!知进攻,懂防守!逆向分析,软件安全!52HB.COM
冷月孤星 发表于 2024-4-27 14:52 | 显示全部楼层

本帖最后由 冷月孤星 于 2024-4-29 11:50 编辑

谢谢分享教程
吾爱汇编论坛-学破解,防破解!知进攻,懂防守!逆向分析,软件安全!52HB.COM
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

警告:本站严惩灌水回复,尊重自己从尊重他人开始!

1层
2层
3层
4层
5层

免责声明

吾爱汇编(www.52hb.com)所讨论的技术及相关工具仅限用于研究学习,皆在提高软件产品的安全性,严禁用于不良动机。任何个人、团体、组织不得将其用于非法目的,否则,一切后果自行承担。吾爱汇编不承担任何因为技术滥用所产生的连带责任。吾爱汇编内容源于网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除。如有侵权请邮件或微信与我们联系处理。

站长邮箱:SharkHeng@sina.com
站长QQ:1140549900


QQ|RSS|手机版|小黑屋|帮助|吾爱汇编 ( 京公网安备11011502005403号 , 京ICP备20003498号-6 )|网站地图

Powered by Discuz!

吾爱汇编 www.52hb.com

快速回复 返回顶部 返回列表