diff --git a/250mS@1000Hz.wav b/250mS@1000Hz.wav deleted file mode 100644 index 0079795..0000000 Binary files a/250mS@1000Hz.wav and /dev/null differ diff --git a/250mS@600Hz.wav b/250mS@600Hz.wav deleted file mode 100644 index 3480a76..0000000 Binary files a/250mS@600Hz.wav and /dev/null differ diff --git a/AGWAPI.c b/AGWAPI.c index e84a1d1..0f2d86c 100644 --- a/AGWAPI.c +++ b/AGWAPI.c @@ -36,14 +36,14 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses struct AGWHeader { - int Port; + unsigned int Port; unsigned char DataKind; unsigned char filler2; unsigned char PID; unsigned char filler3; unsigned char callfrom[10]; unsigned char callto[10]; - int DataLength; + unsigned int DataLength; int reserved; }; @@ -1063,6 +1063,8 @@ int AGWDataSocket_Read(struct AGWSocketConnectionInfo * sockptr, SOCKET sock) { if (DataLength > 35)// A header { + struct AGWHeader * AGW = &sockptr->AGWRXHeader; + i=recv(sock,(char *)&sockptr->AGWRXHeader, 36, 0); if (i == SOCKET_ERROR) @@ -1075,6 +1077,16 @@ int AGWDataSocket_Read(struct AGWSocketConnectionInfo * sockptr, SOCKET sock) sockptr->MsgDataLength = sockptr->AGWRXHeader.DataLength; + // Validate packet to protect against accidental (or malicious!) connects from a non-agw application + + + if (AGW->Port > 64 || AGW->filler2 != 0 || AGW->filler3 != 0 || AGW->DataLength > 400) + { + Debugprintf("Corrupt AGW Packet Received"); + AGWDataSocket_Disconnect(sockptr); + return 0; + } + if (sockptr->MsgDataLength > 500) OutputDebugString("Corrupt AGW message"); diff --git a/AGWMon.asm b/AGWMon.asm deleted file mode 100644 index 8d51a3c..0000000 --- a/AGWMon.asm +++ /dev/null @@ -1,1646 +0,0 @@ - PAGE 56,132 -; - -.386 -; -; SEGMENT definitions and order -; - - -;* 32 Bit code -_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE' -_TEXT ENDS - - - -;* Contains 32 Bit data -_DATA SEGMENT DWORD PUBLIC 'DATA' -_DATA ENDS - - - ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:FLAT - - -OFFSET32 EQU - -_DATA SEGMENT - - -CR EQU 0DH -LF EQU 0AH - - -D10 DW 10 -D60 DD 60 -D3600 DD 3600 -D86400 DD 86400 - -TIMESTAMP DD 0 - -NEWVALUE DW 0 -WORD10 DW 10 -WORD16 DW 16 - - - -; -; BASIC LINK LEVEL MESSAGE BUFFER LAYOUT -; -MESSAGE STRUC - -MSGCHAIN DD ? ; CHAIN WORD -MSGPORT DB ? ; PORT -MSGLENGTH DW ? ; LENGTH - -MSGDEST DB 7 DUP (?) ; DESTINATION -MSGORIGIN DB 7 DUP (?) ; ORIGIN -; -; MAY BE UP TO 56 BYTES OF DIGIS -; -MSGCONTROL DB ? ; CONTROL BYTE -MSGPID DB ? ; PROTOCOL IDENTIFIER -MSGDATA DB ? ; START OF LEVEL 2 MESSAGE -; -MESSAGE ENDS -; -; -; -; L4FLAGS DEFINITION -; -L4BUSY EQU 80H ; BNA - DONT SEND ANY MORE -L4NAK EQU 40H ; NEGATIVE RESPONSE FLAG -L4MORE EQU 20H ; MORE DATA FOLLOWS - FRAGMENTATION FLAG - -L4CREQ EQU 1 ; CONNECT REQUEST -L4CACK EQU 2 ; CONNECT ACK -L4DREQ EQU 3 ; DISCONNECT REQUEST -L4DACK EQU 4 ; DISCONNECT ACK -L4INFO EQU 5 ; INFORMATION -L4IACK EQU 6 ; INFORMATION ACK -; - - -NULL EQU 00H -CR EQU 0DH -LF EQU 0AH -NETROM_PID EQU 0CFH -NODES_SIG EQU 0FFH -; -PORT_MSG DB ' Port=',NULL -NODES_MSG DB ' (NetRom Routing)',CR,NULL -NETROM_MSG DB ' NET/ROM',CR,' ',NULL -TO_MSG DB ' To ',NULL -TTL_MSG DB ' ttl=',NULL -AT_MSG DB ' at ',NULL -VIA_MSG DB ' via ',NULL -QUALITY_MSG DB ' qlty=',NULL -LEN_MSG DB ' Len=',0 - -PID_MSG DB ' pid=',NULL - -MYCCT_MSG DB ' my' -CCT_MSG DB ' cct=',0 -TIM_MSG DB ' t/o=',0 - -WINDOW DB ' w=',0 -CONN_REQ_MSG DB ' ',NULL -CONN_ACK_MSG DB ' ',NULL -CONN_NAK_MSG DB ' - BUSY',NULL -DISC_REQ_MSG DB ' ',NULL -DISC_ACK_MSG DB ' ',NULL -INFO_MSG DB ' ',NULL -IP_MSG DB ' ',NULL - -SABM_MSG DB 'SABM ',NULL -DISC_MSG DB 'DISC ',NULL -UA_MSG DB 'UA ',NULL -DM_MSG DB 'DM ',NULL -RR_MSG DB 'RR ',NULL -RNR_MSG DB 'RNR ',NULL -UI_MSG DB 'UI',NULL -FRMR_MSG DB 'FRMR ',NULL -REJ_MSG DB 'REJ ',NULL -; -; IP AND TCP BITS -; -IPMSG STRUC -; -; FORMAT OF IP HEADER -; -; NOTE THESE FIELDS ARE STORED HI ORDER BYTE FIRST (NOT NORMAL 8086 FORMAT) -; - -VERLEN DB 0 ; 4 BITS VERSION, 4 BITS LENGTH -TOS DB 0 ; TYPE OF SERVICE -IPLENGTH DW 0 ; DATAGRAM LENGTH -IPID DW 0 ; IDENTIFICATION -FRAGWORD DW 0 ; 3 BITS FLAGS, 13 BITS OFFSET -IPTTL DB 0 -IPPROTOCOL DB 0 ; HIGHER LEVEL PROTOCOL -IPCHECKSUM DW 0 ; HEADER CHECKSUM -IPSOURCE DD 0 -IPDEST DD 0 -; -; FORMAT OF TCP HEADER WITHIN AN IP DATAGRAM -; -; NOTE THESE FIELDS ARE STORED HI ORDER BYTE FIRST (NOT NORMAL 8086 FORMAT) -; - -SOURCEPORT DW 0 -DESTPORT DW 0 - -SEQNUM DD 0 -ACKNUM DD 0 - -TCPCONTROL DB 0 ; 4 BITS DATA OFFSET 4 RESERVED -TCPFLAGS DB 0 ; (2 RESERVED) URG ACK PSH RST SYN FIN - -TCPWINDOW DW 0 -CHECKSUM DW 0 -URGPTR DW 0 -; -; OPTIONS AND/OR DATA MAY FOLLOW -; -TCPOPTIONS DB 4 DUP (0) - -IPMSG ENDS -; -; TCPFLAGS BITS -; -FIN EQU 1B -SYN EQU 10B -RST EQU 100B -PSH EQU 1000B -ACK EQU 10000B -URG EQU 100000B - - -TCP DB 'TCP: ',0 -ICMP DB 'ICMP: ',0 -LEN DB ' LEN: ',0 - -SEQTEXT DB ' SEQ: ',0 -ACKTEXT DB 'ACK: ',0 -WINDTEXT DB 'WIN: ',0 -SYNTEXT DB 'SYN ',0 -FINTEXT DB 'FIN ',0 -RSTTEXT DB 'RST ',0 -PSHTEXT DB 'PSH ',0 -ACKTEXT1 DB 'ACK ',0 -URGTEXT DB 'URG ',0 - -BADSUM DB ' CHECKSUM ERROR ',0 - -;-----------------------------------------------------------------------------; -; Parameter area for received frame ; -;-----------------------------------------------------------------------------; - -PORT_NO DB 0 ; Received port number 0 - 256 -VERSION_NO DB 0 ; Version 1 or 2 1,2 -POLL_FINAL DB 0 ; Poll or Final ? P,F -COMM_RESP DB 0 ; Command or Response C,R -FRAME_TYPE DB 0 ; Frame Type UI etc in Hex -PID DB 0 ; Protocol ID -FRAME_LENGTH DD 0 ; Length of frame 0 - 65... -NR DB 0 ; N(R) Flag -NS DB 0 ; N(S) Flag -INFO_FLAG DB 0 ; Information Packet ? 0 No, 1 Yes -OPCODE DB 0 ; L4 FRAME TYPE -FRMRFLAG DB 0 - -TRACEFLAG DB 1 -MALL DB 1 -HEADERLN DB 1 -MCOM DB 1 -MTX DB 1 -MMASK DW 0FFFFH -; -; HDLC COMMANDS (WITHOUT P/F) -; -UI EQU 3 -SABM EQU 2FH -DISC EQU 43H -DM EQU 0FH -UA EQU 63H -FRMR EQU 87H -RR EQU 1 -RNR EQU 5 -REJ EQU 9 -; -PFBIT EQU 10H ; POLL/FINAL BIT IN CONTROL BYTE - - -CRLF DB 0DH,0AH - -AX25CALL DB 7 DUP (0) ; WORK AREA FOR AX25 <> NORMAL CALL CONVERSION -NORMCALL DB 10 DUP (0) ; CALLSIGN IN NORMAL FORMAT -NORMLEN DD 0 ; LENGTH OF CALL IN NORMCALL -; -TENK DD 10000 - DD 1000 -WORD100 DD 100 -DWORD10 DD 10 -; -ACCUM DB 4 DUP (0) -CONVFLAG DB 0 -SUPPRESS DB 0 ; ZERO SUPPRESS FLAG - -SAVESI DD 0 -SAVEDI DD 0 - -_DATA ENDS - -; 2:Fm GM8BPQ-2 To NODES [18:49:56] -;FF BPQ (NetRom Routing) -; N5IN-9 N9 N5IN-3 152 -; GB7CB GALA N5IN-3 151 -; 1:Fm GM8BPQ To APU25N [18:51:48] -;=5828.55N/00612.62W- {UIV32} - -; 1:Fm GM8BPQ-1 To BPQ [09:09:51] - -_TEXT SEGMENT PUBLIC 'CODE' - - PUBLIC _AGWMONDECODE,_AGWMONOPTIONS - -_AGWMONOPTIONS: - - MOV MMASK,AX - MOV MTX,BL - MOV MCOM,CL - - RET - -_AGWMONDECODE: -; -; esi=message, edi=buffer, return length in ECX amd frame type in EAX -; - - MOV SAVESI,ESI - MOV SAVEDI,EDI - - MOV TIMESTAMP,EAX - - cmp TRACEFLAG,0 - jne TRACEOK - - -TRACERET: - - ret - -TRACEOK: - - MOVZX ECX,MSGLENGTH[ESI] -; -; GET THE CONTROL BYTE, TO SEE IF THIS FRAME IS TO BE DISPLAYED -; - PUSH ESI - MOV ECX,9 ; MAX DIGIS + 1 -CTRLLOOP: - TEST BYTE PTR MSGCONTROL-1[ESI],1 - JNZ CTRLFOUND - - ADD ESI,7 - LOOP CTRLLOOP -; -; INVALID FRAME -; - POP ESI - MOV ECX,0 - RET - -CTRLFOUND: - - MOV AL,MSGCONTROL[ESI] - POP ESI -; - TEST AL,1 ; I FRAME - JZ IFRAME - - AND AL,NOT PFBIT ; CLEAR P/F - CMP AL,3 ; UI - JE OKTOTRACE ; ALWAYS DO UI - - CMP AL,FRMR - JE OKTOTRACE ; ALWAYS DO FRMR - -; -; USEQ/CONTROL - TRACE IF MCOM ON -; - CMP MCOM,0 - JNE OKTOTRACE - - MOV ECX,0 - RET - -;-----------------------------------------------------------------------------; -; Check for MALL ; -;-----------------------------------------------------------------------------; - -IFRAME: - - cmp MALL,0 - jne OKTOTRACE - - MOV ECX,0 - ret - -OKTOTRACE: -; -;-----------------------------------------------------------------------------; -; Get the port number of the received frame ; -;-----------------------------------------------------------------------------; - - mov CL,MSGPORT[ESI] - mov PORT_NO,CL - - TEST CL,80H - JZ NOT_TX -; -; TRANSMITTED FRAME - SEE IF MTX ON -; - CMP MTX,1 - JE NOT_TX - - MOV ECX,0 - RET - -NOT_TX: - - AND CL,7FH ; MASK T/R BIT - - DEC CL - MOV AX,1 - SHL AX,CL ; SHIFT BIT UP - - TEST MMASK,AX - JNZ TRACEOK1 - - MOV ECX,0 - RET - -TRACEOK1: - - MOV FRMRFLAG,0 - - mov AH,MSGDEST+6[ESI] - mov AL,MSGORIGIN+6[ESI] - - mov COMM_RESP,0 ; Clear Command/Response Flag - -;-----------------------------------------------------------------------------; -; Is it a Poll/Final or Command/Response ; -;-----------------------------------------------------------------------------; - - test AH,80H - mov COMM_RESP,'C' - jnz NOT_RESPONSE - mov COMM_RESP,'R' - -NOT_RESPONSE: - -;-----------------------------------------------------------------------------; -; Is this version 1 or 2 of AX25 ? ; -;-----------------------------------------------------------------------------; - - xor AH,AL - test AH,80H - mov VERSION_NO,1 - je VERSION_1 - mov VERSION_NO,2 - -VERSION_1: - - - mov al,PORT_NO - and al,7fh - - - cmp AL,10 - JAE @F - - PUSH EAX - - MOV AL,' ' - CALL PUTCHAR - - POP EAX -@@: - call DISPLAY_BYTE_1 - - MOV AL,':' - - CALL PUTCHAR - - MOV AL,'F' - CALL PUTCHAR - - MOV AL,'m' - CALL PUTCHAR - - MOV AL,' ' - CALL PUTCHAR - -;-----------------------------------------------------------------------------; -; Display Origin Callsign ; -;-----------------------------------------------------------------------------; - - PUSH ESI - - lea ESI,MSGORIGIN[ESI] - call CONVFROMAX25 - - mov ESI,OFFSET NORMCALL - call DISPADDR - - POP ESI - - PUSH ESI - - mov EBX,OFFSET TO_MSG - call NORMSTR - -;-----------------------------------------------------------------------------; -; Display Destination Callsign ; -;-----------------------------------------------------------------------------; - - lea ESI,MSGDEST[ESI] - call CONVFROMAX25 - - mov ESI,OFFSET NORMCALL - call DISPADDR - - pop ESI - - movzx EAX,MSGLENGTH[ESI] - mov FRAME_LENGTH,EAX - mov CX,8 ; Max number of digi-peaters - -;-----------------------------------------------------------------------------; -; Display any Digi-Peaters ; -;-----------------------------------------------------------------------------; - -NEXT_DIGI: - - test MSGORIGIN+6[ESI],1 - jnz NO_MORE_DIGIS - - add ESI,7 - sub FRAME_LENGTH,7 ; Reduce length - - push ESI - - push ECX - lea ESI,MSGORIGIN[ESI] - call CONVFROMAX25 ; Convert to call - - push EAX ; Last byte is in AH - - mov AL,',' - call PUTCHAR - - mov ESI,OFFSET NORMCALL - call DISPADDR - - pop EAX - - test AH,80H - jz NOT_REPEATED - - mov AL,'*' - call PUTCHAR - -NOT_REPEATED: - - pop ECX - pop ESI - loop NEXT_DIGI - -NO_MORE_DIGIS: - - MOV AL,' ' - CALL PUTCHAR - -;-----------------------------------------------------------------------------; -; If this is Version 2 get the Poll/Final Bit ; -;-----------------------------------------------------------------------------; - - mov POLL_FINAL,0 ; Clear Poll/Final Flag - - mov AL,MSGCONTROL[ESI] ; Get control byte - - cmp COMM_RESP,'C' - jne NOT_COMM - - test AL,PFBIT - je NOT_POLL - - mov POLL_FINAL,'P' - -NOT_POLL: -NOT_COMM: - - cmp COMM_RESP,'R' - jne NOT_RESP - - test AL,PFBIT - je NOT_FINAL - - mov POLL_FINAL,'F' - -NOT_FINAL: -NOT_RESP: - -;-----------------------------------------------------------------------------; -; Start displaying the frame information ; -;-----------------------------------------------------------------------------; - - and AL,NOT PFBIT ; Remove P/F bit - mov FRAME_TYPE,AL - - mov AL,'<' ; Print "<" - call PUTCHAR - - mov NR,0 ; Reset all the flags - mov NS,0 - mov INFO_FLAG,0 - - mov AL,FRAME_TYPE - - test AL,1 - jne NOT_I_FRAME - -;-----------------------------------------------------------------------------; -; Information frame ; -;-----------------------------------------------------------------------------; - - mov AL,'I' - call PUTCHAR - mov AL,' ' - call PUTCHAR - - mov INFO_FLAG,1 - mov NR,1 - mov NS,1 - jmp END_OF_TYPE - -NOT_I_FRAME: - -;-----------------------------------------------------------------------------; -; Un-numbered Information Frame ; -;-----------------------------------------------------------------------------; - - cmp AL,UI - jne NOT_UI_FRAME - - mov EBX,OFFSET UI_MSG - call NORMSTR - - mov INFO_FLAG,1 - jmp END_OF_TYPE - -NOT_UI_FRAME: - test AL,10B - jne NOT_R_FRAME - -;-----------------------------------------------------------------------------; -; Process supervisory frames ; -;-----------------------------------------------------------------------------; - - mov NR,1 ; All supervisory frames have N(R) - - and AL,0FH ; Mask the interesting bits - cmp AL,RR - jne NOT_RR_FRAME - - mov EBX,OFFSET RR_MSG - call NORMSTR - jmp END_OF_TYPE - -NOT_RR_FRAME: - cmp AL,RNR - jne NOT_RNR_FRAME - - mov EBX,OFFSET RNR_MSG - call NORMSTR - jmp END_OF_TYPE - -NOT_RNR_FRAME: - cmp AL,REJ - jne NOT_REJ_FRAME - - mov EBX,OFFSET REJ_MSG - call NORMSTR - jmp END_OF_TYPE - -NOT_REJ_FRAME: - mov NR,0 ; Don't display sequence number - mov AL,'?' ; Print "?" - call PUTCHAR - jmp END_OF_TYPE - -;-----------------------------------------------------------------------------; -; Process all other frame types ; -;-----------------------------------------------------------------------------; - -NOT_R_FRAME: - cmp AL,UA - jne NOT_UA_FRAME - - mov EBX,OFFSET UA_MSG - call NORMSTR - jmp SHORT END_OF_TYPE - -NOT_UA_FRAME: - cmp AL,DM - jne NOT_DM_FRAME - - mov EBX,OFFSET DM_MSG - call NORMSTR - jmp SHORT END_OF_TYPE - -NOT_DM_FRAME: - cmp AL,SABM - jne NOT_SABM_FRAME - - mov EBX,OFFSET SABM_MSG - call NORMSTR - - jmp SHORT END_OF_TYPE - -NOT_SABM_FRAME: - cmp AL,DISC - jne NOT_DISC_FRAME - - mov EBX,OFFSET DISC_MSG - call NORMSTR - - jmp SHORT END_OF_TYPE - -NOT_DISC_FRAME: - cmp AL,FRMR - jne NOT_FRMR_FRAME - - mov EBX,OFFSET FRMR_MSG - call NORMSTR - MOV FRMRFLAG,1 - jmp SHORT END_OF_TYPE - -NOT_FRMR_FRAME: - mov AL,'?' - call PUTCHAR - -END_OF_TYPE: - -;----------------------------------------------------------------------------; -; If Version 2 Then display P/F C/R Information ; -;----------------------------------------------------------------------------; - - IF 0 - - cmp VERSION_NO,2 - jne NOT_VERSION_2 - - mov AL,' ' - call PUTCHAR - - mov AL,COMM_RESP ; Print Command/Response Flag - call PUTCHAR - - ENDIF - - cmp POLL_FINAL,0 - je NO_POLL_FINAL - - - mov AL,POLL_FINAL ; Print Poll/Final Flag if Set - call PUTCHAR - - mov AL,' ' - call PUTCHAR - -NO_POLL_FINAL: -NOT_VERSION_2: - - -;----------------------------------------------------------------------------; -; Display sequence numbers if applicable ; -;----------------------------------------------------------------------------; - - cmp NR,1 - jne NOT_NR_DATA - - - mov AL,'R' - call PUTCHAR - - mov AL,FRAME_TYPE - rol AL,1 - rol AL,1 - rol AL,1 - - call DISPLAYSEQ - - mov AL,' ' - call PUTCHAR - -NOT_NR_DATA: - - cmp NS,1 - jne NOT_NS_DATA - - mov AL,'S' - call PUTCHAR - - mov AL,FRAME_TYPE - ror AL,1 - - call DISPLAYSEQ - -NOT_NS_DATA: - - CMP INFO_FLAG,1 - JNE NO_PID_LEN - - - mov EBX,OFFSET PID_MSG - call NORMSTR - - PUSH ESI - lea ESI,MSGPID[ESI] - lodsb - POP ESI - - CALL HEXOUT - - mov EBX,OFFSET LEN_MSG - call NORMSTR - - MOV EAX,FRAME_LENGTH - SUB EAX,23 - - CALL DISPLAY_BYTE_1 - - mov AL,' ' - call PUTCHAR - -NO_PID_LEN: - - mov AL,'>' - call PUTCHAR - - mov AL,'[' - call PUTCHAR - -; -; DISPLAY TIMESTAMP -; - - MOV EAX,TIMESTAMP - mov EDX,0 - DIV D86400 - - MOV EAX,EDX - MOV edx,0 - DIV D3600 - - CALL DISPLAY_BYTE_2 - - MOV AL,':' - CALL PUTCHAR - - MOV EAX,EDX - MOV EDX,0 - DIV D60 ; MINS IN AX, SECS IN DX - - PUSH DX - - CALL DISPLAY_BYTE_2 - - MOV AL,':' - CALL PUTCHAR - - POP AX ; SECS - CALL DISPLAY_BYTE_2 - - - mov AL,']' - call PUTCHAR - - - CMP FRMRFLAG,0 - JE NOTFRMR -; -; DISPLAY FRMR BYTES -; - lea ESI,MSGPID[ESI] - MOV ECX,3 ; TESTING -FRMRLOOP: - lodsb - CALL BYTE_TO_HEX - - LOOP FRMRLOOP - - JMP NO_INFO - -NOTFRMR: -;----------------------------------------------------------------------------; -; Find the PID if an information frame ; -;----------------------------------------------------------------------------; - - mov AL,0 - - cmp INFO_FLAG,1 - jne NO_PID - - lea ESI,MSGPID[ESI] - lodsb - -NO_PID: - mov PID,AL - -;----------------------------------------------------------------------------; -; Is this a NET/ROM message of any sort ? ; -;----------------------------------------------------------------------------; - - MOV ECX,FRAME_LENGTH - - cmp PID,NETROM_PID - je DISPLAY_NETROM - -;----------------------------------------------------------------------------; -; Display the rest of the frame (If Any) ; -;----------------------------------------------------------------------------; - -DISPLAY_INFO: - - cmp INFO_FLAG,1 ; Is it an information packet ? - jne NO_INFO - - - XOR AL,AL ; IN CASE EMPTY - - sub ECX,23 - JCXZ NO_INFO ; EMPTY I FRAME -; -; PUT TEXT ON A NEW LINE -; - PUSH ECX - MOV AL,0DH - PUSH ESI - CALL PUTCHAR - POP ESI - POP ECX - -SAMELN: - - cmp ECX,257 - jb LENGTH_OK - - mov ECX,256 - -LENGTH_OK: - - push ECX - lodsb - - cmp AL,0AH - JE MONOK - CMP AL,0DH - JE MONOK - - CMP AL,20H - JB SKIP_MON ; IGNORE OTHER CONTROLS - -MONOK: - call PUTCHAR - -SKIP_MON: - - pop ECX - loop LENGTH_OK - -NO_INFO: -; -; ADD CR UNLESS DATA ALREADY HAS ONE -; - CMP AL,CR - JE NOTANOTHER -ADD_CR: - mov AL,CR - call PUTCHAR - -NOTANOTHER: -; - MOV ECX,EDI - SUB ECX,SAVEDI - - MOVZX EAX,FRAME_TYPE - - RET - - -;----------------------------------------------------------------------------; -; Display NET/ROM data ; -;----------------------------------------------------------------------------; - -DISPLAY_NETROM: - - MOV AL,CR - CALL PUTCHAR - - lodsb - PUSH EAX - CALL HEXOUT - - mov AL,' ' - call PUTCHAR - - POP EAX - - cmp AL,NODES_SIG ; Check NODES message - - JNE DISPLAY_NETROM_DATA - - cmp FRAME_TYPE, 3 - JNE DISPLAY_NETROM_DATA ; Not UI, so INP3 - -;----------------------------------------------------------------------------; -; Display NODES broadcast ; -;----------------------------------------------------------------------------; - - push ECX - - mov ECX,6 - REP MOVSB ; ALIAS - - mov EBX,OFFSET NODES_MSG - call NORMSTR - - pop ECX - - sub ECX,30 ; Header, mnemonic and signature length - -NODES_LOOP: - - cmp ECX,0 - jbe NO_INFO - - push ECX - push ESI ; Global push for each node - - mov AL,' ' - call PUTCHAR - mov AL,' ' - call PUTCHAR - - push ESI - - add ESI,7 ; Display destination mnemonic - - cmp BYTE PTR [ESI],' ' - je NO_MNEMONIC - - mov ECX,6 ; Max length - -MNEMONIC_LOOP: - - lodsb ; Get character - - cmp AL,' ' ; Short mnemonic ? - je END_MNEMONIC - - call PUTCHAR - - loop MNEMONIC_LOOP - -END_MNEMONIC: - - mov AL,':' - call PUTCHAR - -NO_MNEMONIC: - - pop ESI - push ESI - - call CONVFROMAX25 ; Display dest callsign - mov ESI,OFFSET NORMCALL - call DISPADDR - - mov EBX,OFFSET VIA_MSG - call NORMSTR - - pop ESI - add ESI,13 ; Point to neighbour callsign - push ESI - - call CONVFROMAX25 - mov ESI,OFFSET NORMCALL - call DISPADDR - - mov EBX,OFFSET QUALITY_MSG - call NORMSTR - - pop ESI - add ESI,7 ; Point to quality byte - - mov AL,[ESI] - call DISPLAY_BYTE_1 - - mov AL,CR - call PUTCHAR - - pop ESI - pop ECX - add ESI,21 ; Point to next destination - sub ECX,21 ; Remove length of each - - jmp NODES_LOOP - -;----------------------------------------------------------------------------; -; Display normal NET/ROM transmissions ; -;----------------------------------------------------------------------------; - -DISPLAY_NETROM_DATA: - - DEC ESI ; BACK TO DATA - - mov EBX,OFFSET NETROM_MSG - call NORMSTR - - PUSH ESI - - call CONVFROMAX25 - mov ESI,OFFSET NORMCALL - call DISPADDR - - mov EBX,OFFSET TO_MSG - call NORMSTR - - pop ESI - add ESI,7 - - push ESI - - call CONVFROMAX25 - mov ESI,OFFSET NORMCALL - call DISPADDR -; -; Display Time To Live number -; - mov EBX,OFFSET TTL_MSG - call NORMSTR - - pop ESI - add ESI,7 ; Point to TTL counter - - lodsb - call DISPLAY_BYTE_1 - -; -; DISPLAY CIRCUIT ID -; - MOV EBX,OFFSET CCT_MSG - CALL NORMSTR - - LODSB - CALL BYTE_TO_HEX - - LODSB - CALL BYTE_TO_HEX - - INC ESI - INC ESI ; TO OPCODE - -;-----------------------------------------------------------------------------; -; Determine type of Level 4 frame ; -;-----------------------------------------------------------------------------; - - mov AL,[ESI] - MOV OPCODE,AL ; SAVE - AND AL,0FH ; Strip off flags - - cmp AL,L4CREQ - jne NOT_L4CREQ - - mov EBX,OFFSET CONN_REQ_MSG - call NORMSTR - - MOV EBX,OFFSET WINDOW - CALL NORMSTR - - INC ESI - LODSB ; WINDOW SIZE - - CALL DISPLAY_BYTE_1 - - mov AL,' ' - call PUTCHAR - - PUSH ESI - - call CONVFROMAX25 - mov ESI,OFFSET NORMCALL - call DISPADDR - - mov EBX,OFFSET AT_MSG - call NORMSTR - - pop ESI - add ESI,7 - PUSH ESI - - call CONVFROMAX25 - mov ESI,OFFSET NORMCALL - call DISPADDR - - - POP ESI - CMP FRAME_LENGTH,58 - JE NOT_BPQ -; -; BPQ EXTENDED CON REQ - DISPLAY TIMEOUT -; - MOV EBX,OFFSET TIM_MSG - CALL NORMSTR - - MOV AX,7[ESI] ; TIMEOUT - - CALL DISPLAY_BYTE_1 -; -NOT_BPQ: - - JMP ADD_CR - -NOT_L4CREQ: - - cmp AL,L4CACK - jne NOT_L4CACK - - TEST OPCODE,L4BUSY - JZ L4CRQ00 -; -; BUSY RETURNED -; - MOV EBX,OFFSET CONN_NAK_MSG - CALL NORMSTR - - JMP END_NETROM - -L4CRQ00: - - MOV EBX,OFFSET CONN_ACK_MSG - CALL NORMSTR - - MOV EBX,OFFSET WINDOW - CALL NORMSTR - - MOV AL,1[ESI] ; WINDOW SIZE - - CALL DISPLAY_BYTE_1 - - MOV EBX,OFFSET MYCCT_MSG - CALL NORMSTR - - MOV AL,-2[ESI] - CALL BYTE_TO_HEX - - MOV AL,-1[ESI] - CALL BYTE_TO_HEX - - JMP ADD_CR - -NOT_L4CACK: - - cmp AL,L4DREQ - jne NOT_L4DREQ - - mov EBX,OFFSET DISC_REQ_MSG - call NORMSTR - - JMP ADD_CR - -NOT_L4DREQ: - - cmp AL,L4DACK - jne NOT_L4DACK - - mov EBX,OFFSET DISC_ACK_MSG - call NORMSTR - - jmp add_cr - -NOT_L4DACK: - - cmp AL,L4INFO - jne NOT_L4INFO - - mov EBX,OFFSET INFO_MSG - call NORMSTR - - mov AL,-2[ESI] ; Get send sequence number - call DISPLAY_BYTE_1 - - mov AL,' ' - call PUTCHAR - mov AL,'R' - call PUTCHAR - - mov AL,-1[ESI] ; Get receive sequence number - call DISPLAY_BYTE_1 - - mov AL,'>' - call PUTCHAR - - INC ESI ; TO DATA - MOV ECX,FRAME_LENGTH - sub ECX,20 - - CALL DOL4FLAGS - - jmp DISPLAY_INFO - - -NOT_L4INFO: - - cmp AL,L4IACK - jne NOT_L4IACK - - mov EBX,OFFSET INFO_ACK_MSG - call NORMSTR - - mov AL,-1[ESI] ; Get receive sequence number - call DISPLAY_BYTE_1 - - mov AL,'>' - call PUTCHAR - - CALL DOL4FLAGS - - JMP SHORT END_NETROM - -NOT_L4IACK: - - OR AL,AL - JNZ NOTIP -; -; TCP/IP DATAGRAM -; - mov EBX,OFFSET IP_MSG - call NORMSTR -; - INC ESI ; NOW POINTING TO IP HEADER -; - PUSH ESI - - LEA ESI,IPSOURCE[ESI] - CALL PRINT4 ; PRINT IF ADDR IN 'DOTTED DECIMAL' FORMAT - - POP ESI - - MOV AL,'>' - CALL PUTCHAR - - PUSH ESI - - LEA ESI,IPDEST[ESI] - CALL PRINT4 ; PRINT IF ADDR IN 'DOTTED DECIMAL' FORMAT - - MOV EBX,OFFSET LEN - CALL NORMSTR - - POP ESI - - MOV AL,BYTE PTR IPLENGTH[ESI] - CALL BYTE_TO_HEX - - MOV AL,BYTE PTR IPLENGTH+1[ESI] - CALL BYTE_TO_HEX - - MOV AL,20H - CALL PUTCHAR - - MOV AL,IPPROTOCOL[ESI] - CALL DISPLAY_BYTE_1 ; DISPLAY PROTOCOL TYPE - -; mov AL,CR -; call PUTCHAR -; -; MOV ECX,39 ; TESTING -;IPLOOP: -; lodsb -; CALL BYTE_TO_HEX -; -; LOOP IPLOOP - - JMP ADD_CR - -NOTIP: - - mov EBX,OFFSET DUFF_NET_MSG - call NORMSTR - - -END_NETROM: - - jmp add_cr - -DOL4FLAGS: -; -; DISPLAY BUSY/NAK/MORE FLAGS -; - TEST OPCODE,L4BUSY - JZ L4F010 - - MOV AL,'B' - CALL PUTCHAR -L4F010: - TEST OPCODE,L4NAK - JZ L4F020 - - MOV AL,'N' - CALL PUTCHAR -L4F020: - TEST OPCODE,L4MORE - JZ L4F030 - - MOV AL,'M' - CALL PUTCHAR -L4F030: - RET - -;----------------------------------------------------------------------------; -; Display ASCIIZ strings ; -;----------------------------------------------------------------------------; - -NORMSTR: - MOV AL,[EBX] - INC EBX - cmp AL,NULL ; End of String ? - je NORMSTR_RET ; Yes - call PUTCHAR - jmp SHORT NORMSTR - -NORMSTR_RET: - ret - -;-----------------------------------------------------------------------------; -; Display sequence numbers ; -;-----------------------------------------------------------------------------; - -DISPLAYSEQ: - and AL,7 - add AL,30H - call PUTCHAR - ret - -;-----------------------------------------------------------------------------; -; Display Callsign pointed to by SI ; -;-----------------------------------------------------------------------------; - -DISPADDR: - - jcxz DISPADDR_RET - - LODS NORMCALL - call PUTCHAR - - loop DISPADDR - -DISPADDR_RET: - ret - - -PRINT4: -; -; DISPLAY IP ADDR IN DOTTED DECIMAL FORMAT -; - - LODSB - CALL DISPLAY_BYTE_1 - MOV AL,'.' - CALL PUTCHAR - - LODSB - CALL DISPLAY_BYTE_1 - MOV AL,'.' - CALL PUTCHAR - - LODSB - CALL DISPLAY_BYTE_1 - MOV AL,'.' - CALL PUTCHAR - - LODSB - CALL DISPLAY_BYTE_1 - - RET - - - -;-----------------------------------------------------------------------------; -; Convert byte in AL to nnn, nn or n format ; -;-----------------------------------------------------------------------------; - -DISPLAY_BYTE_1: - - cmp AL,100 - jb TENS_1 - - mov AH,0 - -HUNDREDS_LOOP_1: - cmp AL,100 - jb HUNDREDS_LOOP_END_1 - - sub AL,100 - inc AH - jmp SHORT HUNDREDS_LOOP_1 - -HUNDREDS_LOOP_END_1: - push AX - mov AL,AH - add AL,30H - call PUTCHAR - pop AX - jmp SHORT TENS_PRINT_1 - -TENS_1: - cmp AL,10 - jb UNITS_1 - -TENS_PRINT_1: - mov AH,0 - -TENS_LOOP_1: - cmp AL,10 - jb TENS_LOOP_END_1 - - sub AL,10 - inc AH - jmp SHORT TENS_LOOP_1 - -TENS_LOOP_END_1: - push AX - mov AL,AH - add AL,30H - call PUTCHAR - pop AX - -UNITS_1: - add AL,30H - call PUTCHAR - - ret - -;-----------------------------------------------------------------------------; -; Convert byte in AL to nn format ; -;-----------------------------------------------------------------------------; - -DISPLAY_BYTE_2: - cmp AL,100 - jb TENS_2 - - sub AL,100 - jmp SHORT DISPLAY_BYTE_2 - -TENS_2: - mov AH,0 - -TENS_LOOP_2: - cmp AL,10 - jb TENS_LOOP_END_2 - - sub AL,10 - inc AH - jmp SHORT TENS_LOOP_2 - -TENS_LOOP_END_2: - push AX - mov AL,AH - add AL,30H - call PUTCHAR - pop AX - -UNITS_2: - add AL,30H - call PUTCHAR - - ret - -;-----------------------------------------------------------------------------; -; Convert byte in AL to Hex display ; -;-----------------------------------------------------------------------------; - -BYTE_TO_HEX: - push AX - shr AL,1 - shr AL,1 - shr AL,1 - shr AL,1 - call NIBBLE_TO_HEX - pop AX - call NIBBLE_TO_HEX - ret - -NIBBLE_TO_HEX: - and AL,0FH - cmp AL,10 - - jb LESS_THAN_10 - add AL,7 - -LESS_THAN_10: - add AL,30H - call PUTCHAR - ret - - - -CONVFROMAX25: -; -; CONVERT AX25 FORMAT CALL IN [SI] TO NORMAL FORMAT IN NORMCALL -; RETURNS LENGTH IN CX AND NZ IF LAST ADDRESS BIT IS SET -; - PUSH EDI ; SAVE BUFFER - - PUSH ESI ; SAVE - MOV EDI,OFFSET NORMCALL - MOV ECX,10 ; MAX ALPHANUMERICS - MOV AL,20H - REP STOSB ; CLEAR IN CASE SHORT CALL - MOV EDI,OFFSET NORMCALL - MOV CL,6 -CONVAX50: - LODSB - CMP AL,40H - JE CONVAX60 ; END IF CALL - DO SSID - - SHR AL,1 - STOSB - LOOP CONVAX50 -CONVAX60: - POP ESI - ADD ESI,6 ; TO SSID - LODSB - MOV AH,AL ; SAVE FOR LAST BIT TEST - SHR AL,1 - AND AL,0FH - JZ CONVAX90 ; NO SSID - FINISHED -; - MOV BYTE PTR [EDI],'-' - INC EDI - CMP AL,10 - JB CONVAX70 - SUB AL,10 - MOV BYTE PTR [EDI],'1' - INC EDI -CONVAX70: - ADD AL,30H ; CONVERT TO DIGIT - STOSB -CONVAX90: - MOV ECX,EDI - SUB ECX,OFFSET NORMCALL - MOV NORMLEN,ECX ; SIGNIFICANT LENGTH - - TEST AH,1 ; LAST BIT SET? - - POP EDI - RET - -HEXOUT: - - PUSH AX - PUSH AX - sar al,1 - sar al,1 - sar al,1 - sar al,1 - call hexout1 - pop ax - call hexout1 - POP AX - ret - -hexout1: - and al,0fh - cmp al,10 - jl hexout5 - add al,7 -hexout5: - add al,30h - STOSB -; - ret - -PUTCHAR: - STOSB - RET - -_TEXT ENDS -; - END diff --git a/BBSHTMLConfig.c b/BBSHTMLConfig.c index d1a62ce..3234c00 100644 --- a/BBSHTMLConfig.c +++ b/BBSHTMLConfig.c @@ -405,41 +405,20 @@ int SendHeader(char * Reply, char * Key) void ConvertTitletoUTF8(WebMailInfo * WebMail, char * Title, char * UTF8Title, int Len) { - if (WebIsUTF8(Title, (int)strlen(Title)) == FALSE) + Len = strlen(Title); + + if (WebIsUTF8(Title, Len) == FALSE) { - // With Windows it is simple - convert using current codepage - // I think the only reliable way is to convert to unicode and back + int code = TrytoGuessCode(Title, Len); - int origlen = (int)strlen(Title) + 1; -#ifdef WIN32 - WCHAR BufferW[128]; - int wlen; - int len = origlen; + if (code == 437) + Len = Convert437toUTF8(Title, Len, UTF8Title); + else if (code == 1251) + Len = Convert1251toUTF8(Title, Len, UTF8Title); + else + Len = Convert1252toUTF8(Title, Len, UTF8Title); - wlen = MultiByteToWideChar(CP_ACP, 0, Title, len, BufferW, origlen * 2); - len = WideCharToMultiByte(CP_UTF8, 0, BufferW, wlen, UTF8Title, origlen * 2, NULL, NULL); -#else - size_t left = Len - 1; - size_t len = origlen; - - iconv_t * icu = WebMail->iconv_toUTF8; - - if (WebMail->iconv_toUTF8 == NULL) - icu = WebMail->iconv_toUTF8 = iconv_open("UTF-8//IGNORE", "CP1252"); - - if (icu == (iconv_t)-1) - { - strcpy(UTF8Title, Title); - WebMail->iconv_toUTF8 = NULL; - return; - } - - char * orig = UTF8Title; - - iconv(icu, NULL, NULL, NULL, NULL); // Reset State Machine - iconv(icu, &Title, &len, (char ** __restrict__)&UTF8Title, &left); - -#endif + UTF8Title[Len] = 0; } else strcpy(UTF8Title, Title); diff --git a/BPQChat.vcproj b/BPQChat.vcproj deleted file mode 100644 index c3b8993..0000000 --- a/BPQChat.vcproj +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPQMail.c b/BPQMail.c index 51216bc..08d5818 100644 --- a/BPQMail.c +++ b/BPQMail.c @@ -1142,6 +1142,7 @@ // Log Our HA when checking for flood bulls (45) // Semaphore calls to SaveConfig // Include SERVIC as valid from call (for Winlink Service messages) (49) +// Attempt to detect line draw characters in Webmail (50) #include "bpqmail.h" #include "winstdint.h" diff --git a/BPQMail.vcproj b/BPQMail.vcproj deleted file mode 100644 index 81a5df9..0000000 --- a/BPQMail.vcproj +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPQMail.vcproj.NOTTSDESKTOP.John.user b/BPQMail.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/BPQMail.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQMail.vcxproj b/BPQMail.vcxproj deleted file mode 100644 index 5aa7387..0000000 --- a/BPQMail.vcxproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {3766AA10-C777-4ED8-A83D-F1452DE9B665} - TelnetServer - Win32Proj - 10.0.17763.0 - - - - Application - v141 - NotSet - true - - - Application - v141 - false - NotSet - - - - - - - - - - - - - <_ProjectFileVersion>15.0.28307.799 - - - C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\ - true - - - C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\ - false - - - - - - - Disabled - ..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - true - - Level3 - EditAndContinue - CompileAsC - - - ..\Include;%(AdditionalIncludeDirectories) - - - ..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies) - c:\DevProgs\bpq32\BPQMail.exe - false - LIBCMT;%(IgnoreSpecificDefaultLibraries) - true - $(IntDir)$(TargetName).pdb - true - $(IntDir)BBSListings\bpqmail.map - true - Windows - MachineX86 - - - - - - - - - - - MaxSpeed - false - ..\CKernel;..\CInclude;..\CommonSource;..\BPQMail;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - MultiThreaded - - Level3 - ProgramDatabase - CompileAsC - - - ..\Include;%(AdditionalIncludeDirectories) - - - ..\lib\bpq32.lib;wsock32.lib;comctl32.lib;winmm.lib;..\lib\libconfig.lib;DbgHelp.lib;%(AdditionalDependencies) - c:\DevProgs\bpq32\BPQMail.exe - true - c:\DevProgs\bpq32\BPQMail.pdb - true - c:\DevProgs\bpq32\BPQMail.map - Windows - true - true - - MachineX86 - - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - All - $(IntDir) - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - All - $(IntDir) - $(IntDir) - $(IntDir)%(Filename)1.xdc - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - - - - - - - - - \ No newline at end of file diff --git a/BPQMail.vcxproj.filters b/BPQMail.vcxproj.filters deleted file mode 100644 index 8025626..0000000 --- a/BPQMail.vcxproj.filters +++ /dev/null @@ -1,113 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/BPQRemotePTT.vcproj b/BPQRemotePTT.vcproj deleted file mode 100644 index f47dfa3..0000000 --- a/BPQRemotePTT.vcproj +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPQWinAPP.vcproj b/BPQWinAPP.vcproj deleted file mode 100644 index 7aa07c4..0000000 --- a/BPQWinAPP.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user b/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/Bpq32.c b/Bpq32.c index 2916d7c..f7e1f59 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1233,6 +1233,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Fix possible crash if MQTT not in use (47) // Add optional ATTACH time limit for VARA (48) // API format fixes (48) +// AGWAPI Add protection against accidental connects from a non-agw application (50) #define CKernel diff --git a/CBPQ32.vcproj b/CBPQ32.vcproj deleted file mode 100644 index b66278e..0000000 --- a/CBPQ32.vcproj +++ /dev/null @@ -1,637 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CBPQ32.vcproj.NOTTSDESKTOP.John-skigdebian.user b/CBPQ32.vcproj.NOTTSDESKTOP.John-skigdebian.user deleted file mode 100644 index f4ba73a..0000000 --- a/CBPQ32.vcproj.NOTTSDESKTOP.John-skigdebian.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.NOTTSDESKTOP.John.user b/CBPQ32.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index f4ba73a..0000000 --- a/CBPQ32.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcxproj b/CBPQ32.vcxproj deleted file mode 100644 index fbdf53d..0000000 --- a/CBPQ32.vcxproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {8EFA1E59-8654-4A23-8102-AA77A074D57C} - CBPQ32 - Win32Proj - 10.0.17763.0 - - - - DynamicLibrary - v141 - NotSet - false - - - DynamicLibrary - v141 - MultiByte - - - - - - - - - - - - - - <_ProjectFileVersion>15.0.28127.55 - - - $(SolutionDir)$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\ - true - - - $(SolutionDir)$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\ - false - - - - 3 - ..\CInclude - true - - - Disabled - ..\CInclude;..\CommonSource;..\CKernel;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - All - c:\devprogs\bpq32\listings\debug\ - true - Level3 - EditAndContinue - - - /section:_BPQDATA,srw %(AdditionalOptions) - WS2_32.Lib;winmm.lib;DbgHelp.lib;comctl32.lib;Iphlpapi.lib;setupapi.lib;..\lib\libconfig.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) - c:\DevProgs\BPQ32\bpq32.dll - false - LIBCMTD.lib;%(IgnoreSpecificDefaultLibraries) - ..\CommonSource\bpq32.def - true - true - c:\DevProgs\BPQ32\bpqdev.map - true - Windows - 8000000 - 4000000 - false - - 0x42000000 - ..\lib\bpq32.lib - MachineX86 - false - - - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\$(ProjectName).bsc - - - "C:\Program Files\7-Zip\7z.exe" a C:\DevProgs\BPQ32\bpq32.zip C:\DevProgs\BPQ32\bpq32.dll && myxcopy /y c:\DevProgs\BPQ32\bpq32.dll c:\windows\SysWOW64\bpq32.dll && del C:\DevProgs\BPQ32\bpq32.dll - - - - - 3 - $(IntDir)$(ProjectName) - ..\CInclude - true - true - true - true - - - /D "MDIKERNEL" %(AdditionalOptions) - Disabled - false - ..\CInclude;..\CommonSource;..\CKernel;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BPQ32_EXPORTS;MDIKERNEL;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - MultiThreaded - - All - c:\devprogs\bpq32\listings\ - Level3 - ProgramDatabase - - - /section:_BPQDATA,srw %(AdditionalOptions) - WS2_32.Lib;winmm.lib;DbgHelp.lib;comctl32.lib;setupapi.lib;..\lib\libconfig.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) - C:\DevProgs\BPQ32\bpq32.dll - ..\CommonSource\bpq32.def - true - c:\DevProgs\BPQ32\bpq32.pdb - true - c:\DevProgs\BPQ32\bpqpdn.map - true - Windows - true - true - - 0x42000000 - C:\Dev\Msdev2005\Projects\BPQ32\lib\bpq32.lib - MachineX86 - - - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(Configuration)\$(ProjectName).bsc - - - "C:\Program Files\7-Zip\7z.exe" a C:\DevProgs\BPQ32\bpq32.zip C:\DevProgs\BPQ32\bpq32.dll && myxcopy /y c:\DevProgs\BPQ32\bpq32.dll c:\windows\SysWOW64\bpq32.dll && del C:\DevProgs\BPQ32\bpq32.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CBPQ32.vcxproj.filters b/CBPQ32.vcxproj.filters deleted file mode 100644 index 7c08db6..0000000 --- a/CBPQ32.vcxproj.filters +++ /dev/null @@ -1,228 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/ConfigDirewolf.vcxproj b/ConfigDirewolf.vcxproj deleted file mode 100644 index 6f13490..0000000 --- a/ConfigDirewolf.vcxproj +++ /dev/null @@ -1,164 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {271FDA0A-4F41-4F35-8227-9F2F29AA5A25} - Win32Proj - ConsoleApplication2 - 10.0.17763.0 - ConfigDirewolf - - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - NotUsing - Level3 - Disabled - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - - - - - Use - Level3 - Disabled - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - true - true - c:\devprogs\bpq32\ConfigDirewolf.exe - - - - - Use - Level3 - MaxSpeed - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - true - true - - - - - - - - - - - - \ No newline at end of file diff --git a/ConfigWinRPR.vcxproj b/ConfigWinRPR.vcxproj deleted file mode 100644 index 9e66f98..0000000 --- a/ConfigWinRPR.vcxproj +++ /dev/null @@ -1,164 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {2AD91A25-DF1B-462E-8CCB-CD1ABC627AA5} - Win32Proj - ConsoleApplication2 - 10.0.17763.0 - ConfigWinRPR - - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - Application - true - v141 - Unicode - - - Application - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - NotUsing - Level3 - Disabled - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - - - - - Use - Level3 - Disabled - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - true - true - c:\devprogs\bpq32\ConfigWinRPR.exe - - - - - Use - Level3 - MaxSpeed - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - pch.h - - - Console - true - true - true - - - - - - - - - - - - \ No newline at end of file diff --git a/FormatHTML.vcproj b/FormatHTML.vcproj deleted file mode 100644 index 1c3dce1..0000000 --- a/FormatHTML.vcproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MCP2221.vcproj b/MCP2221.vcproj deleted file mode 100644 index d2c9621..0000000 --- a/MCP2221.vcproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MailNode.vcproj b/MailNode.vcproj deleted file mode 100644 index a77077c..0000000 --- a/MailNode.vcproj +++ /dev/null @@ -1,643 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MailNode.vcproj.NOTTSDESKTOP.John-skigdebian.user b/MailNode.vcproj.NOTTSDESKTOP.John-skigdebian.user deleted file mode 100644 index 4aa3c72..0000000 --- a/MailNode.vcproj.NOTTSDESKTOP.John-skigdebian.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/MailNode.vcproj.NOTTSDESKTOP.John.user b/MailNode.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index 4aa3c72..0000000 --- a/MailNode.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/MailNode.vcxproj b/MailNode.vcxproj deleted file mode 100644 index 429ce34..0000000 --- a/MailNode.vcxproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - LinBPQ - {3766AA10-C777-4ED8-A83D-F1452DE9B666} - MailNode - Win32Proj - 10.0.17763.0 - - - - Application - v141 - NotSet - true - - - Application - v141 - NotSet - true - - - Application - v141 - NotSet - - - Application - v141 - NotSet - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>15.0.28307.799 - - - C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\ - true - - - true - D:\linbpq - - - C:\Dev\Msdev2005\$(SolutionName)\$(ProjectName)\$(Configuration)\ - C:\Dev\Msdev2005\Intermed\$(SolutionName)\$(ProjectName)\$(Configuration)\ - false - - - false - - - - Disabled - ..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - Level3 - EditAndContinue - - - kernel32.lib;WS2_32.Lib;..\lib\libconfigd.lib;DbgHelp.lib;setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) - c:\LINBPQ\$(ProjectName).exe - true - true - c:\linbpq\linmail.map - Console - 4000000 - 0 - MachineX86 - - - - - Disabled - ..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;LINBPQ;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - kernel32.lib;WS2_32.Lib;C:\OneDrive\Dev\Source\bpq32\libconfig\x64\Release\libconfig.lib;DbgHelp.lib;setupapi.lib;C:\Dev\Msdev2005\projects\bpq32\CKernel\x64\Debug\miniupnpc.lib;C:\OneDrive\Dev\Source\zlib-1.2.11\contrib\vstudio\vc14\x64\ZlibStatDebug\zlibstat.lib;%(AdditionalDependencies) - c:\LINBPQ\$(ProjectName).exe - true - true - c:\linbpq\linmail.map - Console - 4000000 - 0 - - - - - ..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - MultiThreaded - - Level3 - ProgramDatabase - - - kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) - c:\devprogs\bpq32\LinBPQ.exe - true - Console - 5000000 - 10000000 - true - true - MachineX86 - - - - - ..\CKernel;..\CommonSource;..\CInclude;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;LINBPQ;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - kernel32.lib;WS2_32.Lib;..\lib\libconfig.lib;DbgHelp.lib;Setupapi.lib;miniupnpc.lib;zlibstat.lib;%(AdditionalDependencies) - c:\devprogs\bpq32\LinBPQ.exe - true - Console - 5000000 - 10000000 - true - true - - - - - - - - - - - - - - - - - - - - - All - All - $(IntDir) - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MailNode.vcxproj.filters b/MailNode.vcxproj.filters deleted file mode 100644 index d32f45b..0000000 --- a/MailNode.vcxproj.filters +++ /dev/null @@ -1,327 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - \ No newline at end of file diff --git a/MailTCP.c b/MailTCP.c index a08632d..49478e1 100644 --- a/MailTCP.c +++ b/MailTCP.c @@ -2656,6 +2656,7 @@ VOID ProcessPOP3ServerMessage(SocketConn * sockptr, char * Buffer, int Len) // Must be some other coding int code = TrytoGuessCode(msgbytes, Len); + UCHAR * UTF = malloc(Len * 3); if (code == 437) diff --git a/NodeMapTest.vcproj b/NodeMapTest.vcproj deleted file mode 100644 index 9f9a2e1..0000000 --- a/NodeMapTest.vcproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PCBeep.wav b/PCBeep.wav deleted file mode 100644 index 8ff2dd9..0000000 Binary files a/PCBeep.wav and /dev/null differ diff --git a/PG/Loop.exe b/PG/Loop.exe deleted file mode 100644 index 1ddf86e..0000000 Binary files a/PG/Loop.exe and /dev/null differ diff --git a/PG/PGTest.exe b/PG/PGTest.exe deleted file mode 100644 index 7f01106..0000000 Binary files a/PG/PGTest.exe and /dev/null differ diff --git a/Ring.wav b/Ring.wav deleted file mode 100644 index ea59863..0000000 Binary files a/Ring.wav and /dev/null differ diff --git a/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj b/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj deleted file mode 100644 index 4bac56b..0000000 --- a/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj.SKIGACER.johnw.user b/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj.SKIGACER.johnw.user deleted file mode 100644 index b5b0536..0000000 --- a/UDPtoTCP/UDPtoTCP/UDPtoTCP.vcproj.SKIGACER.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/Versions.h b/Versions.h index efe04b6..5f0f730 100644 --- a/Versions.h +++ b/Versions.h @@ -10,8 +10,8 @@ #endif -#define KVers 6,0,24,49 -#define KVerstring "6.0.24.49\0" +#define KVers 6,0,24,50 +#define KVerstring "6.0.24.50\0" #ifdef CKernel diff --git a/WebMail.c b/WebMail.c index 569796f..edcc107 100644 --- a/WebMail.c +++ b/WebMail.c @@ -1246,63 +1246,25 @@ int ViewWebMailMessage(struct HTTPConnectionInfo * Session, char * Reply, int Nu User->Total.MsgsSent[Index] ++; // User->Total.BytesForwardedOut[Index] += Length; - // if body not UTF-8, convert it if (WebIsUTF8(MsgBytes, msgLen) == FALSE) { - // With Windows it is simple - convert using current codepage - // I think the only reliable way is to convert to unicode and back + int code = TrytoGuessCode(MsgBytes, msgLen); - size_t origlen = msgLen + 1; + UCHAR * UTF = malloc(msgLen * 3); - UCHAR * BufferB = malloc(2 * origlen); -#ifdef WIN32 - WCHAR * BufferW = malloc(2 * origlen); - int wlen; - int len = (int)origlen; - - wlen = MultiByteToWideChar(CP_ACP, 0, MsgBytes, len, BufferW, (int)(origlen * 2)); - len = WideCharToMultiByte(CP_UTF8, 0, BufferW, wlen, BufferB, (int)(origlen * 2), NULL, NULL); - - free(Save); - Save = MsgBytes = BufferB; - free(BufferW); - msgLen = len - 1; // exclude NULL -#else - size_t left = 2 * msgLen; - size_t outbuflen = left; - size_t len = msgLen + 1; // include null - int ret; - UCHAR * BufferBP = BufferB; - char * orig = MsgBytes; - MsgBytes[msgLen] = 0; - - iconv_t * icu = Session->WebMail->iconv_toUTF8; - - if (icu == NULL) - icu = Session->WebMail->iconv_toUTF8 = iconv_open("UTF-8//IGNORE", "CP1252"); - - if (icu == (iconv_t) -1) - { - Session->WebMail->iconv_toUTF8 = NULL; - strcpy(BufferB, MsgBytes); - } + if (code == 437) + msgLen = Convert437toUTF8(MsgBytes, msgLen, UTF); + else if (code == 1251) + msgLen = Convert1251toUTF8(MsgBytes, msgLen, UTF); else - { - iconv(icu, NULL, NULL, NULL, NULL); // Reset State Machine - ret = iconv(icu, &MsgBytes, &len, (char ** __restrict__)&BufferBP, &left); - } - - // left is next location to write, so length written is outbuflen - left - // add a null in case iconv didn't complete comversion - - BufferB[outbuflen - left] = 0; - - free(Save); - Save = MsgBytes = BufferB; - msgLen = strlen(MsgBytes); -#endif + msgLen = Convert1252toUTF8(MsgBytes, msgLen, UTF); + + free(MsgBytes); + Save = MsgBytes = UTF; + + MsgBytes[msgLen] = 0; } // ptr += sprintf(ptr, "%s", MsgBytes); diff --git a/WinRPRHelper.vcproj b/WinRPRHelper.vcproj deleted file mode 100644 index 20f185d..0000000 --- a/WinRPRHelper.vcproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user b/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/WinmorControl.vcproj b/WinmorControl.vcproj deleted file mode 100644 index a6e9b48..0000000 --- a/WinmorControl.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WinmorControl.vcproj.NOTTSDESKTOP.John.user b/WinmorControl.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/WinmorControl.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/asmDOSAPI.asm b/asmDOSAPI.asm deleted file mode 100644 index bda758e..0000000 --- a/asmDOSAPI.asm +++ /dev/null @@ -1,136 +0,0 @@ -IF 0 - -Copyright 2001-2015 John Wiseman G8BPQ - -This file is part of LinBPQ/BPQ32. - -LinBPQ/BPQ32 is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -LinBPQ/BPQ32 is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses - -ENDIF - -IFNDEF BPQ64 - - PAGE 56,132 -; - -.386 -; -; SEGMENT definitions and order -; - - -;* 32 Bit code -_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE' -_TEXT ENDS - - - -;* Contains 32 Bit data -_BPQDATA SEGMENT DWORD PUBLIC 'DATA' -_BPQDATA ENDS - - - ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:FLAT - -OFFSET32 EQU - -_BPQDATA SEGMENT - - extern _APISemaphore:DWORD - -ApiEAX DD 0; -ApiEBX DD 0; -ApiECX DD 0; -ApiEDX DD 0; -ApiESI DD 0; -ApiEDI DD 0; - -_BPQDATA ENDS - -_TEXT SEGMENT -; - EXTRN _CHOSTAPI:NEAR -MARKER DB 'G8BPQ' ; MUST BE JUST BEFORE INT 7F ENTRY - DB 4 ; MAJORVERSION - DB 9 ; MINORVERSION - - - PUBLIC _BPQHOSTAPI -_BPQHOSTAPI: -; -; SPECIAL INTERFACE, MAINLY FOR EXTERNAL HOST MODE SUPPORT PROGS -; - extrn _GetSemaphore:near - extrn _FreeSemaphore:near - extrn _Check_Timer:near - - - pushad - call _Check_Timer - push offset _APISemaphore - call _GetSemaphore - add esp, 4 - popad - -; Params are 16 bits - - movzx eax,ax - movzx ebx,bx - movzx ecx,cx - movzx edx,dx - - mov ApiEAX, eax - mov ApiEBX, ebx - mov ApiECX, ecx - mov ApiEDX, edx - mov ApiESI, esi - mov ApiEDI, edi - - lea eax,ApiEDI - push eax - lea eax,ApiESI - push eax - lea eax,ApiEDX - push eax - lea eax,ApiECX - push eax - lea eax,ApiEBX - push eax - lea eax,ApiEAX - push eax - - call _CHOSTAPI - add esp, 24 - - mov eax,ApiEAX - mov ebx,ApiEBX - mov ecx,ApiECX - mov edx,ApiEDX - mov esi,ApiESI - mov esi,ApiEDI - - - pushad - push offset _APISemaphore - call _FreeSemaphore - add esp, 4 - popad - - ret - -_TEXT ENDS -ENDIF - -END - diff --git a/compatbits.h.bak b/compatbits.h.bak deleted file mode 100644 index 22a851b..0000000 --- a/compatbits.h.bak +++ /dev/null @@ -1,239 +0,0 @@ -/* - -Stuff to make compiling on WINDOWS and LINUX easier - -*/ - -#ifndef _COMPATBITS_ -#define _COMPATBITS_ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef WIN32 - -#define _CRT_SECURE_NO_DEPRECATE -#include - -#define strtoll _strtoi64 - -#ifdef _WIN64 -#include "stdint.h" -#else -#include "winstdint.h" -#endif - -#include "winsock2.h" -#include "WS2tcpip.h" - -#include - -#include -#include "commctrl.h" -#include "Commdlg.h" -#include - -#define Dll __declspec(dllexport) -#define DllExport __declspec(dllexport) - -#define ioctl ioctlsocket - -#define pthread_t uintptr_t - -int pthread_equal(pthread_t T1, pthread_t T2); - -uintptr_t _beginthread(void(__cdecl *start_address)(void *), unsigned stack_size, void *arglist); - -#else - -int Sleep(int ms); - -#define ioctlsocket ioctl - -#define Dll -#define DllExport - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -#define BOOL int -#define VOID void -#define UCHAR unsigned char -#define USHORT unsigned short -#define ULONG unsigned long -#define UINT unsigned int -#define SHORT short -#define DWORD unsigned int -#define BYTE unsigned char -#define APIENTRY -#define WINAPI -#define WINUSERAPI -#define TCHAR char -#define TRUE 1 -#define FALSE 0 -#define FAR -#define byte UCHAR -//#define Byte UCHAR -#define Word WORD - -typedef DWORD COLORREF; -#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((USHORT)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) - -#define GetRValue(rgb) rgb & 0xFF -#define GetGValue(rgb) (rgb >> 8) & 0xFF -#define GetBValue(rgb) (rgb >> 16) & 0xFF - - -#define HWND unsigned int -#define HINSTANCE unsigned int -#define HKEY unsigned int -#define UINT_PTR unsigned int * - -#define HANDLE UINT -#define SOCKET int - -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 - -#define HMENU UINT -#define WNDPROC UINT -#define __cdecl - -#define strtok_s strtok_r - -#define _memicmp memicmp -#define _stricmp stricmp -#define _strdup strdup -#define _strupr strupr -#define _strlwr strlwr - -#define _snprintf snprintf - -#define _gcvt gcvt -#define _fcvt fcvt -#define _atoi64 atoll - -#define DeleteFile unlink -#define MoveFile rename -#define CreateDirectory mkdir - -uint64_t GetTickCount(); - - -int sprintf_s(char * string, int plen, const char * format, ...); - - -int memicmp(unsigned char *a, unsigned char *b, int n); -int stricmp(const unsigned char * pStr1, const unsigned char *pStr2); -char * strupr(char* s); -char * strlwr(char* s); - -pthread_t _beginthread(void(*start_address)(), unsigned stack_size, VOID * arglist); - - - -#define WSAGetLastError() errno -#define GetLastError() errno -void closesocket(int sock); -#define GetCurrentProcessId getpid -#define GetCurrentThreadId pthread_self - -char * inet_ntoa(struct in_addr in); - -#define LOBYTE(w) ((BYTE)((ULONG *)(w) & 0xff)) -#define HIBYTE(w) ((BYTE)((ULONG *)(w) >> 8)) - -#define LOWORD(l) ((SHORT) ((l) & 0xffff)) - -#define WSAEWOULDBLOCK 11 - -#define MAX_PATH 250 - -typedef int (*PROC)(); - -typedef struct tagRECT -{ - unsigned int left; - unsigned int top; - unsigned int right; - unsigned int bottom; -} RECT, *PRECT, *NPRECT, *LPRECT; - -#define HBRUSH int - -#define _timezone timezone - -#endif - - - -#ifdef LINBPQ - - -#ifndef WIN32 -void SetWindowText(HWND hWnd, char * lpString); -BOOL MySetDlgItemText(HWND hWnd, int item, char * lpString); -BOOL CopyFile(char * In, char * Out, BOOL Failifexists); -int GetNumberofPorts(); -int SendMsg(int stream, char * msg, int len); -int SendRaw(int port, char * msg, int len); -VOID md5(char *arg, unsigned char * checksum); - -// Send Raw (KISS mode) frame to port (BPQHOST function 10) - -int APIENTRY SendRaw(int port, char * msg, int len); - - - - -BOOL MySetDlgItemText(); - -VOID OutputDebugString(char * string); - -#endif - -#ifdef APIENTRY -#undef APIENTRY -#endif -#define APIENTRY - -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr_in *PSOCKADDR_IN; -typedef struct sockaddr_in *LPSOCKADDR_IN; - -typedef struct sockaddr SOCKADDR; -typedef struct sockaddr *PSOCKADDR; -typedef struct sockaddr *LPSOCKADDR; - -#define __int16 short -#define __int32 long - - -#endif - -#endif - diff --git a/debug/bpq32.pdb b/debug/bpq32.pdb deleted file mode 100644 index 05ac07e..0000000 Binary files a/debug/bpq32.pdb and /dev/null differ diff --git a/ding.wav b/ding.wav deleted file mode 100644 index 5331129..0000000 Binary files a/ding.wav and /dev/null differ diff --git a/miniupnpc.lib b/miniupnpc.lib deleted file mode 100644 index 0032c1b..0000000 Binary files a/miniupnpc.lib and /dev/null differ diff --git a/paho-mqtt3a-static.lib b/paho-mqtt3a-static.lib deleted file mode 100644 index abba854..0000000 Binary files a/paho-mqtt3a-static.lib and /dev/null differ diff --git a/paho-mqtt3a.lib b/paho-mqtt3a.lib deleted file mode 100644 index 1fb6329..0000000 Binary files a/paho-mqtt3a.lib and /dev/null differ diff --git a/utf8Routines.c b/utf8Routines.c index 6e0d17e..c0f9ca3 100644 --- a/utf8Routines.c +++ b/utf8Routines.c @@ -548,8 +548,8 @@ int TrytoGuessCode(unsigned char * Char, int Len) if (Above127 == 0) // DOesn't really matter! return 1252; - if (Above127 == LineDraw) - return 437; // If only Line Draw chars, assume line draw + if (LineDraw > ((Above127 * 9) / 10)) + return 437; // If mainly Line Draw chars, assume line draw // If mainly below 128, it is probably Latin if mainly above, probably Cyrillic diff --git a/xpaho-mqtt3a.dll b/xpaho-mqtt3a.dll deleted file mode 100644 index e978f04..0000000 Binary files a/xpaho-mqtt3a.dll and /dev/null differ diff --git a/zlib.lib b/zlib.lib deleted file mode 100644 index d43be7f..0000000 Binary files a/zlib.lib and /dev/null differ diff --git a/zlibstat.lib b/zlibstat.lib deleted file mode 100644 index dee4ded..0000000 Binary files a/zlibstat.lib and /dev/null differ diff --git a/zlibstat64.lib b/zlibstat64.lib deleted file mode 100644 index af241e2..0000000 Binary files a/zlibstat64.lib and /dev/null differ