summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Sdk
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-27 21:10:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-27 21:10:30 +0300
commitdb55f5b6eb4911fc1062917d7e95b6aaae165fdf (patch)
tree837646ed9b16e27c4915e1b76900fb88ba6d18ff /protocols/MRA/src/Sdk
parent40c4c15d469744813f75e73ae9edf82485c1862f (diff)
fixes #1614 (MRA protocol deprecated due its death)
Diffstat (limited to 'protocols/MRA/src/Sdk')
-rw-r--r--protocols/MRA/src/Sdk/BuffToLowerCase.h95
-rw-r--r--protocols/MRA/src/Sdk/FIFOMT.h73
-rw-r--r--protocols/MRA/src/Sdk/InterlockedFunctions.h53
-rw-r--r--protocols/MRA/src/Sdk/InternetTime.h290
-rw-r--r--protocols/MRA/src/Sdk/ListMT.h200
-rw-r--r--protocols/MRA/src/Sdk/MemoryFind.h76
-rw-r--r--protocols/MRA/src/Sdk/MemoryFindByte.h47
-rw-r--r--protocols/MRA/src/Sdk/RC4.h99
-rw-r--r--protocols/MRA/src/Sdk/SHA1.h87
-rw-r--r--protocols/MRA/src/Sdk/StrHexToNum.h72
-rw-r--r--protocols/MRA/src/Sdk/StrToNum.h85
-rw-r--r--protocols/MRA/src/Sdk/timefuncs.h105
12 files changed, 0 insertions, 1282 deletions
diff --git a/protocols/MRA/src/Sdk/BuffToLowerCase.h b/protocols/MRA/src/Sdk/BuffToLowerCase.h
deleted file mode 100644
index 5c1c231222..0000000000
--- a/protocols/MRA/src/Sdk/BuffToLowerCase.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#if !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_)
-#define AFX_BUFFTOLOWERCASE__H__INCLUDED_
-
-#pragma once
-
-
-__inline BOOL BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,size_t dwLen)
-{
- BOOL bRet=TRUE;
-
-#if defined(_WIN64) || !defined(_WIN32)
- if (lpcOutBuff && lpcBuff && dwLen)
- {
- BYTE bt;
- LPBYTE lpbtIn=(LPBYTE)lpcBuff,lpbtOut=(LPBYTE)lpcOutBuff;
-
- for(size_t i=dwLen;i;i--)
- {
- bt=(*(lpbtIn++));
- if (bt>='A' && bt<='Z') bt|=32;
- (*(lpbtOut++))=bt;
- }
- }
-#else
- __asm
- {
- mov ecx,dwLen
- test ecx,ecx
- jz short end_func
-
- push ebx // сохраняем регистр
- push edi // сохраняем регистр
- push esi // сохраняем регистр
- mov esi,lpcBuff
- mov edi,lpcOutBuff
- mov bl,'A'
- mov bh,'Z'
- mov ah,32
- cld
-
- lowcaseloop:
- lodsb
- cmp al,bl
- jl short savebyte
- cmp al,bh
- jg short savebyte
- or al,ah
-
- savebyte:
- stosb
-
- dec ecx
- jnz short lowcaseloop
-
- pop esi // восстанавливаем содержимое регистра
- pop edi // восстанавливаем содержимое регистра
- pop ebx // восстанавливаем содержимое регистра
- end_func:
- }
-#endif
-return(bRet);
-}
-
-
-
-
-#endif // !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/src/Sdk/FIFOMT.h b/protocols/MRA/src/Sdk/FIFOMT.h
deleted file mode 100644
index 0cff1914d5..0000000000
--- a/protocols/MRA/src/Sdk/FIFOMT.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_FIFO_MT__H__INCLUDED_)
-#define AFX_FIFO_MT__H__INCLUDED_
-
-#pragma once
-
-#include "Sdk/ListMT.h"
-#include "Sdk/InterlockedFunctions.h"
-
-typedef LIST_MT FIFO_MT, *PFIFO_MT, *LPFIFO_MT;
-typedef PCLIST_MT PCFIFO_MT, LPCFIFO_MT;
-
-typedef LIST_MT_ITEM FIFO_MT_ITEM, *PFIFO_MT_ITEM, *LPFIFO_MT_ITEM;
-typedef PCLIST_MT_ITEM PCFIFO_MT_ITEM, LPCFIFO_MT_ITEM;
-
-typedef LIST_MT_ITERATOR FIFO_MT_ITERATOR, *PFIFO_MT_ITERATOR, *LPFIFO_MT_ITERATOR;
-typedef PCLIST_MT_ITERATOR PCFIFO_MT_ITERATOR, LPCFIFO_MT_ITERATOR;
-
-
-__inline size_t FifoMTItemPush(PCFIFO_MT pcpmtFifoMT,PCFIFO_MT_ITEM pcffmtiFifoItem,LPVOID lpData)
-{
- mir_cslock l(pcpmtFifoMT->cs);
- return ListMTItemAdd(pcpmtFifoMT,pcffmtiFifoItem,lpData);
-}
-
-
-__inline DWORD FifoMTItemPop(PCFIFO_MT pcpmtFifoMT,PFIFO_MT_ITEM *ppffmtiFifoItem,LPVOID *plpData)
-{
- DWORD dwRetErrorCode;
- PLIST_MT_ITEM plmtiItem;
-
- mir_cslock l(pcpmtFifoMT->cs);
- if ((dwRetErrorCode=ListMTItemGetFirst(pcpmtFifoMT,&plmtiItem,plpData))==NO_ERROR)
- {
- if (ppffmtiFifoItem) (*ppffmtiFifoItem)=plmtiItem;
- return ListMTItemDelete(pcpmtFifoMT,plmtiItem);
- }
-
- return dwRetErrorCode;
-}
-
-#define FifoMTGetCount(pcpmtFifoMT) ListMTGetCount(pcpmtFifoMT)
-
-
-#endif // !defined(AFX_FIFO_MT__H__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/InterlockedFunctions.h b/protocols/MRA/src/Sdk/InterlockedFunctions.h
deleted file mode 100644
index 49b7332fd8..0000000000
--- a/protocols/MRA/src/Sdk/InterlockedFunctions.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
-#define AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_
-
-#pragma once
-
-#ifndef InterlockedIncrementPointer
-#if defined(_WIN64)
-#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement64((LONGLONG volatile*)lpAddend)
-#else
-#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement((LONG volatile*)lpAddend)
-#endif
-#endif //InterlockedIncrementPointer
-
-
-#ifndef InterlockedDecrementPointer
-#if defined(_WIN64)
-#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement64((LONGLONG volatile*)lpAddend)
-#else
-#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement((LONG volatile*)lpAddend)
-#endif
-#endif //InterlockedDecrementPointer
-
-
-#endif // !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/InternetTime.h b/protocols/MRA/src/Sdk/InternetTime.h
deleted file mode 100644
index 865d02a3e5..0000000000
--- a/protocols/MRA/src/Sdk/InternetTime.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
-#define AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-
-
-#pragma once
-
-#include "Sdk/StrToNum.h"
-#include "Sdk/MemoryFind.h"
-#include "Sdk/MemoryFindByte.h"
-
-typedef struct
-{
- LONG lTimeZone;
- SYSTEMTIME stTime;
-} INTERNET_TIME;
-
-
-static LPCSTR lpcszenmMonthEnum[13]= {"---","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
-static LPCSTR lpcszenmDayOfWeakEnum[7]= {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
-
-#define CRLF "\r\n"
-
-__inline BOOL SkeepSPWSP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR *plpszRetBuff,size_t *pdwRetBuffSize)
-{
- BOOL bRet=TRUE;
-
- if (lpszBuff && dwBuffSize && (plpszRetBuff || pdwRetBuffSize))
- {
- while ((*lpszBuff)<33 && dwBuffSize)
- {
- dwBuffSize--;
- lpszBuff++;
- }
-
- if (plpszRetBuff) (*plpszRetBuff)=(LPSTR)lpszBuff;
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwBuffSize;
- }else{
- bRet=FALSE;
- }
-return(bRet);
-}
-
-
-__inline BOOL WSP2SP(LPCSTR lpszBuff,size_t dwBuffSize,LPSTR lpszRetBuff,size_t *pdwRetBuffSize)
-{// WSP->SP
- BOOL bRet=TRUE;
-
- if (lpszBuff && dwBuffSize && lpszRetBuff)
- {
- LPSTR lpszCurReadPos,pCRLF,lpszCurWritePos;
- size_t dwToCopy,dwRetBuffSize;
-
- pCRLF=(LPSTR)lpszBuff;
- lpszCurReadPos=(LPSTR)lpszBuff;
- lpszCurWritePos=lpszRetBuff;
- dwRetBuffSize=0;
-
- while(pCRLF)
- {
- pCRLF=(LPSTR)MemoryFind((pCRLF-lpszBuff),lpszBuff,(dwBuffSize-1),CRLF,2);
- if (pCRLF)
- {
- pCRLF+=2;
- if ((*pCRLF)==9 || (*pCRLF)==32)// LWS: <US-ASCII HT, horizontal-tab (9)> || <US-ASCII SP, space (32)>
- {
- dwToCopy=((pCRLF-2)-lpszCurReadPos);
- pCRLF++;
-
- memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
- dwRetBuffSize+=(dwToCopy+1);
- lpszCurWritePos+=dwToCopy;
- lpszCurWritePos[0]=32;
- lpszCurWritePos++;
- lpszCurReadPos=pCRLF;
- }
- }else{
- dwToCopy=((lpszBuff+dwBuffSize)-lpszCurReadPos);
- dwRetBuffSize+=dwToCopy;
- memmove((LPVOID)lpszCurWritePos,(CONST VOID*)lpszCurReadPos,dwToCopy);
- }
- }
-
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwRetBuffSize;
- }else{
- bRet=FALSE;
- }
-return(bRet);
-}
-
-__inline void InternetTimeGetCurrentTime(INTERNET_TIME *pitTime)
-{
- TIME_ZONE_INFORMATION tzi={0};
- GetTimeZoneInformation(&tzi);
- pitTime->lTimeZone=tzi.Bias;
- GetSystemTime(&pitTime->stTime);
-}
-
-// Переводит время из MAILTIME в строковое
-__inline CMStringA InternetTimeGetString(INTERNET_TIME *pitTime)
-{
- char lpszBuff[100];
- LPSTR lpszCurPos = lpszBuff;
- size_t dwTimeLen = 0, dwtm;
-
- // day of weak// date of mounth// mounth name// year// hours // minutes// seconds
- dwtm = wsprintfA(lpszCurPos, "%s, %02lu %s %04lu %02lu:%02lu:%02lu ",
- lpcszenmDayOfWeakEnum[pitTime->stTime.wDayOfWeek],
- pitTime->stTime.wDay,
- lpcszenmMonthEnum[pitTime->stTime.wMonth],
- pitTime->stTime.wYear,
- pitTime->stTime.wHour,
- pitTime->stTime.wMinute,
- pitTime->stTime.wSecond);
- lpszCurPos += dwtm;
- dwTimeLen += dwtm;
-
- // time zone
- if (pitTime->lTimeZone) {
- if (pitTime->lTimeZone < 0) { // нужно добавить плюсик, минус добавляется автоматом
- (*((BYTE*)lpszCurPos)) = '+';
- lpszCurPos ++;
- dwTimeLen ++;
- }
-
- dwtm = wsprintfA(lpszCurPos, "%04ld", -(((pitTime->lTimeZone / 60) * 100) + pitTime->lTimeZone % 60));
- lpszCurPos += dwtm;
- dwTimeLen += dwtm;
- } else {
- dwtm = wsprintfA(lpszCurPos, "GMT");
- lpszCurPos += dwtm;
- dwTimeLen += dwtm;
- }
-
- return lpszBuff;
-}
-
-// Переводит время из строкового в INTERNET_TIME
-__inline DWORD InternetTimeGetTime(const CMStringA &lpszTime, INTERNET_TIME &pitTime)
-{
- if (lpszTime.IsEmpty())
- return ERROR_INVALID_HANDLE;
-
- // = Thu, 21 May 1998 05:33:29 -0700 =
- char sztmBuff[4096];
- LPSTR lpszCurPos=sztmBuff,lpszTemp;
- size_t dwCurSize=4096,dwTemp;
-
- memset(&pitTime, 0, sizeof(INTERNET_TIME));
- WSP2SP(lpszTime, lpszTime.GetLength(), lpszCurPos, &dwCurSize);
-
- if (dwCurSize > 3) { // день недели
- if (lpszCurPos[3] == ',') {
- for (unsigned short i=0; i < 7; i++) {
- if ( !_memicmp(lpcszenmDayOfWeakEnum[i], lpszCurPos, 3)) {
- pitTime.stTime.wDayOfWeek = i;
- break;
- }
- }
-
- lpszCurPos+=4;
- dwCurSize-=4;
- }
-
- if (dwCurSize>2) { // день месяца
- SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
- if ((lpszTemp = (LPSTR)MemoryFindByte(0, lpszCurPos, dwCurSize,' '))) {
- dwTemp=(lpszTemp-lpszCurPos);
- pitTime.stTime.wDay=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos=(lpszTemp+1);
- dwCurSize-=(dwTemp+1);
-
- if (dwCurSize > 3) { // месяц
- SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
-
- for (unsigned short i=1; i < 13; i++)
- if ( !_memicmp(lpcszenmMonthEnum[i], lpszCurPos, 3)) {
- pitTime.stTime.wMonth = i;
- break;
- }
-
- lpszCurPos += 3;
- dwCurSize -= 3;
-
- if (dwCurSize > 3) { // год
- SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
- if ((lpszTemp = (LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' '))) {
- dwTemp=(lpszTemp-lpszCurPos);
- pitTime.stTime.wYear=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos=(lpszTemp+1);
- dwCurSize-=(dwTemp+1);
-
- if (dwCurSize > 2) { // часы
- SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
- if ((lpszTemp = (LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,':'))) {
- dwTemp=(lpszTemp-lpszCurPos);
- pitTime.stTime.wHour=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos=(lpszTemp+1);
- dwCurSize-=(dwTemp+1);
-
- if (dwCurSize > 2) { // минуты
- SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
- if ((lpszTemp=(LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,':')))
- {
- dwTemp=(lpszTemp-lpszCurPos);
- pitTime.stTime.wMinute=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos = (lpszTemp+1);
- dwCurSize -= (dwTemp+1);
-
- if (dwCurSize > 2) { // секунды, они есть
- if ((lpszTemp = (LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' '))) {
- dwTemp=(lpszTemp-lpszCurPos);
- pitTime.stTime.wSecond=(unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos=(lpszTemp+1);
- dwCurSize-=(dwTemp+1);
- }
- }
- else {// зоны нет
- if (dwCurSize) {
- pitTime.stTime.wSecond=(unsigned short)StrToUNum32(lpszCurPos,dwCurSize);
- lpszCurPos+=dwCurSize;
- dwCurSize=0;
- }
- }
- }
- else {
- if ((lpszTemp = (LPSTR)MemoryFindByte(0,lpszCurPos,dwCurSize,' '))) {
- dwTemp = (lpszTemp-lpszCurPos);
- pitTime.stTime.wMinute = (unsigned short)StrToUNum32(lpszCurPos,dwTemp);
-
- lpszCurPos = (lpszTemp+1);
- dwCurSize -= (dwTemp+1);
- }
- }
-
- if (dwCurSize) { // часовой пояс
- SkeepSPWSP(lpszCurPos, dwCurSize, &lpszCurPos, &dwCurSize);
- pitTime.lTimeZone = (LONG)StrToNum(lpszCurPos, dwCurSize);
- if (pitTime.lTimeZone > 1300 || pitTime.lTimeZone < -1200)
- pitTime.lTimeZone = 2400;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- return NO_ERROR;
-}
-
-
-
-#endif // !defined(AFX_INTERNET_TIME_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/ListMT.h b/protocols/MRA/src/Sdk/ListMT.h
deleted file mode 100644
index ed9b8cfec9..0000000000
--- a/protocols/MRA/src/Sdk/ListMT.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_LIST_MT__H__INCLUDED_)
-#define AFX_LIST_MT__H__INCLUDED_
-
-#pragma once
-
-#include "Sdk/InterlockedFunctions.h"
-
-#pragma warning(push)
-#pragma warning(disable:4312) // warning C4312: 'type cast' : conversion from 'LONG' to 'PVOID' of greater size
-
-
-// структура для работы со списком, элемент списка
-typedef struct _LIST_MT_ITEM
-{
-#ifdef __cplusplus
- _LIST_MT_ITEM *plmtiPrev; // *предыдущий элемент в списке
- _LIST_MT_ITEM *plmtiNext; // *следующий элемент в списке
-#else
- LPVOID *plmtiPrev; // *предыдущий элемент в списке
- LPVOID *plmtiNext; // *следующий элемент в списке
-#endif
- LPVOID lpListMT; // указатель на заголовок списка, см структуру ниже
- LPVOID lpData; // указатель на данные, связанные с элементом списка
-}LIST_MT_ITEM, *PLIST_MT_ITEM, *LPLIST_MT_ITEM;
-typedef CONST PLIST_MT_ITEM PCLIST_MT_ITEM, LPCLIST_MT_ITEM;
-
-
-// структура для работы со списком, заголовок списка
-typedef struct _LIST_MT : public MZeroedObject
-{
- size_t nCount; // *количество элементов в списке
- PLIST_MT_ITEM plmtiFirst; // *указывает на первый элемент в списке
- PLIST_MT_ITEM plmtiLast; // *указывает на последний элемент в списке
- mir_cs cs; // *section for exclysive access to List
-}LIST_MT, *PLIST_MT, *LPLIST_MT;
-typedef CONST PLIST_MT PCLIST_MT, LPCLIST_MT;
-
-
-// структура для работы с итератором
-typedef struct _LIST_MT_ITERATOR
-{
- PLIST_MT_ITEM plmtListMTItem;
-}LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
-//typedef LIST_MT_ITEM LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
-typedef CONST PLIST_MT_ITERATOR PCLIST_MT_ITERATOR, LPCLIST_MT_ITERATOR;
-
-
-__inline size_t ListMTGetCount(PCLIST_MT pclmtListMT)
-{
- return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount, nullptr, nullptr));
-}
-
-
-__inline size_t ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
-{
- size_t dwRet=(size_t)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
- pclmtListMTItem->lpData=lpData;
- pclmtListMTItem->lpListMT=pclmtListMT;
-
- if (pclmtListMT->plmtiLast)
- {// add node to end of list
- pclmtListMTItem->plmtiPrev=pclmtListMT->plmtiLast;
- pclmtListMTItem->plmtiNext= nullptr;
- pclmtListMT->plmtiLast->plmtiNext=pclmtListMTItem;
- pclmtListMT->plmtiLast=pclmtListMTItem;
- }else{// add the first node to the linked list
- pclmtListMTItem->plmtiPrev= nullptr;
- pclmtListMTItem->plmtiNext= nullptr;
- pclmtListMT->plmtiFirst=pclmtListMTItem;
- pclmtListMT->plmtiLast=pclmtListMTItem;
- }
-
-return(dwRet);
-}
-
-
-__inline DWORD ListMTItemDelete(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem)
-{
- DWORD dwRetErrorCode;
-
- if (pclmtListMTItem->lpListMT==pclmtListMT && pclmtListMT)
- {// Данный элемент принадлежит к этому списку, можно удалить.
- PLIST_MT_ITEM plmtiPrevNode=pclmtListMTItem->plmtiPrev,plmtiNextNode=pclmtListMTItem->plmtiNext;
-
- if (plmtiPrevNode || plmtiNextNode)
- {
- if (plmtiPrevNode && plmtiNextNode == nullptr)
- {// This is the start node in the list to delete
- // отключился последний подключившийся
- plmtiPrevNode->plmtiNext = nullptr;
- pclmtListMT->plmtiLast=plmtiPrevNode;
- }else{
- if (plmtiPrevNode == nullptr && plmtiNextNode)
- {// This is the end node in the list to delete
- // отключился первый подключившийся
- plmtiNextNode->plmtiPrev = nullptr;
- pclmtListMT->plmtiFirst=plmtiNextNode;
- }else{// оключился клиент не первый и не последний
- //if (plmtiPrev && plmtiNext)
- {// Neither start node nor end node in the list
- plmtiPrevNode->plmtiNext=plmtiNextNode;
- plmtiNextNode->plmtiPrev=plmtiPrevNode;
- }
- }
- }
- }else{// This is the only node in the list to delete
- pclmtListMT->plmtiFirst = nullptr;
- pclmtListMT->plmtiLast = nullptr;
- }
-
- pclmtListMTItem->lpListMT = nullptr;
- InterlockedDecrementPointer(&pclmtListMT->nCount);// pclmtListMT->nCount--;
- dwRetErrorCode=NO_ERROR;
- }else{// попытались удалить элемент не относящийся к данному списку
- dwRetErrorCode=ERROR_INVALID_HANDLE;
- }
-return(dwRetErrorCode);
-}
-
-__inline DWORD ListMTItemGetFirst(PCLIST_MT pclmtListMT,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- DWORD dwRetErrorCode;
-
- if (pclmtListMT->plmtiFirst)
- {
- if (pplmtListMTItem) (*pplmtListMTItem)=pclmtListMT->plmtiFirst;
- if (plpData) (*plpData)=pclmtListMT->plmtiFirst->lpData;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
- }
-return(dwRetErrorCode);
-}
-
-__inline BOOL ListMTIteratorMoveFirst(PCLIST_MT pclmtListMT,PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- return((pclmtiIterator->plmtListMTItem=pclmtListMT->plmtiFirst)? TRUE:FALSE);
-}
-
-
-__inline BOOL ListMTIteratorMoveNext(PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- BOOL bRet=FALSE;
-
- if (pclmtiIterator->plmtListMTItem)
- {
- if (pclmtiIterator->plmtListMTItem=pclmtiIterator->plmtListMTItem->plmtiNext) bRet=TRUE;
- }
-return(bRet);
-}
-
-
-__inline DWORD ListMTIteratorGet(PCLIST_MT_ITERATOR pclmtiIterator,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- DWORD dwRetErrorCode;
-
- if (pclmtiIterator->plmtListMTItem)
- {
- if (pplmtListMTItem) (*pplmtListMTItem)=pclmtiIterator->plmtListMTItem;
- if (plpData) (*plpData)=pclmtiIterator->plmtListMTItem->lpData;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
- }
-return(dwRetErrorCode);
-}
-
-#pragma warning(pop)
-#pragma warning(default:4312) // warning C4312: 'type cast' : conversion from 'LONG' to 'PVOID' of greater size
-
-#endif // !defined(AFX_LIST_MT__H__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/MemoryFind.h b/protocols/MRA/src/Sdk/MemoryFind.h
deleted file mode 100644
index f41ea64b6d..0000000000
--- a/protocols/MRA/src/Sdk/MemoryFind.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#if !defined(AFX_MEMORYFIND__H__INCLUDED_)
-#define AFX_MEMORYFIND__H__INCLUDED_
-
-
-#pragma once
-
-__inline void *MemoryFind(size_t dwFrom,const void *pBuff,size_t dwBuffSize,const void *pWhatFind,size_t dwWhatFindSize)
-{
- void *pRet = nullptr;
-
- if (pBuff && dwBuffSize && pWhatFind && dwWhatFindSize && (dwFrom+dwWhatFindSize)<=dwBuffSize)
- {
- if (dwWhatFindSize==1)
- {// MemoryFindByte
- pRet=(void*)memchr((const void*)(((size_t)pBuff)+dwFrom),(*((unsigned char*)pWhatFind)),(dwBuffSize-dwFrom));
- }else{
- void *pCurPos;
-
- pCurPos=(void*)(((size_t)pBuff)+dwFrom);
-
- if ((dwFrom+dwWhatFindSize)==dwBuffSize)
- {
- if (memcmp(pCurPos,pWhatFind,dwWhatFindSize)==0) pRet=pCurPos;
- }else{
- dwBuffSize-=(dwWhatFindSize-1);
-
- while(pCurPos)
- {
- pCurPos=memchr(pCurPos,(*((unsigned char*)pWhatFind)),(dwBuffSize-(((size_t)pCurPos)-((size_t)pBuff))));
- if (pCurPos)
- {
- if (memcmp(pCurPos,pWhatFind,dwWhatFindSize)==0)
- {
- pRet=pCurPos;
- break;
- }else{
- pCurPos=(void*)(((size_t)pCurPos)+1);
- }
- }
- }
- }
- }
- }
-return(pRet);
-}
-
-
-#endif // !defined(AFX_MEMORYFIND__H__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/MemoryFindByte.h b/protocols/MRA/src/Sdk/MemoryFindByte.h
deleted file mode 100644
index 146fd74b30..0000000000
--- a/protocols/MRA/src/Sdk/MemoryFindByte.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
-#define AFX_MEMORYFINDBYTE__H__INCLUDED_
-
-#pragma once
-
-__inline void *MemoryFindByte(size_t dwFrom,const void *pBuff,size_t dwBuffSize,unsigned char chWhatFind)
-{
- void *pRet = nullptr;
-
- if (pBuff && dwBuffSize && dwFrom<dwBuffSize)
- {
- pRet=(void*)memchr((const void*)(((size_t)pBuff)+dwFrom),chWhatFind,(dwBuffSize-dwFrom));
- }
-return(pRet);
-}
-
-
-#endif // !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
diff --git a/protocols/MRA/src/Sdk/RC4.h b/protocols/MRA/src/Sdk/RC4.h
deleted file mode 100644
index 4db7202c0a..0000000000
--- a/protocols/MRA/src/Sdk/RC4.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2007 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_RC4__H__INCLUDED_)
-#define AFX_RC4__H__INCLUDED_
-
-#pragma once
-
-__inline void RC4(LPBYTE lpBuff,size_t dwBuffSize,LPBYTE lpKey,size_t dwKeySize)
-{// RC4
-// www.codeproject.com/cpp/crypt_routine.asp%3Fdf%3D100%26forumid%3D4418%26exp%3D0%26select%3D251879+RC4+c%2B%2B+source+DWORD&hl=ru&gl=ru&ct=clnk&cd=2
-// http://www.thecodeproject.com/cpp/crypt_routine.asp
-// http://forum.ixbt.com/topic.cgi?id=40:3020
-
- //we will consider size of sbox 256 bytes
- //(extra byte are only to prevent any mishep just in case)
- BYTE temp;
- BYTE Sbox[260]={0},Sbox2[260]={0};
- size_t i,j,t,x;
-
- i=j=t=x=0;
- temp=0;
-
- //initialize sbox i
- for(i=0;i<256;i++) Sbox[i]=(BYTE)i;
-
- j=0;
- //whether user has sent any inpur lpKey
- //initialize the sbox2 with user lpKey
- for(i=0;i<256;i++)
- {
- if (j==dwKeySize) j=0;
- Sbox2[i]=lpKey[j++];
- }
-
- j=0; //Initialize j
- //scramble sbox1 with sbox2
- for(i=0;i<256;i++)
- {
- j=(j+(unsigned long)Sbox[i]+(unsigned long)Sbox2[i]) % 256U;
- temp=Sbox[i];
- Sbox[i]=Sbox[j];
- Sbox[j]=temp;
- }
-
- i=j=0;
- for(x=0;x<dwBuffSize;x++)
- {
- //increment i
- i=(i+1U)%256U;
- //increment j
- j=(j+(unsigned long)Sbox[i])%256U;
-
- //Scramble SBox #1 further so encryption routine will
- //will repeat itself at great interval
- temp=Sbox[i];
- Sbox[i]=Sbox[j];
- Sbox[j]=temp;
-
- //Get ready to create pseudo random byte for encryption lpKey
- t=((unsigned long)Sbox[i]+(unsigned long)Sbox[j])%256U;
-
- //get the random byte
- //xor with the data and done
- lpBuff[x]=(lpBuff[x]^Sbox[t]);
- }
-}
-
-
-
-#endif // !defined(AFX_RC4__H__INCLUDED_)
-
-
diff --git a/protocols/MRA/src/Sdk/SHA1.h b/protocols/MRA/src/Sdk/SHA1.h
deleted file mode 100644
index ca78245454..0000000000
--- a/protocols/MRA/src/Sdk/SHA1.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2003 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#if !defined(AFX__SHA1_H__INCLUDED_)
-#define AFX__SHA1_H__INCLUDED_
-
-#pragma once
-
-////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////
-//////////////////////////////RFC 2104//////////////////////////////
-////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////
-
-__inline DWORD BSWAP(DWORD dwIn)
-{
- return((((dwIn<<8) & 0x00ff0000) | (dwIn<<24) | ((dwIn>>8) & 0x0000ff00) | (dwIn>>24)));
-}
-
-__inline void CopyMemoryReverseDWORD(LPCVOID lpcDestination,LPCVOID lpcSource,size_t dwSize)
-{
-#ifdef _WIN64
- BYTE *pDestination=(BYTE*)lpcDestination,*pSource=(BYTE*)lpcSource;
-
- //for(size_t i=0;i<dwSize;i++) pDestination[i]=pSource[(i&~0x00000003)+(3-(i&0x00000003))];
- for(size_t i=0;i<dwSize;i+=4) (*((DWORD*)(pDestination+i)))=BSWAP((*((DWORD*)(pSource+i))));
-
-#else
- __asm{
- push edi // сохраняем регистр
- push esi // сохраняем регистр
-
- mov ecx,dwSize // ecx = длинна входного буффера
- mov edi,lpcDestination // edi = адрес выходного буффера
- mov esi,lpcSource // esi = указатель на входной буффер
- cld
-
- read_loop:
- lodsd // читаем 4 байта
- bswap eax
- stosd
- sub ecx,4
- jg short read_loop // если длинна 3 и более байт, то продолжаем дальше
-
- pop esi // восстанавливаем содержимое регистра
- pop edi // восстанавливаем содержимое регистра
- }
-#endif
-}
-
-////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////
-
-__inline void SHA1GetDigest(LPVOID lpBuff,size_t dwBuffSize,BYTE *digest)
-{
- mir_sha1_ctx sha;
-
- mir_sha1_init(&sha);
- mir_sha1_append(&sha,(BYTE*)lpBuff,(int)dwBuffSize);
- mir_sha1_finish(&sha,digest);
-}
-
-#endif //AFX__SHA1_H__INCLUDED_
diff --git a/protocols/MRA/src/Sdk/StrHexToNum.h b/protocols/MRA/src/Sdk/StrHexToNum.h
deleted file mode 100644
index 3f36d0d4c3..0000000000
--- a/protocols/MRA/src/Sdk/StrHexToNum.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_STRHEXTONUM__H__INCLUDED_)
-#define AFX_STRHEXTONUM__H__INCLUDED_
-
-#pragma once
-
-__inline DWORD StrHexToUNum32(LPCSTR lpcszString,size_t dwStringLen)
-{
- DWORD dwNum=0;
- BYTE bCurentFigure;
-
-
- while(dwStringLen)
- {
- bCurentFigure=(*lpcszString);
- if ('0'<=bCurentFigure && bCurentFigure<='9')
- {
- bCurentFigure-='0';
- }else
- if ('a'<=bCurentFigure && bCurentFigure<='f')
- {
- bCurentFigure-=('a'+10);
- }else
- if ('A'<=bCurentFigure && bCurentFigure<='F')
- {
- bCurentFigure-=('A'+10);
- }else{
- bCurentFigure=255;
- }
-
- if (bCurentFigure!=255)
- {
- dwNum*=16;// сдвигаем предыдущее число на один разряд чтоб добавить в младший разряд новую цифру
- dwNum+=bCurentFigure;// добавляем цифру в младший разряд
- }
- lpcszString++;// перемещаем указатель на следующую позицию
- dwStringLen--;// уменьшаем длинну
- }
-
-return(dwNum);
-}
-
-
-#endif // !defined(AFX_STRHEXTONUM__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/src/Sdk/StrToNum.h b/protocols/MRA/src/Sdk/StrToNum.h
deleted file mode 100644
index ef3a95050e..0000000000
--- a/protocols/MRA/src/Sdk/StrToNum.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2005 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_STRTONUM__H__INCLUDED_)
-#define AFX_STRTONUM__H__INCLUDED_
-
-#pragma once
-
-__inline DWORD StrToUNum32(LPCSTR lpcszString,size_t dwStringLen)
-{
- DWORD dwNum=0;
- BYTE bCurentFigure;
-
-
- while(dwStringLen)
- {
- if ((bCurentFigure=((*lpcszString)-48))<10)
- {
- dwNum*=10;// сдвигаем предыдущее число на один разряд чтоб добавить в младший разряд новую цифру
- dwNum+=bCurentFigure;// добавляем цифру в младший разряд
- }
- lpcszString++;// перемещаем указатель на следующую позицию
- dwStringLen--;// уменьшаем длинну
- }
-
- return(dwNum);
-}
-
-__inline SSIZE_T StrToNum(LPCSTR lpcszString,size_t dwStringLen)
-{
- SSIZE_T lNum=0,lSingn=1;
- BYTE bCurentFigure;
-
- while(dwStringLen && ((bCurentFigure=((*lpcszString)-48))>9))
- {
- if (bCurentFigure=='-') lSingn=-1;
- if (bCurentFigure=='+') lSingn=1;
-
- lpcszString++;// перемещаем указатель на следующую позицию
- dwStringLen--;// уменьшаем длинну
- }
-
- while(dwStringLen)
- {
- if ((bCurentFigure=((*lpcszString)-48))<10)
- {
- lNum*=10;// сдвигаем предыдущее число на один разряд чтоб добавить в младший разряд новую цифру
- lNum+=bCurentFigure;// добавляем цифру в младший разряд
- }
- lpcszString++;// перемещаем указатель на следующую позицию
- dwStringLen--;// уменьшаем длинну
- }
- lNum*=lSingn;
-
- return(lNum);
-}
-
-
-#endif // !defined(AFX_STRTONUM__H__INCLUDED_) \ No newline at end of file
diff --git a/protocols/MRA/src/Sdk/timefuncs.h b/protocols/MRA/src/Sdk/timefuncs.h
deleted file mode 100644
index 0bff545803..0000000000
--- a/protocols/MRA/src/Sdk/timefuncs.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2009 Rozhuk Ivan <rozhuk.im@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-
-#if !defined(AFX_TIME_FUNCS__H__INCLUDED_)
-#define AFX_TIME_FUNCS__H__INCLUDED_
-
-#pragma once
-
-#include <windows.h>
-#include <time.h>
-
-
-
-#define _MAX__TIME32_T 0x7fffd27f // number of seconds from
- // 00:00:00, 01/01/1970 UTC to
- // 23:59:59, 01/18/2038 UTC
-
-// Number of 100 nanosecond units from 1/1/1601 to 1/1/1970
-#define EPOCH_BIAS 116444736000000000i64
-
-//nion to facilitate converting from FILETIME to unsigned __int64
-typedef union {
- unsigned __int64 ft_scalar;
- FILETIME ft_struct;
- } FT;
-
-
-inline __time32_t _time32(__time32_t *timeptr)
-{
- __time64_t tim;
- FT nt_time;
-
- GetSystemTimeAsFileTime(&(nt_time.ft_struct));
- tim=(__time64_t)((nt_time.ft_scalar-EPOCH_BIAS)/10000000i64);
- if (tim > (__time64_t)(_MAX__TIME32_T)) tim=(__time64_t)(-1);
- if (timeptr) *timeptr = (__time32_t)(tim);// store time if requested
-
-return(__time32_t)(tim);
-}
-
-
-inline __time32_t MakeTime32FromLocalSystemTime(CONST PSYSTEMTIME pcstSystemTime)
-{
- __time64_t tim=0;
- FT nt_time;
-
- if (SystemTimeToFileTime(pcstSystemTime,&(nt_time.ft_struct)))
- {
- if (LocalFileTimeToFileTime(&(nt_time.ft_struct),&(nt_time.ft_struct)))
- {
- tim=(__time64_t)((nt_time.ft_scalar-EPOCH_BIAS)/10000000i64);
- if (tim > (__time64_t)(_MAX__TIME32_T)) tim=(__time64_t)(-1);
- }
- }
-return(__time32_t)(tim);
-}
-
-
-inline BOOL MakeLocalSystemTimeFromTime32(__time32_t tim32,PSYSTEMTIME pstSystemTime)
-{
- BOOL bRet=FALSE;
-
- if (pstSystemTime)
- {
- __time64_t tim=(__time64_t)tim32;
- FT nt_time;
-
- //if (tim==(__time64_t)(-1)) tim=(__time64_t)(_MAX__TIME32_T);
- nt_time.ft_scalar=(__time64_t)((tim*10000000i64)+EPOCH_BIAS);
- if (FileTimeToLocalFileTime(&(nt_time.ft_struct),&(nt_time.ft_struct)))
- {
- bRet=FileTimeToSystemTime(&(nt_time.ft_struct),pstSystemTime);
- }
- }
-return(bRet);
-}
-
-
-#endif // !defined(AFX_TIME_FUNCS__H__INCLUDED_)