i55 发表于 2013-6-13 14:53

Microchip XC8/XC16/XC32 **

复制下列代码,另存为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, "swxc32") ||
            !strcmp(argv, "swxc16") ||
            !strcmp(argv, "swxc8"))
      {
            license = LICENSE_PRO;
      }
      else if (!strcmp(argv, "swxcpp32"))
      {
            license = LICENSE_CPPFULL;
      }
      else if (!strcmp(argv, "-hash"))
      {
            int index = atoi(argv);
            printf("%.10s", &XC8_KEY);
      }
    }

    return license;
}

huangxz 发表于 2013-6-13 15:18

nevermore008 发表于 2013-6-13 16:11

会不会出bug,以前用picc的**版出过bug

hexenzhou 发表于 2013-6-13 17:02

用VC不行吗?

LingTian 发表于 2013-6-23 22:40

可以用的吗?

l4157 发表于 2013-6-23 22:49

试过,貌似可以...

i55 发表于 2013-7-29 13:21

#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,"swxc8"))
            bPrint = 1;
      if(!strcmp(asArg,"-hash") && (iNdx+1)<iArgc)
            iHash = atoi(asArg);
      if(!strcmp(asArg,"-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);
      iHash++;
    }
}

aeqw 发表于 2013-8-6 18:52

雖然挺麻煩的!!
不過至少還不錯用呢!!
分享我編譯好的東西~
省得大家麻煩!!

aeqw 发表于 2013-8-6 18:53

第二個源碼...
看起來好像效果一樣?
目前感覺不出有啥區別...

l4157 发表于 2013-8-15 10:56

aeqw 发表于 2013-8-6 18:53 static/image/common/back.gif
第二個源碼...
看起來好像效果一樣?
目前感覺不出有啥區別...

XCLM2 好像能**1.20

ljq200 发表于 2013-8-15 15:27

谢谢分享!

hemporer 发表于 2013-8-22 19:35

这种方法很牛
但只能忽悠MPLAB IDE
不能忽悠MPLAB X IDE呀
大侠们还得努力
还有进步空间哦

michaelxcj 发表于 2013-8-27 10:51

l4157 发表于 2013-8-15 10:56 static/image/common/back.gif
XCLM2 好像能**1.20

@14157,试过没有?怎么查看?

michaelxcj 发表于 2013-8-27 10:56

hemporer 发表于 2013-8-22 19:35 static/image/common/back.gif
这种方法很牛
但只能忽悠MPLAB IDE
不能忽悠MPLAB X IDE呀


MPLAB IDE能**吗?怎么确认是不是**了

michaelxcj 发表于 2013-8-27 11:00

是不是运行xc8 --ver后,显示
Microchip MPLAB XC8 C Compiler V1.20
Copyright (C) 2013 Microchip Technology Inc.
就证明是**了,有没有人可以确认一下?

l4157 发表于 2013-8-27 21:33

michaelxcj 发表于 2013-8-27 10:51 static/image/common/back.gif
@14157,试过没有?怎么查看?

Microchip MPLAB XC8 C Compiler V1.20
Copyright (C) 2013 Microchip Technology Inc.
License type: Node Configuration


Memory Summary:
    Program space      used   245h (   581) of   400h words   ( 56.7%)
    Data space         used    17h (    23) of    40h bytes   ( 35.9%)
    EEPROM space         None available
    Configuration bits   used   2h (   2) of   2h words   (100.0%)
    ID Location space    used   0h (   0) of   4h bytes   (0.0%)

dong_abc 发表于 2013-8-27 23:15

收藏

michaelxcj 发表于 2013-8-28 09:29

l4157 发表于 2013-8-27 21:33 static/image/common/back.gif
Microchip MPLAB XC8 C Compiler V1.20
Copyright (C) 2013 Microchip Technology Inc.
License type: No ...

我的意思是,怎么确认是不是试用PRO版本?我是8月22日装的,我要确认2个月后是不是就到期了?还是永久是PRO版本的

李富贵 发表于 2013-8-28 14:53

aeqw 发表于 2013-8-6 18:53 static/image/common/back.gif
第二個源碼...
看起來好像效果一樣?
目前感覺不出有啥區別...

第一个是Floating Workstation,第二个是Nodelocked License,显示的授权许可明显不同。

亚历山大Y 发表于 2013-8-28 15:41

顶起
页: [1] 2 3 4
查看完整版本: Microchip XC8/XC16/XC32 **