飘云阁

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 11923|回复: 36

[原创] 自然语言计算器(opalcalc_1.81)一字节和谐教程

[复制链接]
  • TA的每日心情
    开心
    2018-7-9 08:20
  • 签到天数: 869 天

    [LV.10]以坛为家III

    发表于 2016-2-26 21:32:42 | 显示全部楼层 |阅读模式
    本帖最后由 gagmeng 于 2016-2-26 21:35 编辑

    软件介绍:
    • OpalCalc is a brand new type of calculator for the PC. As easy to use as Notepad or a word processor, OpalCalc allows you to insert natural language as part of the sum, along with multi-line support so you can go back and adjust your previous calculations. Want a tiny footprint on the screen for a single sum? Resize accordingly. Want it to fill the screen for heavy-duty work? OpalCalc can adapt.
    • Featuring a lightweight footprint, on-the-fly calculation as you type, percentages, variable support, hundreds of units and functions, extensive notation support, intuitive design/documentation and much more. Once you've tried it, you'll never want to go back to your ordinary desktop (or PC) calculator again!
    用户评价:
    • PCWorld "Step Away From the Spreadsheet and Dig Donationware Gem OpalCalc"
    • MakeUseOf.com: "OpalCalc: Cool Text-based Calculation App To Replace Your Windows Calc"
    • LifeHacker: "Perform Long Calculations in Plain English with These Awesome Calculator Apps"
    • Softoxi.com:"OpalCalc is a very convenient, reliable and effective calculator"
    • FindMySoft.com "OpalCalc ? A Very Useful Calculator"
    软件特性:
    • Lightweight footprint (only 600k)
    • Multiline support (notepad style)
    • Configurable GUI with colour schemes
    • Built-in 'Quickstart' tutorial
    • Full colour coding
    • Multiple undo/redo, zoom in/out, etc.
    • Numerous built-in variables and functions (create your own too!)
    • Percentage support
    • Hundreds of measures, like kilograms and feet (create your own too)
    • Extensive date and time support
    • Currency support with conversion (data courtesy of themoneyconverter.com)
    • Portable (260k from a pen drive!)
    • Load/save/print support
    • Programmer syntax and functions
    • Custom number base support
    • Advanced notation support
    • Comma decimal point support for Europe, Russia, and South America etc.

    软件界面:
    usecase-m.png
    windows2.png
    和谐教程:
    1、从官网说明可以了解到限制“The demo/'lite' version is fully functional, except for a 5 line limit for calculations. To overcome this limitation and help support the development of OpalCalc, upgrade using credit/debit card, or through Paypal (user license lasts forever, including updates, and there's no faffing about with keys or passwords).”
    QQ截图20160225110753.png
    QQ截图20160225110936.png
    2、使用NET把编译工具(net reflector、ILSPY、justdecompile或者dnspy)加载OpalCalc.exe;
    3、搜索字符串“5 lines”可定位到如下函数
    public void createAnswers(string text)
    {
    ...
       if (!this.determineWhetherToDisplayAnswer(this.demo, array, i, text))
            {
                    this.answerWhole = "Demo allows only 5 lines";
                    if (!this.demomsg)
                    {
                            this.demomsg = true;
                            MessageBox.Show(Program.frm, "This demo/lite version of OpalCalc only allows 5 lines (excluding included tutorial and examples such as 'shopping' or 'workday'). You can still do a lot with that, but for unlimited lines, please upgrade via the website at: www.skytopia.com/software/opalcalc\n\n.....or select the red/square dropdown menu button and click 'Upgrade OpalCalc'. Paid users will often also receive a more up-to-date version of OpalCalc than demo users.");
                    }
            }
    ...
    }

    从上面函数中可知道只要if (!this.determineWhetherToDisplayAnswer(this.demo, array, i, text))中为false即破解了限制,进入关键函数determineWhetherToDisplayAnswer;
    private bool determineWhetherToDisplayAnswer(bool demo, string[] lines, int n, string text)
    {
            return !demo || this.countNonSpaceLines(lines, n) < 5 || (text.Contains("OpalCalc QuickStart:") && text.Contains("Thank you for reading and enjoy OpalCalc! You may press F1 now, or reboot OpalCalc") && text.Contains("More complicated mathematical expressions are supported")) || (lines[n].Length >= 5 && (jtext.complexsums.Contains(lines[n]) || jtext.shopping.Contains(lines[n]) || jtext.workday.Contains(lines[n]) || jtext.shoppingandroom.Contains(lines[n]) || jtext.datesandtimes.Contains(lines[n])));
    }

    4、根据determineWhetherToDisplayAnswer函数可看出,只要demo输入为false即OK,因此可确定if (!this.determineWhetherToDisplayAnswer(this.demo, array, i, text))中this.demo必须为false;
    5、分析对this.demo的引用,定位到
    private void Form1_Load(object sender, EventArgs e)
    {
    ...
       Program.debugStartup("calc complete", calc.debugToDisk);
       this.cc.demo = true;
       this.rtbi.SetRTBO(this.rtbo, this.cc);
    ...
    }
    只需修改为如下即可破解
    private void Form1_Load(object sender, EventArgs e)
    {
    ...
       Program.debugStartup("calc complete", calc.debugToDisk);
       this.cc.demo = false;
       this.rtbi.SetRTBO(this.rtbo, this.cc);
    ...
    }

    5、使用IDA或者dnspy查看this.cc.demo = false;这句语句的地址
    /* 0x00012A92 17           */ IL_0056: ldc.i4.1
    /* 0x00012A93 7D45000004   */ IL_0057: stfld     bool OpalCalc.calc::demo
    6、使用winhex将地址0x00012A92修改为16即可
    破解后效果展示:
    QQ截图20160225110955.png
    和谐文件下载:(老话长谈,此文件仅供个人学习和交流,其它用途请购买正版。)
    大家多给加点威望和PYB哦,你们的支持是我永远的动力!
    游客,如果您要查看本帖隐藏内容请回复


    评分

    参与人数 4威望 +44 飘云币 +40 收起 理由
    左岸麦田 + 8 + 4 很给力!
    GeekCat + 20 + 20 很给力!
    0xcb + 8 + 8 WinForm的?赞
    cfc1680 + 8 + 8 赞一个!

    查看全部评分

    PYG19周年生日快乐!
  • TA的每日心情
    奋斗
    昨天 10:03
  • 签到天数: 1425 天

    [LV.10]以坛为家III

    发表于 2016-2-26 21:57:02 | 显示全部楼层
    支持一下了,感谢分享了
    PYG19周年生日快乐!
  • TA的每日心情
    无聊
    7 天前
  • 签到天数: 1667 天

    [LV.Master]伴坛终老

    发表于 2016-2-26 22:00:28 | 显示全部楼层
    软件不错,试试看看
    PYG19周年生日快乐!
  • TA的每日心情
    无聊
    半小时前
  • 签到天数: 2486 天

    [LV.Master]伴坛终老

    发表于 2016-2-26 22:35:24 | 显示全部楼层
    软件的介绍全是英文,我这菜鸟看不懂啊,不过还是感谢楼主的分享
    PYG19周年生日快乐!
  • TA的每日心情
    奋斗
    2021-9-29 15:05
  • 签到天数: 114 天

    [LV.6]常住居民II

    发表于 2016-2-26 23:47:09 | 显示全部楼层
    支持了,顺便收了这个软件的代码,
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    昨天 05:38
  • 签到天数: 2015 天

    [LV.Master]伴坛终老

    发表于 2016-2-27 06:27:58 | 显示全部楼层
    支持一下了,感谢分享了
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2023-10-4 05:58
  • 签到天数: 356 天

    [LV.8]以坛为家I

    发表于 2016-2-27 07:13:15 | 显示全部楼层
    分析过程有用,感谢大牛分享
    PYG19周年生日快乐!
  • TA的每日心情
    擦汗
    2019-3-1 23:51
  • 签到天数: 559 天

    [LV.9]以坛为家II

    发表于 2016-2-27 08:13:32 | 显示全部楼层
    谢谢楼主分享
    PYG19周年生日快乐!
  • TA的每日心情
    难过
    2024-3-10 19:49
  • 签到天数: 473 天

    [LV.9]以坛为家II

    发表于 2016-2-27 09:52:05 | 显示全部楼层
    谢谢表哥带来的net精彩破解。收藏了
    PYG19周年生日快乐!
  • TA的每日心情
    开心
    2023-2-24 16:57
  • 签到天数: 1170 天

    [LV.10]以坛为家III

    发表于 2016-2-27 11:05:01 | 显示全部楼层
    谢谢老子分享
    PYG19周年生日快乐!
    您需要登录后才可以回帖 登录 | 加入我们

    本版积分规则

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