00001 /* Copyright 1994 - 1996, LongView Technologies L.L.C. $Revision: 1.4 $ */ 00002 /* Copyright (c) 2006, Sun Microsystems, Inc. 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 00006 following conditions are met: 00007 00008 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 00010 disclaimer in the documentation and/or other materials provided with the distribution. 00011 * Neither the name of Sun Microsystems nor the names of its contributors may be used to endorse or promote products derived 00012 from this software without specific prior written permission. 00013 00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 00015 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00016 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00017 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00018 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00019 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00020 00021 00022 */ 00023 00024 # include "incls/_precompiled.incl" 00025 # include "incls/_disclaimer.cpp.incl" 00026 00027 00028 char* Disclaimer::_msg = 00029 "\ 00030 Smalltalk Virtual Machine by LongView Technologies LLC \n\ 00031 --------------------------------------------------------- \n\ 00032 (c) 1994-1997 Sun Microsystems, Inc. ALL RIGHTS RESERVED. \n\ 00033 Use and distribution of this software is subject to the \n\ 00034 terms of the attached license. \n\ 00035 --------------------------------------------------------- \n\ 00036 "; 00037 /* 00038 "\n\ 00039 Strongtalk (TM) Virtual Machine -- proprietary information of \n\ 00040 LongView Technologies L.L.C. (c) 1994 - 1996. \n\ 00041 \n\ 00042 LongView Technologies L.L.C. (\"LongView\") grants to you the non- \n\ 00043 exclusive, non-assignable right to use the Strongtalk (TM) Virtual \n\ 00044 Machine as well as the associated Strongtalk components .bst file \n\ 00045 and source database (\"this software\") on one computer system solely \n\ 00046 for evaluation purposes. This software shall not be copied or used \n\ 00047 for any other purpose. You may not decompile, dissassemble, or \n\ 00048 reverse engineer this software. You may not disclose the results of \n\ 00049 any benchmark testing of this software to any third party without \n\ 00050 LongView's prior written permission. In addition to the restrictions \n\ 00051 set forth in this notice, any use of this software is subject to the \n\ 00052 terms of the Nondisclosure Agreement, if any. All rights not expressly \n\ 00053 granted are reserved by LongView. \n\ 00054 \n\ 00055 This software is provided \"as is\", without any warranty of any kind. \n\ 00056 To the maximum extent permitted by law, LongView disclaims all \n\ 00057 warranties, either express or implied, including but not limited \n\ 00058 to implied warranties of merchantability, fitness for a particular \n\ 00059 purpose and nonfringement. The entire risk arising out of the use \n\ 00060 of this software remains with you. \n\ 00061 \n\ 00062 To the maximum extent permitted by law, in no event shall LongView \n\ 00063 be liable for any damages whatsoever arising out of the use of this \n\ 00064 software, even if LongView has been advised of the possibility of \n\ 00065 such damages. \n\ 00066 \n"; 00067 */ 00068 00069 void Disclaimer::print_disclaimer(outputStream* s) { 00070 s->print(_msg); 00071 } 00072 00073 00074 void Disclaimer::initialize() { 00075 // Computes a checksum over the disclaimer msg - simple check 00076 // to detect hack attacks aiming at modifying the disclaimer. 00077 const int xsum = -2020472186; // change this when changing _msg 00078 int s = 0; 00079 for (char* p = _msg; *p != '\x0'; p++) 00080 s = ((s << 3) | (s >> 29) & 0x7) ^ *p; 00081 if (s != xsum) { 00082 if (is_product()) { 00083 // VM has been hacked => terminate immediately. 00084 exit(0); 00085 } else { 00086 // notify programmer 00087 warning("Disclaimer::initialize: xsum = %d but %d expected", s, xsum); 00088 } 00089 } 00090 } 00091 00092 00093 void disclaimer_init() { 00094 Disclaimer::initialize(); 00095 }