[开发工具]

大家看看这个**XC编译器的到底靠谱吗

[复制链接]
1339|8
手机看帖
扫描二维码
随时随地手机跟帖
huangcunxiake|  楼主 | 2019-7-31 23:44 | 显示全部楼层 |阅读模式

复制下列代码,另存为xclm.c,然后用mingw编译(推荐Code::Blocks的ide)生成xclm.exe,然后替换掉安装目录里面的同名文件即可。

/*****************************************************************************
*
* xclm.c - A replacement license server for Microchip embedded compilers
*
*****************************************************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

enum
{
    LICENSE_FREE,
    LICENSE_STANDARD,
    LICENSE_PRO,
    LICENSE_NULL,
    LICENSE_NOCPP,
    LICENSE_CPPFREE,
    LICENSE_CPPFULL
};

/* Padded keystring for XC8 compiler */
const char XC8_KEY[] = "120205690315959428539973816151144999076498629234049888"
                       "179227155534183820578631309018645587360933525814619915"
                       "779526071941849199599867328321377639683720790016145394"
                       "178294936006671919157552224249424396156390966410329115"
                       "909578096551465127991840510571525598801543710978110203"
                       "982753256678760352233698494166181105701471577863949973"
                       "752378527793703095602570185318279000307654710756304884"
                       "332086971157374238079344503160762531771453544441183117"
                       "818224971852635709182448998796203508335756172022603393"
                       "785870328131267807990054177348691152537065623705744096"
                       "622171290262732073236149224291304052855537234103307757"
                       "779806424202430488281521000914602653822069627155202082"
                       "274335001015294801198690117625951676366998171835575234"
                       "880703719555742347294083595208861666202572853755813079"
                       "282586487282173705566196898952662018776810629200817792"
                       "338135876828426412432431480282173674506720693507626895"
                       "304345939375032966363775750624733239923482883107733905"
                       "27680200757984356120205690";

int main(int argc, char *argv[])
{
    int license = LICENSE_FREE;
    int ii;

    for (ii = 0; ii < argc; ++ii)
    {
        if (!strcmp(argv[ii], "swxc32") ||
            !strcmp(argv[ii], "swxc16") ||
            !strcmp(argv[ii], "swxc8"))
        {
            license = LICENSE_PRO;
        }
        else if (!strcmp(argv[ii], "swxcpp32"))
        {
            license = LICENSE_CPPFULL;
        }
        else if (!strcmp(argv[ii], "-hash"))
        {
            int index = atoi(argv[ii+1]);
            printf("%.10s", &XC8_KEY[index]);
        }
    }

    return license;
}


使用特权

评论回复
huangcunxiake|  楼主 | 2019-7-31 23:45 | 显示全部楼层
网上看到的,不知道真滴假滴,新版的支持吗,我看人家说是支持的,因为好几年前的贴,那么新版的支持吗。

使用特权

评论回复
huangcunxiake|  楼主 | 2019-7-31 23:46 | 显示全部楼层
huangcunxiake|  楼主 | 2019-7-31 23:46 | 显示全部楼层
#include <stdlib.h>
#include <stdio.h>

static char asTable[] = "12020569031595942853997381615114499907649862923404988817922715553418382057863130"
                        "90186455873609335258146199157795260719418491995998673283213776396837207900161453"
                        "94178294936006671919157552224249424396156390966410329115909578096551465127991840"
                        "51057152559880154371097811020398275325667876035223369849416618110570147157786394"
                        "99737523785277937030956025701853182790003076547107563048843320869711573742380793"
                        "44503160762531771453544441183117818224971852635709182448998796203508335756172022"
                        "60339378587032813126780799005417734869115253706562370574409662217129026273207323"
                        "61492242913040528555372341033077577798064242024304882815210009146026538220696271"
                        "55202082274335001015294801198690117625951676366998171835575234880703719555742347"
                        "29408359520886166620257285375581307928258648728217370556619689895266201877681062"
                        "92008177923381358768284264124324314802821736745067206935076268953043459393750329"
                        "6636377575062473323992348288310773390527680200757984356";

void printHash(int iHash);

int main(int iArgc,char *asArg[])
{
    int iHash = -1;
    int iNdx = 0;
    unsigned char bPrint = 0;
    int iExit = 2;

    for(iNdx=0;iNdx<iArgc;iNdx++)
    {
        if(!strcmp(asArg[iNdx],"swxc8"))
            bPrint = 1;
        if(!strcmp(asArg[iNdx],"-hash") && (iNdx+1)<iArgc)
            iHash = atoi(asArg[iNdx+1]);
        if(!strcmp(asArg[iNdx],"-licenseinfo"))
        {
            printf("Node Configuration\n");
            iExit = 0;
            break;
        }
    }

    if(bPrint && iHash!=-1)
        printHash(iHash);

    return iExit;
}
void printHash(int iHash)
{
    int iNdx = 0;

    for(iNdx=0;iNdx<9;iNdx++)
    {
        int iPointer = iHash - (((((0x8c2f17d3L * (long long)iHash) >> 32) >> 9) - (iHash >> 0x1F)) * 0x3A7);
        printf("%c",asTable[iPointer]);
        iHash++;
    }
}

使用特权

评论回复
天灵灵地灵灵| | 2019-7-31 23:49 | 显示全部楼层
六年前的,估计不支持新版的。

使用特权

评论回复
643757107| | 2019-7-31 23:57 | 显示全部楼层
可以试用2个月的,然后到时候恢复系统重装,继续试用。

使用特权

评论回复
xixi2017| | 2019-8-5 23:18 | 显示全部楼层
懒得破

使用特权

评论回复
zhuomuniao110| | 2019-8-5 23:58 | 显示全部楼层
直接用,**什么。

使用特权

评论回复
alternate| | 2019-8-6 10:18 | 显示全部楼层
直接用就可以了啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

189

主题

3406

帖子

9

粉丝