123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- #include <winsock.h>
- // The following ifdef block is the standard way of creating macros which make exporting
- // from a DLL simpler. All files within this DLL are compiled with the MY32_EXPORTS
- // symbol defined on the command line. this symbol should not be defined on any project
- // that uses this DLL. This way any other project whose source files include this file see
- // MY32_API functions as being imported from a DLL, wheras this DLL sees symbols
- // defined with this macro as being exported.
- extern "C"
- {
- int __stdcall FindPort( int start,char *OutPath);
- int __stdcall FindPort_2( int start,BYTE *InByte,int InLen,char *OutPath);
- int __stdcall SetWritePassword(char *W_HKey,char *W_LKey,char *New_HKey,char *New_LKey,char *KeyPath);
- int __stdcall SetReadPassword(char *W_HKey,char *W_LKey,char *New_HKey,char *New_LKey,char *KeyPath);
- int __stdcall GetRetVar(int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath);
- int __stdcall WriteEncKey(char *Old_F_HKey,char *Old_F_LKey,char *Old_S_HKey,char *Old_S_LKey,
- char *New_F_HKey,char *New_F_LKey,char *New_S_HKey,char *New_S_LKey,char *KeyPath);
- int __stdcall MakeEncFile(char *InbinFile,char *KeyPath);
- int __stdcall TranfserVar(int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath);
- int __stdcall YtTranfser(BYTE *InByte,int in_len,int over_count,BOOL IsPub,char *KeyPath);
- int __stdcall CalEx(BYTE *InByte,int in_len,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
- int __stdcall CalExByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
- int __stdcall YtWriteFloat(double indata,short add,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtWriteLong(int indata,short add,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtWriteEx(BYTE *InBuf,short add,short len,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtReadFloat(double *OutData,short add,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtReadLong(int *OutData,short add,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtReadEx(short add,short len,char *HKey,char *LKey,BYTE *dataout_buf,char *KeyPath);
- int __stdcall YtReadSting(char *OutString,short add,short len,char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtWriteString(char *InString,short add,char *HKey,char *LKey,char *KeyPath);
- //取素数对
- int __stdcall GetPRIME(BYTE *p,BYTE *q,int m_len,char *KeyPath);
- //取密钥对
- int __stdcall GetRSAKey(BYTE *n,BYTE *e,BYTE *d,int m_len,char *KeyPath);
- //取密钥对,并返回对私钥进行加密的3DES密钥
- int __stdcall GetRSAKey_2(BYTE *n,BYTE *d,int m_len,char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *KeyPath);
- //输入私钥对输入的数据进行加密
- int __stdcall YT_RSA_1(BYTE*e,BYTE *n,BYTE *InBuf,short len,char *KeyPath);
- //使用储存在加密锁中的私钥对输入的数据进行解密
- int __stdcall YT_RSA_2(short e_Addr,short n_Addr,BYTE *InBuf,short len,char *KeyPath);
- //使用输入的3DES密钥对储存在加密锁中的私钥进行解密后,再使用解密后的私钥对输入的数据进行解密
- int __stdcall YT_RSA_3(char *Key_1,char *Key_2,char *Key_3,char *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
- //初始化3DES密钥
- int __stdcall YT_IniKey(char *KeyPath);
- //输入3des密钥对输入的数据进行加解密
- int __stdcall YT_3DES_1(char *Key_1,char *Key_2,char *Key_3,char *Key_4,
- BYTE *InBuf,short len,BOOL IsEnc,char *KeyPath);
- //使用储存在加密锁中的3DES对输入的数据进行加解密
- int __stdcall YT_3DES_2(short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
- //使用储存在加密锁中的3DES及输入的3DES混合后对输入的数据进行加解密
- int __stdcall YT_3DES_3(char *Key_1,char *Key_2,char *Key_3,char *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
- //字符串转化为字节数组
- void __stdcall StringToByteArray(char * InString,BYTE *out_data);
- //字节数组转化为16进制字符串
- void __stdcall ByteArrayToHexString(BYTE *in_data,char * OutString,int len);
- //取字符串的长度
- int __stdcall GetStringLenByByte(char * InString);
- //16进制字符串转化为数组
- void __stdcall HexStringToByteArray(char * InString,BYTE *in_data);
- //字节数组转化为字符串
- void __stdcall ByteArrayToString(char * OutString,BYTE *in_data,int m_len);
- BOOL __stdcall ComPareBigLong(BYTE*n,BYTE *a,short len);
- void __stdcall HexStringToByteArray_2(char * InString,BYTE *in_data);
- int __stdcall YtMd5ByFile(char *InFile,char *OutString,char *KeyPath);
- int __stdcall YtMd5ByFile_2(char *InFile,short Addr,char *KeyPath);
- int __stdcall YtMd5ByFile_3(char *InFile,short Addr,BOOL *biao,char *KeyPath);
- int __stdcall GetIDVersion(DWORD *ID,int *version,char *KeyPath);
- int __stdcall GetLongID(BYTE *OutLongIDByArray,char *OutLongIDByChar,char *KeyPath);
- int __stdcall WriteLimitTimes(char *Key1,char *Key2,char *Key3,char *Key4,
- DWORD SetTimes,char *KeyPath);
- int __stdcall WriteHostKey(char *Old_Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
- char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
- int __stdcall GetLimitTimes(DWORD *OutTimes,char *KeyPath);
- // int __stdcall WriteYinZhi(char *Old_Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
- // char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
- int __stdcall GetAlreadyTimes(DWORD *OutTimes,char *KeyPath);
- // int __stdcall MakeRemoteAuth(char *Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
- // char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
- int __stdcall MakeEncFileByPublic(char *Key1,char *Key2,char *Key3,char *Key4,
- char *InbinFile,char *KeyPath);
- int __stdcall MakeAuthCode(char *Dev_Key1,char *Dev_Key2,char *Dev_Key3,char *Dev_Key4,
- char *LongKey,char *OutAuth,char *KeyPath);
- int __stdcall EdcByFile(char *Key,
- char *InbinFile,char *OutbinFile,char *KeyPath);
- int __stdcall CalPub(BYTE *InByte,int in_len,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
- int __stdcall CalPubByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
- void __stdcall GetAppPath(char *OutAppPath);
- void __stdcall ConvertTimerToString(DWORD h_timer,DWORD l_timer,char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
- int __stdcall GetRunTimer(char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second,char *KeyPath);
- int __stdcall MakeTimerAuth(char *Key,DWORD ID,char *Year,char *Month,char *Day,
- char *Hour,char *Minuts,char *OutString,char *KeyPath);
- void __stdcall ConvertStringToTimer(DWORD *out_h_timer,DWORD *out_l_timer,char *Year,
- char *Month,char *Day,char *Hour,char *Minuts);
- DWORD __stdcall HexToInt(char* s);
- int __stdcall MakeTimerAuth_2(char *Key,DWORD ID,char *Year,
- char *Month,char *Day,char *Hour,char *Minuts,
- char *Add_Year,char *Add_Month,char *Add_Day,int bili,
- char *OutString,char *KeyPath,char *OutYear,
- char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts);
- int __stdcall GetLeaveTimer(char *Year,char *Month,char *Day,char *Hour,char *Minuts,int *OutStatus,
- char *OutYear,char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts,char *KeyPath);
- int __stdcall RemoteAuth(BYTE *InBuf,char *KeyPath);
- int __stdcall Yt3DesByKeyArray(char *KeyBuf,
- BYTE *InBuf,short len,BOOL IsEnc,char *KeyPath);
- BOOL __stdcall GetAuthFromFile(char *InFile,char *HKey,char *LKey,char *OutSetTime,DWORD *id);
- BOOL __stdcall ComPareTime( char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second,
- char *Year_2,char *Month_2,char *Day_2,char *Hour_2,char *Minuts_2,char *Second_2,
- char *OutYear,char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts,char *OutSecond);
- BOOL __stdcall WriteIniSetting(char *FileName,char *HKey,char *LKey,char *Time,DWORD id);
- int __stdcall ReadKeyFormEpm(char *OutAuthCode,int Addr,char *HKey,char *LKey,char *KeyPath);
- void __stdcall ConvertTimerToStringReal(DWORD InTimer,char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
- DWORD __stdcall ConvertStringToTimerReal( char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
- int __stdcall YTRSAUpdateData(char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *LongKey,
- DWORD shortid,int InLongData,char *InString_1,char *InString_2,
- char *OutAuth,CHAR *VerfCode,char *KeyPath);
- int __stdcall WriteTimeLimitTimes(char *Key1,char *Key2,char *Key3,char *Key4,
- DWORD SetTimes,char *KeyPath);
- int __stdcall GetTimeAlreadyTimes(DWORD *OutTimes,char *KeyPath);
- int __stdcall GetTimeLimitTimes(DWORD *OutTimes,char *KeyPath);
- int __stdcall WriteTimeAuthToEprom(int addr,char *W_HKey,char *W_LKey,char *Key_1,char *Key_2,
- DWORD ID,char *Year,char *Month,
- char *Day,char *Hour,char *Minuts,char *KeyPath);
- int __stdcall ReadTimeAuthFromEprom(char *HKey,char *LKey,char *OutSetTime,DWORD *id,int addr,char *R_HKey,char *R_LKey,char *KeyPath);
- BOOL __stdcall GetAuthFromFile_Pub(char *InFile,char *PARAM1,char *PARAM2,char *PARAM3,
- char *PARAM4,char *PARAM5,char *PARAM6,char *OutSetTime,DWORD *id);
- int __stdcall ConvertStringToTimerRealEx( DWORD m_year,DWORD m_month,DWORD m_day,DWORD m_hour,
- DWORD m_minuts,DWORD m_second);
- int __stdcall GetSystemTimeByLong();
- int __stdcall ConnectServer(char *ServerName,int Port);
- int __stdcall ConnectServerEx(char *ServerName,int Port,DWORD *OutIP,DWORD *OutSockect);
- int __stdcall DisconnectServer ();
- int __stdcall StartServer (int Port);
- int __stdcall StopServer ();
- int __stdcall GetMachineCount ();
- int __stdcall GetClientCount();
- int __stdcall GetAllowClientCount ();
- void __stdcall SetInfoMode(int in_mode);
- int __stdcall GetInfoMode();
- int __stdcall SetRestrictMode (int ModeFlag);
- int __stdcall GetRestrictMode ();
- int __stdcall GetConnectLastError (char *ErrorInfo);
- int __stdcall GetIP (int count,char *OutIP);
- int __stdcall GetNetBoisID (int count,char *OutNetBoisID,SOCKET *OutSocket);
- int __stdcall GetSystemDateTime (char *OutSystemDateTime);
- int __stdcall GetConnectComputerInfo (int count,char *OutIP,char *ComputerName,char *OutNetBoisID,char *LastTime,DWORD *m_socket, BOOL IsALL);
- int __stdcall GetConnectComputerInfoByFunNum (char InFunNum,int count,char *OutIP,char *ComputerName,char *OutNetBoisID,char *LastTime,DWORD *m_socket, BOOL IsALL);
- int __stdcall SendString(char *InString);
- void __stdcall SetInfoHwnd(HWND in_hwnd);
- HWND __stdcall GetInfoHwnd();
- int __stdcall GetLocalIP(char *LocalIP);
- void __stdcall SetFileNotReadOnly(char *s1);
- void __stdcall SetVfpOverCount(DWORD over_count);
- void __stdcall SetVfpKeyPath(char *KeyPath);
- int __stdcall VfpCalExByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7);
- int __stdcall VfpCalPubByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7);
- int __stdcall GetFunCount();
- int __stdcall GetFunNum(char pos);
- short __stdcall GetIpCountByFunNum(char FunNum);
- short __stdcall GetConCountByFunNum(char FunNum);
- short __stdcall GetConCountByIpFun(char FunNum,char *m_ip);
- int __stdcall IniStartServer(char *KeyPath);
- int __stdcall GetSetCountEx(short Addr,int *count,BOOL *IsMachine,char *OutFun,char *OutVerfCode,char *KeyPath);
- int __stdcall GetSetCount(short Addr,int *count,BOOL *IsMachine,char *OutFum,char *KeyPath);
- int __stdcall GetSetCountByFile(char *InFile,int *count,BOOL *IsMachine,char *OutFum,BOOL IsWriteToKey);
- int __stdcall YTRSAUpdateData_2(char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *LongKey,
- DWORD shortid,int InLongData,BOOL IsMachine,char InFun,BYTE *OutBuf,
- char *OutAuth,char *VerfCode,char *KeyPath);
- short __stdcall AddConnectEx(BYTE InFunNum,short Addr,BOOL IfClose,char *KeyPath);
- int __stdcall CloseSocketByHandle(DWORD m_socket);
- void __stdcall GetServerPath(char *OutAppPath);
- int __stdcall GetTimerFromAuth(char *AuthString,char *Key,DWORD *ID,char *Year,char *Month,
- char *Day,char *Hour,char *Minuts,char *Second,
- char *KeyPath);
- HWND __stdcall GetEventHwnd();
- void __stdcall SetEventHwnd(HWND in_hwnd);
- int __stdcall WritePubTimeAuthToEprom(int addr,char *W_HKey,char *W_LKey,
- char *PARAM1,char *PARAM2,char *PARAM3,
- char *PARAM4,char *PARAM5,char *PARAM6,
- DWORD ID,char *Year,char *Month,
- char *Day,char *Hour,char *Minuts,char *Sec,char *KeyPath);
- int __stdcall ReadPubTimeAuthFromEprom(char *PARAM1,char *PARAM2,char *PARAM3,
- char *PARAM4,char *PARAM5,char *PARAM6,
- char *OutSetTime,DWORD *id,int addr,char *R_HKey,char *R_LKey,
- char *KeyPath);
- int __stdcall WriteNetAuthToEpmEx(int Addr,char *param1,char *param2,char *param3,
- char *param4,char *param5,char *param6,
- char *HKey,char *LKey,char *KeyPath);
- int __stdcall YtReadString(char *OutString,short add,short len,char *HKey,char *LKey,char *KeyPath);
- short __stdcall AddConnectNew(BYTE InFunNum,short Addr,BOOL IfClose,char *OutVerfCode,char *KeyPath);
- BOOL __stdcall EdccBin(char *Key,
- BYTE *InByte,int in_len,char *OutErrCode,char *KeyPath);
- void __stdcall StringToDword(DWORD *d0,DWORD *d1,DWORD *d2,char *InString);
- void __stdcall DwordToString(char *InString,DWORD d0);
- int __stdcall YtMd5(BYTE *InBuf,int m_len,char *OutString,char *KeyPath);
- int __stdcall YtMd5_2(BYTE *InBuf,int m_len,short Addr,char *KeyPath);
- int __stdcall YtMd5_3(BYTE *InBuf,int m_len,short Addr,BOOL *biao,char *KeyPath);
- //2008-2-16
- void __stdcall AutoDisConnect(DWORD timer,BOOL biao);
- typedef short (* OnMyConnect)( char *IP,char *ComputerName,char *NetBoisID,DWORD m_socket);
- void __stdcall SetCallBackFun(OnMyConnect FunConnec);
- // 初始化加密锁工具;
- int __stdcall ReSet(char *Keypath);
- }
|