123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- #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( long start,TCHAR *OutPath);
- int __stdcall FindPort_2( long start,BYTE *InByte,long InLen,TCHAR *OutPath);
- int __stdcall SetWritePassword(TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *New_HKey,TCHAR *New_LKey,TCHAR *KeyPath);
- int __stdcall SetReadPassword(TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *New_HKey,TCHAR *New_LKey,TCHAR *KeyPath);
- int __stdcall GetRetVar(long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath);
- int __stdcall WriteEncKey(TCHAR *Old_F_HKey,TCHAR *Old_F_LKey,TCHAR *Old_S_HKey,TCHAR *Old_S_LKey,
- TCHAR *New_F_HKey,TCHAR *New_F_LKey,TCHAR *New_S_HKey,TCHAR *New_S_LKey,TCHAR *KeyPath);
- int __stdcall MakeEncFile(TCHAR *InbinFile,TCHAR *KeyPath);
- int __stdcall TranfserVar(long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath);
- int __stdcall YtTranfser(BYTE *InByte,long in_len,long over_count,BOOL IsPub,TCHAR *KeyPath);
- int __stdcall CalEx(BYTE *InByte,long in_len,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
- int __stdcall CalExByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
- int __stdcall YtWriteFloat(double indata,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtWriteLong(long indata,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtWriteEx(BYTE *InBuf,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtReadFloat(double *OutData,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtReadLong(long *OutData,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtReadEx(short add,short len,TCHAR *HKey,TCHAR *LKey,BYTE *dataout_buf,TCHAR *KeyPath);
- int __stdcall YtReadSting(TCHAR *OutString,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtWriteString(TCHAR *InString,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- //取素数对
- int __stdcall GetPRIME(BYTE *p,BYTE *q,int m_len,TCHAR *KeyPath);
- //取密钥对
- int __stdcall GetRSAKey(BYTE *n,BYTE *e,BYTE *d,int m_len,TCHAR *KeyPath);
- //取密钥对,并返回对私钥进行加密的3DES密钥
- int __stdcall GetRSAKey_2(BYTE *n,BYTE *d,int m_len,TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *KeyPath);
- //输入私钥对输入的数据进行加密
- int __stdcall YT_RSA_1(BYTE*e,BYTE *n,BYTE *InBuf,short len,TCHAR *KeyPath);
- //使用储存在加密锁中的私钥对输入的数据进行解密
- int __stdcall YT_RSA_2(short e_Addr,short n_Addr,BYTE *InBuf,short len,TCHAR *KeyPath);
- //使用输入的3DES密钥对储存在加密锁中的私钥进行解密后,再使用解密后的私钥对输入的数据进行解密
- int __stdcall YT_RSA_3(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
- //初始化3DES密钥
- int __stdcall YT_IniKey(TCHAR *KeyPath);
- //输入3des密钥对输入的数据进行加解密
- int __stdcall YT_3DES_1(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,
- BYTE *InBuf,short len,BOOL IsEnc,TCHAR *KeyPath);
- //使用储存在加密锁中的3DES对输入的数据进行加解密
- int __stdcall YT_3DES_2(short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
- //使用储存在加密锁中的3DES及输入的3DES混合后对输入的数据进行加解密
- int __stdcall YT_3DES_3(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
- //字符串转化为字节数组
- void __stdcall StringToByteArray(TCHAR * InString,BYTE *out_data);
- //字节数组转化为16进制字符串
- void __stdcall ByteArrayToHexString(BYTE *in_data,TCHAR * OutString,int len);
- //取字符串的长度
- long __stdcall GetStringLenByByte(TCHAR * InString);
- //16进制字符串转化为数组
- void __stdcall HexStringToByteArray(TCHAR * InString,BYTE *in_data);
- //字节数组转化为字符串
- void __stdcall ByteArrayToString(TCHAR * OutString,BYTE *in_data,int m_len);
- BOOL __stdcall ComPareBigLong(BYTE*n,BYTE *a,short len);
- void __stdcall HexStringToByteArray_2(TCHAR * InString,BYTE *in_data);
- int __stdcall YtMd5ByFile(TCHAR *InFile,TCHAR *OutString,TCHAR *KeyPath);
- int __stdcall YtMd5ByFile_2(TCHAR *InFile,short Addr,TCHAR *KeyPath);
- int __stdcall YtMd5ByFile_3(TCHAR *InFile,short Addr,BOOL *biao,TCHAR *KeyPath);
- int __stdcall GetIDVersion(DWORD *ID,int *version,TCHAR *KeyPath);
- int __stdcall GetLongID(BYTE *OutLongIDByArray,TCHAR *OutLongIDByChar,TCHAR *KeyPath);
- int __stdcall WriteLimitTimes(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
- DWORD SetTimes,TCHAR *KeyPath);
- int __stdcall WriteHostKey(TCHAR *Old_Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
- TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
- int __stdcall GetLimitTimes(DWORD *OutTimes,TCHAR *KeyPath);
- // int __stdcall WriteYinZhi(TCHAR *Old_Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
- // TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
- int __stdcall GetAlreadyTimes(DWORD *OutTimes,TCHAR *KeyPath);
- // int __stdcall MakeRemoteAuth(TCHAR *Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
- // TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
- int __stdcall MakeEncFileByPublic(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
- TCHAR *InbinFile,TCHAR *KeyPath);
- int __stdcall MakeAuthCode(TCHAR *Dev_Key1,TCHAR *Dev_Key2,TCHAR *Dev_Key3,TCHAR *Dev_Key4,
- TCHAR *LongKey,TCHAR *OutAuth,TCHAR *KeyPath);
-
- int __stdcall EdcByFile(TCHAR *Key,
- TCHAR *InbinFile,TCHAR *OutbinFile,TCHAR *KeyPath);
- int __stdcall CalPub(BYTE *InByte,long in_len,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
- int __stdcall CalPubByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
- void __stdcall GetAppPath(TCHAR *OutAppPath);
- void __stdcall ConvertTimerToString(DWORD h_timer,DWORD l_timer,TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
- int __stdcall GetRunTimer(TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,TCHAR *KeyPath);
- int __stdcall MakeTimerAuth(TCHAR *Key,DWORD ID,TCHAR *Year,TCHAR *Month,TCHAR *Day,
- TCHAR *Hour,TCHAR *Minuts,TCHAR *OutString,TCHAR *KeyPath);
- void __stdcall ConvertStringToTimer(DWORD *out_h_timer,DWORD *out_l_timer,TCHAR *Year,
- TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts);
- DWORD __stdcall HexToInt(char* s);
- int __stdcall MakeTimerAuth_2(TCHAR *Key,DWORD ID,TCHAR *Year,
- TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,
- TCHAR *Add_Year,TCHAR *Add_Month,TCHAR *Add_Day,int bili,
- TCHAR *OutString,TCHAR *KeyPath,TCHAR *OutYear,
- TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts);
- int __stdcall GetLeaveTimer(TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,int *OutStatus,
- TCHAR *OutYear,TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts,TCHAR *KeyPath);
- int __stdcall RemoteAuth(BYTE *InBuf,TCHAR *KeyPath);
- int __stdcall Yt3DesByKeyArray(TCHAR *KeyBuf,
- BYTE *InBuf,short len,BOOL IsEnc,TCHAR *KeyPath);
- BOOL __stdcall GetAuthFromFile(TCHAR *InFile,TCHAR *HKey,TCHAR *LKey,TCHAR *OutSetTime,DWORD *id);
- BOOL __stdcall ComPareTime( TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,
- TCHAR *Year_2,TCHAR *Month_2,TCHAR *Day_2,TCHAR *Hour_2,TCHAR *Minuts_2,TCHAR *Second_2,
- TCHAR *OutYear,TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts,TCHAR *OutSecond);
- BOOL __stdcall WriteIniSetting(TCHAR *FileName,TCHAR *HKey,TCHAR *LKey,TCHAR *Time,DWORD id);
- int __stdcall ReadKeyFormEpm(TCHAR *OutAuthCode,int Addr,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- void __stdcall ConvertTimerToStringReal(DWORD InTimer,TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
- DWORD __stdcall ConvertStringToTimerReal( TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
- int __stdcall YTRSAUpdateData(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *LongKey,
- DWORD shortid,long InLongData,TCHAR *InString_1,TCHAR *InString_2,
- TCHAR *OutAuth,CHAR *VerfCode,TCHAR *KeyPath);
- int __stdcall WriteTimeLimitTimes(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
- DWORD SetTimes,TCHAR *KeyPath);
- int __stdcall GetTimeAlreadyTimes(DWORD *OutTimes,TCHAR *KeyPath);
- int __stdcall GetTimeLimitTimes(DWORD *OutTimes,TCHAR *KeyPath);
- int __stdcall WriteTimeAuthToEprom(int addr,TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *Key_1,TCHAR *Key_2,
- DWORD ID,TCHAR *Year,TCHAR *Month,
- TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *KeyPath);
- int __stdcall ReadTimeAuthFromEprom(TCHAR *HKey,TCHAR *LKey,TCHAR *OutSetTime,DWORD *id,int addr,TCHAR *R_HKey,TCHAR *R_LKey,TCHAR *KeyPath);
- BOOL __stdcall GetAuthFromFile_Pub(TCHAR *InFile,TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
- TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,TCHAR *OutSetTime,DWORD *id);
- LONG __stdcall ConvertStringToTimerRealEx( DWORD m_year,DWORD m_month,DWORD m_day,DWORD m_hour,
- DWORD m_minuts,DWORD m_second);
- LONG __stdcall GetSystemTimeByLong();
- int __stdcall ConnectServer(TCHAR *ServerName,int Port);
- int __stdcall ConnectServerEx(TCHAR *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 (TCHAR *ErrorInfo);
- int __stdcall GetIP (int count,TCHAR *OutIP);
- int __stdcall GetNetBoisID (int count,TCHAR *OutNetBoisID,SOCKET *OutSocket);
- int __stdcall GetSystemDateTime (TCHAR *OutSystemDateTime);
- int __stdcall GetConnectComputerInfo (int count,TCHAR *OutIP,TCHAR *ComputerName,TCHAR *OutNetBoisID,TCHAR *LastTime,DWORD *m_socket, BOOL IsALL);
- int __stdcall GetConnectComputerInfoByFunNum (char InFunNum,int count,TCHAR *OutIP,TCHAR *ComputerName,TCHAR *OutNetBoisID,TCHAR *LastTime,DWORD *m_socket, BOOL IsALL);
- int __stdcall SendString(TCHAR *InString);
- void __stdcall SetInfoHwnd(HWND in_hwnd);
- HWND __stdcall GetInfoHwnd();
- int __stdcall GetLocalIP(TCHAR *LocalIP);
- void __stdcall SetFileNotReadOnly(TCHAR *s1);
- void __stdcall SetVfpOverCount(DWORD over_count);
- void __stdcall SetVfpKeyPath(TCHAR *KeyPath);
- int __stdcall VfpCalExByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7);
- int __stdcall VfpCalPubByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
- double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
- TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *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(TCHAR *KeyPath);
- int __stdcall GetSetCountEx(short Addr,long *count,BOOL *IsMachine,char *OutFun,TCHAR *OutVerfCode,TCHAR *KeyPath);
- int __stdcall GetSetCount(short Addr,long *count,BOOL *IsMachine,char *OutFum,TCHAR *KeyPath);
- int __stdcall GetSetCountByFile(TCHAR *InFile,long *count,BOOL *IsMachine,char *OutFum,BOOL IsWriteToKey);
- int __stdcall YTRSAUpdateData_2(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *LongKey,
- DWORD shortid,long InLongData,BOOL IsMachine,char InFun,BYTE *OutBuf,
- TCHAR *OutAuth,TCHAR *VerfCode,TCHAR *KeyPath);
- short __stdcall AddConnectEx(BYTE InFunNum,short Addr,BOOL IfClose,TCHAR *KeyPath);
- int __stdcall CloseSocketByHandle(DWORD m_socket);
- void __stdcall GetServerPath(TCHAR *OutAppPath);
- int __stdcall GetTimerFromAuth(TCHAR *AuthString,TCHAR *Key,DWORD *ID,TCHAR *Year,TCHAR *Month,
- TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,
- TCHAR *KeyPath);
- HWND __stdcall GetEventHwnd();
- void __stdcall SetEventHwnd(HWND in_hwnd);
- int __stdcall WritePubTimeAuthToEprom(int addr,TCHAR *W_HKey,TCHAR *W_LKey,
- TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
- TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,
- DWORD ID,TCHAR *Year,TCHAR *Month,
- TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Sec,TCHAR *KeyPath);
- int __stdcall ReadPubTimeAuthFromEprom(TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
- TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,
- TCHAR *OutSetTime,DWORD *id,int addr,TCHAR *R_HKey,TCHAR *R_LKey,
- TCHAR *KeyPath);
- int __stdcall WriteNetAuthToEpmEx(int Addr,TCHAR *param1,TCHAR *param2,TCHAR *param3,
- TCHAR *param4,TCHAR *param5,TCHAR *param6,
- TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- int __stdcall YtReadString(TCHAR *OutString,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
- short __stdcall AddConnectNew(BYTE InFunNum,short Addr,BOOL IfClose,TCHAR *OutVerfCode,TCHAR *KeyPath);
- }
|