diff --git a/COPYING b/COPYING index 623b6258a1..7a4a3ea242 100644 --- a/COPYING +++ b/COPYING @@ -1,340 +1,202 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/REVISION b/REVISION index afb369fc18..edd89433d3 100644 --- a/REVISION +++ b/REVISION @@ -1 +1 @@ -#define REVISION "136:137" +#define REVISION "148" diff --git a/libyara/ast.c b/libyara/ast.c index 8a20885c64..966ba25d8c 100644 --- a/libyara/ast.c +++ b/libyara/ast.c @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #include diff --git a/libyara/ast.h b/libyara/ast.h index 17c583bf0a..989153ccb6 100644 --- a/libyara/ast.h +++ b/libyara/ast.h @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #ifndef _AST_H diff --git a/libyara/eval.c b/libyara/eval.c index e3505c6e06..f5e4a87f3e 100644 --- a/libyara/eval.c +++ b/libyara/eval.c @@ -1,17 +1,34 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +All rights reserved. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. +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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include "yara.h" diff --git a/libyara/eval.h b/libyara/eval.h index 82fd791be1..2365a1a818 100644 --- a/libyara/eval.h +++ b/libyara/eval.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifndef _EVAL_H diff --git a/libyara/exe.c b/libyara/exe.c index 5e167aad86..a7001d04f4 100644 --- a/libyara/exe.c +++ b/libyara/exe.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include diff --git a/libyara/exe.h b/libyara/exe.h index fc7cfa34e0..1b719bed77 100644 --- a/libyara/exe.h +++ b/libyara/exe.h @@ -1,18 +1,36 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ + #ifndef _PE_H #define _PE_H diff --git a/libyara/filemap.c b/libyara/filemap.c index a5fbfff0e7..c6b351464b 100755 --- a/libyara/filemap.c +++ b/libyara/filemap.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include diff --git a/libyara/filemap.h b/libyara/filemap.h index b87e1e4c30..999be679ef 100755 --- a/libyara/filemap.h +++ b/libyara/filemap.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifdef WIN32 diff --git a/libyara/grammar.c b/libyara/grammar.c index c104565f25..4443d57bd6 100644 --- a/libyara/grammar.c +++ b/libyara/grammar.c @@ -1,23 +1,24 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify + + This program 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. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program 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 this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -28,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -54,60 +55,11 @@ /* Pure parsers. */ #define YYPURE 1 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 0 -/* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 2 "grammar.y" - - -#include -#include -#include - -#include "ast.h" -#include "sizedstr.h" -#include "mem.h" -#include "lex.h" -#include "regex.h" - -#define YYERROR_VERBOSE -//#define YYDEBUG 1 - - - -/* Line 189 of yacc.c */ -#line 91 "grammar.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -243,13 +195,47 @@ +/* Copy the first part of user declarations. */ +#line 34 "grammar.y" + + +#include +#include +#include + +#include "ast.h" +#include "sizedstr.h" +#include "mem.h" +#include "lex.h" +#include "regex.h" + +#define YYERROR_VERBOSE +//#define YYDEBUG 1 + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE +#line 148 "grammar.y" { - -/* Line 214 of yacc.c */ -#line 116 "grammar.y" - void* sized_string; char* c_string; @@ -259,22 +245,19 @@ typedef union YYSTYPE void* tag; void* meta; - - - -/* Line 214 of yacc.c */ -#line 267 "grammar.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 193 of yacc.c. */ +#line 251 "grammar.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -/* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 131 "grammar.y" +/* Copy the second part of user declarations. */ +#line 163 "grammar.y" /* Function declarations */ @@ -378,8 +361,8 @@ TERM* reduce_range( yyscan_t yyscanner, -/* Line 264 of yacc.c */ -#line 383 "grammar.c" +/* Line 216 of yacc.c. */ +#line 366 "grammar.c" #ifdef short # undef short @@ -429,7 +412,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -454,14 +437,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -542,9 +525,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -578,12 +561,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -711,17 +694,17 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 236, 236, 237, 238, 239, 242, 252, 253, 256, - 257, 260, 263, 264, 267, 268, 271, 272, 275, 284, - 294, 303, 314, 323, 332, 341, 352, 362, 374, 384, - 394, 406, 407, 410, 411, 412, 413, 416, 417, 418, - 428, 438, 448, 458, 468, 472, 482, 493, 492, 507, - 506, 522, 532, 533, 534, 535, 536, 538, 539, 540, - 541, 542, 543, 544, 549, 550, 553, 554, 559, 560, - 563, 564, 567, 577, 591, 595, 596, 597, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 619, 629, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, - 652, 655, 656, 657 + 0, 268, 268, 269, 270, 271, 274, 284, 285, 288, + 289, 292, 295, 296, 299, 300, 303, 304, 307, 316, + 326, 335, 346, 355, 364, 373, 384, 394, 406, 416, + 426, 438, 439, 442, 443, 444, 445, 448, 449, 450, + 460, 470, 480, 490, 500, 504, 514, 525, 524, 539, + 538, 554, 564, 565, 566, 567, 568, 570, 571, 572, + 573, 574, 575, 576, 581, 582, 585, 586, 591, 592, + 595, 596, 599, 609, 623, 627, 628, 629, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 651, 661, 671, + 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, + 684, 687, 688, 689 }; #endif @@ -741,13 +724,13 @@ static const char *const yytname[] = "_UINT16_", "_UINT32_", "_MATCHES_", "_CONTAINS_", "_INDEX_", "_MZ_", "_PE_", "_DLL_", "_TRUE_", "_FALSE_", "_OR_", "_AND_", "'&'", "'|'", "_IS_", "_NEQ_", "_EQ_", "_GE_", "_GT_", "_LE_", "_LT_", "_SHIFT_RIGHT_", - "_SHIFT_LEFT_", "'+'", "'-'", "'*'", "'\\\\'", "_NOT_", "'~'", "'i'", - "'{'", "'}'", "':'", "'='", "'('", "')'", "','", "'.'", "'['", "']'", - "$accept", "rules", "rule", "meta", "strings", "condition", + "_SHIFT_LEFT_", "'+'", "'-'", "'*'", "'\\\\'", "_NOT_", "'~'", + "'include'", "'{'", "'}'", "':'", "'='", "'('", "')'", "','", "'.'", + "'['", "']'", "$accept", "rules", "rule", "meta", "strings", "condition", "rule_modifiers", "rule_modifier", "tags", "tag_list", "meta_declarations", "meta_declaration", "string_declarations", "string_declaration", "string_modifiers", "string_modifier", - "boolean_expression", "$@1", "$@2", "integer_set", "integer_enumeration", + "boolean_expression", "@1", "@2", "integer_set", "integer_enumeration", "string_set", "string_enumeration", "string_enumeration_item", "range", "for_expression", "expression", "number", "type", 0 }; @@ -1061,7 +1044,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -1175,20 +1158,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yyscanner) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1223,11 +1203,11 @@ yy_reduce_print (yyvsp, yyrule, yyscanner) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , yyscanner); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1509,8 +1489,10 @@ yydestruct (yymsg, yytype, yyvaluep, yyscanner) break; } } + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1529,9 +1511,10 @@ int yyparse (); -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ + +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1555,46 +1538,22 @@ yyparse (yyscanner) #endif #endif { -/* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; +/* Number of syntax errors so far. */ +int yynerrs; + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1602,28 +1561,51 @@ YYSTYPE yylval; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; @@ -1653,6 +1635,7 @@ YYSTYPE yylval; YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1660,6 +1643,7 @@ YYSTYPE yylval; yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -1682,8 +1666,9 @@ YYSTYPE yylval; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1694,6 +1679,7 @@ YYSTYPE yylval; yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1703,9 +1689,6 @@ YYSTYPE yylval; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1714,16 +1697,16 @@ YYSTYPE yylval; yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1755,16 +1738,20 @@ YYSTYPE yylval; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1804,9 +1791,7 @@ YYSTYPE yylval; switch (yyn) { case 6: - -/* Line 1455 of yacc.c */ -#line 243 "grammar.y" +#line 275 "grammar.y" { if (reduce_rule_declaration(yyscanner, (yyvsp[(3) - (9)].c_string),(yyvsp[(1) - (9)].integer),(yyvsp[(4) - (9)].tag),(yyvsp[(6) - (9)].meta),(yyvsp[(7) - (9)].string),(yyvsp[(8) - (9)].term)) != ERROR_SUCCESS) { @@ -1817,86 +1802,62 @@ YYSTYPE yylval; break; case 7: - -/* Line 1455 of yacc.c */ -#line 252 "grammar.y" +#line 284 "grammar.y" { (yyval.meta) = NULL; } break; case 8: - -/* Line 1455 of yacc.c */ -#line 253 "grammar.y" +#line 285 "grammar.y" { (yyval.meta) = (yyvsp[(3) - (3)].meta); } break; case 9: - -/* Line 1455 of yacc.c */ -#line 256 "grammar.y" +#line 288 "grammar.y" { (yyval.string) = NULL; } break; case 10: - -/* Line 1455 of yacc.c */ -#line 257 "grammar.y" +#line 289 "grammar.y" { (yyval.string) = (yyvsp[(3) - (3)].string); } break; case 11: - -/* Line 1455 of yacc.c */ -#line 260 "grammar.y" +#line 292 "grammar.y" { (yyval.term) = (yyvsp[(3) - (3)].term); } break; case 12: - -/* Line 1455 of yacc.c */ -#line 263 "grammar.y" +#line 295 "grammar.y" { (yyval.integer) = 0; } break; case 13: - -/* Line 1455 of yacc.c */ -#line 264 "grammar.y" +#line 296 "grammar.y" { (yyval.integer) = (yyvsp[(1) - (2)].integer) | (yyvsp[(2) - (2)].integer); } break; case 14: - -/* Line 1455 of yacc.c */ -#line 267 "grammar.y" +#line 299 "grammar.y" { (yyval.integer) = RULE_FLAGS_PRIVATE; } break; case 15: - -/* Line 1455 of yacc.c */ -#line 268 "grammar.y" +#line 300 "grammar.y" { (yyval.integer) = RULE_FLAGS_GLOBAL; } break; case 16: - -/* Line 1455 of yacc.c */ -#line 271 "grammar.y" +#line 303 "grammar.y" { (yyval.tag) = NULL; } break; case 17: - -/* Line 1455 of yacc.c */ -#line 272 "grammar.y" +#line 304 "grammar.y" { (yyval.tag) = (yyvsp[(2) - (2)].tag); } break; case 18: - -/* Line 1455 of yacc.c */ -#line 275 "grammar.y" +#line 307 "grammar.y" { (yyval.tag) = reduce_tags(yyscanner,NULL,(yyvsp[(1) - (1)].c_string)); @@ -1909,9 +1870,7 @@ YYSTYPE yylval; break; case 19: - -/* Line 1455 of yacc.c */ -#line 284 "grammar.y" +#line 316 "grammar.y" { (yyval.tag) = reduce_tags(yyscanner,(yyvsp[(1) - (2)].tag),(yyvsp[(2) - (2)].c_string)); @@ -1924,9 +1883,7 @@ YYSTYPE yylval; break; case 20: - -/* Line 1455 of yacc.c */ -#line 294 "grammar.y" +#line 326 "grammar.y" { (yyval.meta) = reduce_metas(yyscanner, NULL, (yyvsp[(1) - (1)].meta)); @@ -1939,9 +1896,7 @@ YYSTYPE yylval; break; case 21: - -/* Line 1455 of yacc.c */ -#line 303 "grammar.y" +#line 335 "grammar.y" { (yyval.meta) = reduce_metas(yyscanner, (yyvsp[(1) - (2)].meta), (yyvsp[(2) - (2)].meta)); @@ -1954,9 +1909,7 @@ YYSTYPE yylval; break; case 22: - -/* Line 1455 of yacc.c */ -#line 314 "grammar.y" +#line 346 "grammar.y" { (yyval.meta) = reduce_meta_declaration(yyscanner, META_TYPE_STRING, (yyvsp[(1) - (3)].c_string), 0, (yyvsp[(3) - (3)].sized_string)); @@ -1969,9 +1922,7 @@ YYSTYPE yylval; break; case 23: - -/* Line 1455 of yacc.c */ -#line 323 "grammar.y" +#line 355 "grammar.y" { (yyval.meta) = reduce_meta_declaration(yyscanner, META_TYPE_INTEGER, (yyvsp[(1) - (3)].c_string), (yyvsp[(3) - (3)].integer), NULL); @@ -1984,9 +1935,7 @@ YYSTYPE yylval; break; case 24: - -/* Line 1455 of yacc.c */ -#line 332 "grammar.y" +#line 364 "grammar.y" { (yyval.meta) = reduce_meta_declaration(yyscanner, META_TYPE_BOOLEAN, (yyvsp[(1) - (3)].c_string), TRUE, NULL); @@ -1999,9 +1948,7 @@ YYSTYPE yylval; break; case 25: - -/* Line 1455 of yacc.c */ -#line 341 "grammar.y" +#line 373 "grammar.y" { (yyval.meta) = reduce_meta_declaration(yyscanner, META_TYPE_BOOLEAN, (yyvsp[(1) - (3)].c_string), FALSE, NULL); @@ -2014,9 +1961,7 @@ YYSTYPE yylval; break; case 26: - -/* Line 1455 of yacc.c */ -#line 353 "grammar.y" +#line 385 "grammar.y" { (yyval.string) = reduce_strings(yyscanner,NULL,(yyvsp[(1) - (1)].string)); @@ -2029,9 +1974,7 @@ YYSTYPE yylval; break; case 27: - -/* Line 1455 of yacc.c */ -#line 363 "grammar.y" +#line 395 "grammar.y" { (yyval.string) = reduce_strings(yyscanner,(yyvsp[(1) - (2)].string),(yyvsp[(2) - (2)].string)); @@ -2044,9 +1987,7 @@ YYSTYPE yylval; break; case 28: - -/* Line 1455 of yacc.c */ -#line 375 "grammar.y" +#line 407 "grammar.y" { (yyval.string) = reduce_string_declaration(yyscanner, (yyvsp[(1) - (4)].term), (yyvsp[(3) - (4)].sized_string), (yyvsp[(4) - (4)].integer)); @@ -2059,9 +2000,7 @@ YYSTYPE yylval; break; case 29: - -/* Line 1455 of yacc.c */ -#line 385 "grammar.y" +#line 417 "grammar.y" { (yyval.string) = reduce_string_declaration(yyscanner, (yyvsp[(1) - (4)].term), (yyvsp[(3) - (4)].sized_string), (yyvsp[(4) - (4)].integer) | STRING_FLAGS_REGEXP); @@ -2074,9 +2013,7 @@ YYSTYPE yylval; break; case 30: - -/* Line 1455 of yacc.c */ -#line 395 "grammar.y" +#line 427 "grammar.y" { (yyval.string) = reduce_string_declaration(yyscanner, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].sized_string), STRING_FLAGS_HEXADECIMAL); @@ -2089,65 +2026,47 @@ YYSTYPE yylval; break; case 31: - -/* Line 1455 of yacc.c */ -#line 406 "grammar.y" +#line 438 "grammar.y" { (yyval.integer) = 0; } break; case 32: - -/* Line 1455 of yacc.c */ -#line 407 "grammar.y" +#line 439 "grammar.y" { (yyval.integer) = (yyvsp[(1) - (2)].integer) | (yyvsp[(2) - (2)].integer); } break; case 33: - -/* Line 1455 of yacc.c */ -#line 410 "grammar.y" +#line 442 "grammar.y" { (yyval.integer) = STRING_FLAGS_WIDE; } break; case 34: - -/* Line 1455 of yacc.c */ -#line 411 "grammar.y" +#line 443 "grammar.y" { (yyval.integer) = STRING_FLAGS_ASCII; } break; case 35: - -/* Line 1455 of yacc.c */ -#line 412 "grammar.y" +#line 444 "grammar.y" { (yyval.integer) = STRING_FLAGS_NO_CASE; } break; case 36: - -/* Line 1455 of yacc.c */ -#line 413 "grammar.y" +#line 445 "grammar.y" { (yyval.integer) = STRING_FLAGS_FULL_WORD; } break; case 37: - -/* Line 1455 of yacc.c */ -#line 416 "grammar.y" +#line 448 "grammar.y" { (yyval.term) = reduce_constant(yyscanner, 1); } break; case 38: - -/* Line 1455 of yacc.c */ -#line 417 "grammar.y" +#line 449 "grammar.y" { (yyval.term) = reduce_constant(yyscanner, 0); } break; case 39: - -/* Line 1455 of yacc.c */ -#line 419 "grammar.y" +#line 451 "grammar.y" { (yyval.term) = reduce_identifier(yyscanner, (yyvsp[(1) - (1)].c_string)); @@ -2160,9 +2079,7 @@ YYSTYPE yylval; break; case 40: - -/* Line 1455 of yacc.c */ -#line 429 "grammar.y" +#line 461 "grammar.y" { (yyval.term) = reduce_string_operation(yyscanner, TERM_TYPE_STRING_MATCH, (yyvsp[(1) - (3)].c_string), (yyvsp[(3) - (3)].sized_string)); @@ -2175,9 +2092,7 @@ YYSTYPE yylval; break; case 41: - -/* Line 1455 of yacc.c */ -#line 439 "grammar.y" +#line 471 "grammar.y" { (yyval.term) = reduce_string_operation(yyscanner, TERM_TYPE_STRING_CONTAINS, (yyvsp[(1) - (3)].c_string), (yyvsp[(3) - (3)].sized_string)); @@ -2190,9 +2105,7 @@ YYSTYPE yylval; break; case 42: - -/* Line 1455 of yacc.c */ -#line 449 "grammar.y" +#line 481 "grammar.y" { (yyval.term) = reduce_string(yyscanner, (yyvsp[(1) - (1)].term)); @@ -2205,9 +2118,7 @@ YYSTYPE yylval; break; case 43: - -/* Line 1455 of yacc.c */ -#line 459 "grammar.y" +#line 491 "grammar.y" { (yyval.term) = reduce_string_at(yyscanner, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term)); @@ -2220,18 +2131,14 @@ YYSTYPE yylval; break; case 44: - -/* Line 1455 of yacc.c */ -#line 469 "grammar.y" +#line 501 "grammar.y" { (yyval.term) = NULL; } break; case 45: - -/* Line 1455 of yacc.c */ -#line 473 "grammar.y" +#line 505 "grammar.y" { (yyval.term) = reduce_string_in_range(yyscanner, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term)); @@ -2244,9 +2151,7 @@ YYSTYPE yylval; break; case 46: - -/* Line 1455 of yacc.c */ -#line 483 "grammar.y" +#line 515 "grammar.y" { (yyval.term) = reduce_string_in_section_by_name(yyscanner, (yyvsp[(1) - (6)].term), (yyvsp[(5) - (6)].sized_string)); @@ -2259,18 +2164,14 @@ YYSTYPE yylval; break; case 47: - -/* Line 1455 of yacc.c */ -#line 493 "grammar.y" +#line 525 "grammar.y" { yr_define_integer_variable(yyget_extra(yyscanner), (yyvsp[(3) - (6)].c_string), 0); } break; case 48: - -/* Line 1455 of yacc.c */ -#line 497 "grammar.y" +#line 529 "grammar.y" { (yyval.term) = reduce_integer_for(yyscanner, (yyvsp[(2) - (10)].term), (yyvsp[(3) - (10)].c_string), (yyvsp[(5) - (10)].term), (yyvsp[(9) - (10)].term)); @@ -2283,18 +2184,14 @@ YYSTYPE yylval; break; case 49: - -/* Line 1455 of yacc.c */ -#line 507 "grammar.y" +#line 539 "grammar.y" { yyget_extra(yyscanner)->inside_for++; } break; case 50: - -/* Line 1455 of yacc.c */ -#line 511 "grammar.y" +#line 543 "grammar.y" { yyget_extra(yyscanner)->inside_for--; @@ -2309,9 +2206,7 @@ YYSTYPE yylval; break; case 51: - -/* Line 1455 of yacc.c */ -#line 523 "grammar.y" +#line 555 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_OF, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); @@ -2324,135 +2219,97 @@ YYSTYPE yylval; break; case 52: - -/* Line 1455 of yacc.c */ -#line 532 "grammar.y" +#line 564 "grammar.y" { (yyval.term) = NULL; } break; case 53: - -/* Line 1455 of yacc.c */ -#line 533 "grammar.y" +#line 565 "grammar.y" { (yyval.term) = (yyvsp[(2) - (3)].term); } break; case 54: - -/* Line 1455 of yacc.c */ -#line 534 "grammar.y" +#line 566 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_NOT, (yyvsp[(2) - (2)].term), NULL, NULL); } break; case 55: - -/* Line 1455 of yacc.c */ -#line 535 "grammar.y" +#line 567 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_AND, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 56: - -/* Line 1455 of yacc.c */ -#line 536 "grammar.y" +#line 568 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_OR, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 57: - -/* Line 1455 of yacc.c */ -#line 538 "grammar.y" +#line 570 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_LT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 58: - -/* Line 1455 of yacc.c */ -#line 539 "grammar.y" +#line 571 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_GT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 59: - -/* Line 1455 of yacc.c */ -#line 540 "grammar.y" +#line 572 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_LE, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 60: - -/* Line 1455 of yacc.c */ -#line 541 "grammar.y" +#line 573 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_GE, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 61: - -/* Line 1455 of yacc.c */ -#line 542 "grammar.y" +#line 574 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_EQ, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 62: - -/* Line 1455 of yacc.c */ -#line 543 "grammar.y" +#line 575 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_EQ, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 63: - -/* Line 1455 of yacc.c */ -#line 544 "grammar.y" +#line 576 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_NOT_EQ, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 64: - -/* Line 1455 of yacc.c */ -#line 549 "grammar.y" +#line 581 "grammar.y" { (yyval.term) = (yyvsp[(2) - (3)].term); } break; case 65: - -/* Line 1455 of yacc.c */ -#line 550 "grammar.y" +#line 582 "grammar.y" { (yyval.term) = (yyvsp[(1) - (1)].term); } break; case 67: - -/* Line 1455 of yacc.c */ -#line 554 "grammar.y" +#line 586 "grammar.y" { (yyval.term) = reduce_integer_enumeration(yyscanner, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term)); } break; case 68: - -/* Line 1455 of yacc.c */ -#line 559 "grammar.y" +#line 591 "grammar.y" { (yyval.term) = (yyvsp[(2) - (3)].term); } break; case 69: - -/* Line 1455 of yacc.c */ -#line 560 "grammar.y" +#line 592 "grammar.y" { (yyval.term) = reduce_string_with_wildcard(yyscanner, yr_strdup("$*")); } break; case 71: - -/* Line 1455 of yacc.c */ -#line 564 "grammar.y" +#line 596 "grammar.y" { (yyval.term) = reduce_string_enumeration(yyscanner, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term)); } break; case 72: - -/* Line 1455 of yacc.c */ -#line 568 "grammar.y" +#line 600 "grammar.y" { (yyval.term) = reduce_string(yyscanner, (yyvsp[(1) - (1)].term)); @@ -2465,9 +2322,7 @@ YYSTYPE yylval; break; case 73: - -/* Line 1455 of yacc.c */ -#line 578 "grammar.y" +#line 610 "grammar.y" { (yyval.term) = reduce_string_with_wildcard(yyscanner, (yyvsp[(1) - (1)].term)); @@ -2480,86 +2335,62 @@ YYSTYPE yylval; break; case 74: - -/* Line 1455 of yacc.c */ -#line 591 "grammar.y" +#line 623 "grammar.y" { (yyval.term) = reduce_range(yyscanner, (yyvsp[(2) - (6)].term), (yyvsp[(5) - (6)].term)); } break; case 76: - -/* Line 1455 of yacc.c */ -#line 596 "grammar.y" +#line 628 "grammar.y" { (yyval.term) = reduce_constant(yyscanner, 0); } break; case 77: - -/* Line 1455 of yacc.c */ -#line 597 "grammar.y" +#line 629 "grammar.y" { (yyval.term) = reduce_constant(yyscanner, 1); } break; case 78: - -/* Line 1455 of yacc.c */ -#line 601 "grammar.y" +#line 633 "grammar.y" { (yyval.term) = reduce_filesize(yyscanner); } break; case 79: - -/* Line 1455 of yacc.c */ -#line 602 "grammar.y" +#line 634 "grammar.y" { (yyval.term) = reduce_entrypoint(yyscanner); } break; case 80: - -/* Line 1455 of yacc.c */ -#line 603 "grammar.y" +#line 635 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_INT8_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 81: - -/* Line 1455 of yacc.c */ -#line 604 "grammar.y" +#line 636 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_INT16_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 82: - -/* Line 1455 of yacc.c */ -#line 605 "grammar.y" +#line 637 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_INT32_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 83: - -/* Line 1455 of yacc.c */ -#line 606 "grammar.y" +#line 638 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_UINT8_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 84: - -/* Line 1455 of yacc.c */ -#line 607 "grammar.y" +#line 639 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_UINT16_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 85: - -/* Line 1455 of yacc.c */ -#line 608 "grammar.y" +#line 640 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_UINT32_AT_OFFSET, (yyvsp[(3) - (4)].term), NULL, NULL); } break; case 86: - -/* Line 1455 of yacc.c */ -#line 610 "grammar.y" +#line 642 "grammar.y" { (yyval.term) = reduce_string_count(yyscanner, (yyvsp[(1) - (1)].term)); @@ -2572,9 +2403,7 @@ YYSTYPE yylval; break; case 87: - -/* Line 1455 of yacc.c */ -#line 620 "grammar.y" +#line 652 "grammar.y" { (yyval.term) = reduce_string_offset(yyscanner, (yyvsp[(1) - (4)].term), (yyvsp[(3) - (4)].term)); @@ -2587,9 +2416,7 @@ YYSTYPE yylval; break; case 88: - -/* Line 1455 of yacc.c */ -#line 630 "grammar.y" +#line 662 "grammar.y" { (yyval.term) = reduce_identifier(yyscanner, (yyvsp[(1) - (1)].c_string)); @@ -2602,86 +2429,63 @@ YYSTYPE yylval; break; case 89: - -/* Line 1455 of yacc.c */ -#line 639 "grammar.y" +#line 671 "grammar.y" { (yyval.term) = (yyvsp[(2) - (3)].term); } break; case 90: - -/* Line 1455 of yacc.c */ -#line 640 "grammar.y" +#line 672 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_ADD, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 91: - -/* Line 1455 of yacc.c */ -#line 641 "grammar.y" +#line 673 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_SUB, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 92: - -/* Line 1455 of yacc.c */ -#line 642 "grammar.y" +#line 674 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_MUL, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 93: - -/* Line 1455 of yacc.c */ -#line 643 "grammar.y" +#line 675 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_DIV, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 94: - -/* Line 1455 of yacc.c */ -#line 644 "grammar.y" +#line 676 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_BITWISE_AND, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 95: - -/* Line 1455 of yacc.c */ -#line 645 "grammar.y" +#line 677 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_BITWISE_OR, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 96: - -/* Line 1455 of yacc.c */ -#line 646 "grammar.y" +#line 678 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_BITWISE_NOT, (yyvsp[(2) - (2)].term), NULL, NULL); } break; case 97: - -/* Line 1455 of yacc.c */ -#line 647 "grammar.y" +#line 679 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_SHIFT_LEFT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 98: - -/* Line 1455 of yacc.c */ -#line 648 "grammar.y" +#line 680 "grammar.y" { (yyval.term) = reduce_term(yyscanner, TERM_TYPE_SHIFT_RIGHT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), NULL); } break; case 100: - -/* Line 1455 of yacc.c */ -#line 652 "grammar.y" +#line 684 "grammar.y" { (yyval.term) = reduce_constant(yyscanner, (yyvsp[(1) - (1)].integer)); } break; - -/* Line 1455 of yacc.c */ -#line 2685 "grammar.c" +/* Line 1267 of yacc.c. */ +#line 2489 "grammar.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2692,6 +2496,7 @@ YYSTYPE yylval; *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2756,7 +2561,7 @@ YYSTYPE yylval; if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -2773,7 +2578,7 @@ YYSTYPE yylval; } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -2830,6 +2635,9 @@ YYSTYPE yylval; YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; @@ -2854,7 +2662,7 @@ YYSTYPE yylval; yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2865,7 +2673,7 @@ YYSTYPE yylval; #endif yyreturn: - if (yychar != YYEMPTY) + if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, yyscanner); /* Do not reclaim the symbols of the rule which action triggered @@ -2891,9 +2699,7 @@ YYSTYPE yylval; } - -/* Line 1675 of yacc.c */ -#line 660 "grammar.y" +#line 692 "grammar.y" diff --git a/libyara/grammar.h b/libyara/grammar.h index eb1ef623e5..5a35db0af8 100644 --- a/libyara/grammar.h +++ b/libyara/grammar.h @@ -1,23 +1,24 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify + + This program 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. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program 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 this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -28,11 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -170,11 +170,8 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE +#line 148 "grammar.y" { - -/* Line 1676 of yacc.c */ -#line 116 "grammar.y" - void* sized_string; char* c_string; @@ -184,17 +181,14 @@ typedef union YYSTYPE void* tag; void* meta; - - - -/* Line 1676 of yacc.c */ -#line 192 "grammar.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 1529 of yacc.c. */ +#line 187 "grammar.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif - diff --git a/libyara/grammar.y b/libyara/grammar.y index a20615669f..1a6f059035 100644 --- a/libyara/grammar.y +++ b/libyara/grammar.y @@ -1,3 +1,35 @@ +/* +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +*/ %{ diff --git a/libyara/hash.c b/libyara/hash.c index 39a445a3b0..4a65c2b43f 100644 --- a/libyara/hash.c +++ b/libyara/hash.c @@ -1,17 +1,34 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +All rights reserved. -Copyright(c) 2012. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. +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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include "hash.h" diff --git a/libyara/hash.h b/libyara/hash.h index b886be78b5..903a0fd9e4 100644 --- a/libyara/hash.h +++ b/libyara/hash.h @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2012. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #ifndef _HASH_H diff --git a/libyara/lex.c b/libyara/lex.c index 7b37085b84..dae9f334d8 100644 --- a/libyara/lex.c +++ b/libyara/lex.c @@ -619,8 +619,40 @@ static yyconst flex_int32_t yy_rule_can_match_eol[77] = #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "lex.l" +/* +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +*/ /* Lexical analyzer for YARA */ -#line 4 "lex.l" +#line 37 "lex.l" #include #include @@ -658,7 +690,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[77] = -#line 662 "lex.c" +#line 694 "lex.c" #define INITIAL 0 #define str 1 @@ -894,10 +926,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 55 "lex.l" +#line 88 "lex.l" -#line 901 "lex.c" +#line 933 "lex.c" yylval = yylval_param; @@ -996,243 +1028,243 @@ YY_DECL case 1: YY_RULE_SETUP -#line 57 "lex.l" +#line 90 "lex.l" { return _LT_; } YY_BREAK case 2: YY_RULE_SETUP -#line 58 "lex.l" +#line 91 "lex.l" { return _GT_; } YY_BREAK case 3: YY_RULE_SETUP -#line 59 "lex.l" +#line 92 "lex.l" { return _LE_; } YY_BREAK case 4: YY_RULE_SETUP -#line 60 "lex.l" +#line 93 "lex.l" { return _GE_; } YY_BREAK case 5: YY_RULE_SETUP -#line 61 "lex.l" +#line 94 "lex.l" { return _EQ_; } YY_BREAK case 6: YY_RULE_SETUP -#line 62 "lex.l" +#line 95 "lex.l" { return _NEQ_; } YY_BREAK case 7: YY_RULE_SETUP -#line 63 "lex.l" +#line 96 "lex.l" { return _SHIFT_LEFT_; } YY_BREAK case 8: YY_RULE_SETUP -#line 64 "lex.l" +#line 97 "lex.l" { return _SHIFT_RIGHT_; } YY_BREAK case 9: YY_RULE_SETUP -#line 65 "lex.l" +#line 98 "lex.l" { return _PRIVATE_; } YY_BREAK case 10: YY_RULE_SETUP -#line 66 "lex.l" +#line 99 "lex.l" { return _GLOBAL_; } YY_BREAK case 11: YY_RULE_SETUP -#line 67 "lex.l" +#line 100 "lex.l" { return _RULE_; } YY_BREAK case 12: YY_RULE_SETUP -#line 68 "lex.l" +#line 101 "lex.l" { return _META_; } YY_BREAK case 13: YY_RULE_SETUP -#line 69 "lex.l" +#line 102 "lex.l" { return _STRINGS_; } YY_BREAK case 14: YY_RULE_SETUP -#line 70 "lex.l" +#line 103 "lex.l" { return _ASCII_; } YY_BREAK case 15: YY_RULE_SETUP -#line 71 "lex.l" +#line 104 "lex.l" { return _WIDE_; } YY_BREAK case 16: YY_RULE_SETUP -#line 72 "lex.l" +#line 105 "lex.l" { return _FULLWORD_; } YY_BREAK case 17: YY_RULE_SETUP -#line 73 "lex.l" +#line 106 "lex.l" { return _NOCASE_; } YY_BREAK case 18: YY_RULE_SETUP -#line 74 "lex.l" +#line 107 "lex.l" { return _CONDITION_; } YY_BREAK case 19: YY_RULE_SETUP -#line 75 "lex.l" +#line 108 "lex.l" { return _TRUE_; } YY_BREAK case 20: YY_RULE_SETUP -#line 76 "lex.l" +#line 109 "lex.l" { return _FALSE_; } YY_BREAK case 21: YY_RULE_SETUP -#line 77 "lex.l" +#line 110 "lex.l" { return _NOT_; } YY_BREAK case 22: YY_RULE_SETUP -#line 78 "lex.l" +#line 111 "lex.l" { return _AND_; } YY_BREAK case 23: YY_RULE_SETUP -#line 79 "lex.l" +#line 112 "lex.l" { return _OR_; } YY_BREAK case 24: YY_RULE_SETUP -#line 80 "lex.l" +#line 113 "lex.l" { return _AT_; } YY_BREAK case 25: YY_RULE_SETUP -#line 81 "lex.l" +#line 114 "lex.l" { return _IN_; } YY_BREAK case 26: YY_RULE_SETUP -#line 82 "lex.l" +#line 115 "lex.l" { return _OF_; } YY_BREAK case 27: YY_RULE_SETUP -#line 83 "lex.l" +#line 116 "lex.l" { return _THEM_; } YY_BREAK case 28: YY_RULE_SETUP -#line 84 "lex.l" +#line 117 "lex.l" { return _FOR_; } YY_BREAK case 29: YY_RULE_SETUP -#line 85 "lex.l" +#line 118 "lex.l" { return _ALL_; } YY_BREAK case 30: YY_RULE_SETUP -#line 86 "lex.l" +#line 119 "lex.l" { return _ANY_; } YY_BREAK case 31: YY_RULE_SETUP -#line 87 "lex.l" +#line 120 "lex.l" { return _ENTRYPOINT_; } YY_BREAK case 32: YY_RULE_SETUP -#line 88 "lex.l" +#line 121 "lex.l" { return _SIZE_; } YY_BREAK case 33: YY_RULE_SETUP -#line 89 "lex.l" +#line 122 "lex.l" { return _RVA_; } YY_BREAK case 34: YY_RULE_SETUP -#line 90 "lex.l" +#line 123 "lex.l" { return _OFFSET_; } YY_BREAK case 35: YY_RULE_SETUP -#line 91 "lex.l" +#line 124 "lex.l" { return _FILE_; } YY_BREAK case 36: YY_RULE_SETUP -#line 92 "lex.l" +#line 125 "lex.l" { return _SECTION_; } YY_BREAK case 37: YY_RULE_SETUP -#line 93 "lex.l" +#line 126 "lex.l" { return _UINT8_; } YY_BREAK case 38: YY_RULE_SETUP -#line 94 "lex.l" +#line 127 "lex.l" { return _UINT16_; } YY_BREAK case 39: YY_RULE_SETUP -#line 95 "lex.l" +#line 128 "lex.l" { return _UINT32_; } YY_BREAK case 40: YY_RULE_SETUP -#line 96 "lex.l" +#line 129 "lex.l" { return _INT8_; } YY_BREAK case 41: YY_RULE_SETUP -#line 97 "lex.l" +#line 130 "lex.l" { return _INT16_; } YY_BREAK case 42: YY_RULE_SETUP -#line 98 "lex.l" +#line 131 "lex.l" { return _INT32_; } YY_BREAK case 43: YY_RULE_SETUP -#line 99 "lex.l" +#line 132 "lex.l" { return _MATCHES_; } YY_BREAK case 44: YY_RULE_SETUP -#line 100 "lex.l" +#line 133 "lex.l" { return _CONTAINS_; } YY_BREAK case 45: YY_RULE_SETUP -#line 101 "lex.l" +#line 134 "lex.l" { return _INDEX_; } YY_BREAK case 46: /* rule 46 can match eol */ YY_RULE_SETUP -#line 104 "lex.l" +#line 137 "lex.l" { /* skip comments */ } YY_BREAK case 47: YY_RULE_SETUP -#line 106 "lex.l" +#line 139 "lex.l" { /* skip single-line comments */ } YY_BREAK case 48: YY_RULE_SETUP -#line 108 "lex.l" +#line 141 "lex.l" { yyextra->lex_buf_ptr = yyextra->lex_buf; yyextra->lex_buf_len = 0; @@ -1242,14 +1274,14 @@ YY_RULE_SETUP case 49: /* rule 49 can match eol */ YY_RULE_SETUP -#line 114 "lex.l" +#line 147 "lex.l" { YYTEXT_TO_BUFFER; } YY_BREAK case 50: YY_RULE_SETUP -#line 118 "lex.l" +#line 151 "lex.l" { char buffer[1024]; char *current_file_name; @@ -1348,7 +1380,7 @@ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(str): case YY_STATE_EOF(regexp): case YY_STATE_EOF(include): -#line 212 "lex.l" +#line 245 "lex.l" { YARA_CONTEXT* context = yyget_extra(yyscanner); FILE* file = yr_pop_file(context); @@ -1369,7 +1401,7 @@ case YY_STATE_EOF(include): YY_BREAK case 51: YY_RULE_SETUP -#line 231 "lex.l" +#line 264 "lex.l" { yylval->c_string = (char*) yr_strdup(yytext); return _STRING_IDENTIFIER_WITH_WILDCARD_; @@ -1377,7 +1409,7 @@ YY_RULE_SETUP YY_BREAK case 52: YY_RULE_SETUP -#line 236 "lex.l" +#line 269 "lex.l" { yylval->c_string = (char*) yr_strdup(yytext); return _STRING_IDENTIFIER_; @@ -1385,7 +1417,7 @@ YY_RULE_SETUP YY_BREAK case 53: YY_RULE_SETUP -#line 242 "lex.l" +#line 275 "lex.l" { yylval->c_string = (char*) yr_strdup(yytext); yylval->c_string[0] = '$'; /* replace # by $*/ @@ -1394,7 +1426,7 @@ YY_RULE_SETUP YY_BREAK case 54: YY_RULE_SETUP -#line 248 "lex.l" +#line 281 "lex.l" { yylval->c_string = (char*) yr_strdup(yytext); yylval->c_string[0] = '$'; /* replace @ by $*/ @@ -1403,7 +1435,7 @@ YY_RULE_SETUP YY_BREAK case 55: YY_RULE_SETUP -#line 254 "lex.l" +#line 287 "lex.l" { if (strlen(yytext) > 128) { @@ -1416,7 +1448,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 264 "lex.l" +#line 297 "lex.l" { yylval->integer = (size_t) atol(yytext); @@ -1433,7 +1465,7 @@ YY_RULE_SETUP YY_BREAK case 57: YY_RULE_SETUP -#line 278 "lex.l" +#line 311 "lex.l" { yylval->integer = xtoi(yytext + 2); return _NUMBER_; @@ -1441,7 +1473,7 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 283 "lex.l" +#line 316 "lex.l" { /* saw closing quote - all done */ SIZED_STRING* s; @@ -1468,22 +1500,22 @@ YY_RULE_SETUP YY_BREAK case 59: YY_RULE_SETUP -#line 307 "lex.l" +#line 340 "lex.l" { LEX_CHECK_SPACE_OK("\t", yyextra->lex_buf_len, LEX_BUF_SIZE); *yyextra->lex_buf_ptr++ = '\t'; yyextra->lex_buf_len++;} YY_BREAK case 60: YY_RULE_SETUP -#line 308 "lex.l" +#line 341 "lex.l" { LEX_CHECK_SPACE_OK("\"", yyextra->lex_buf_len, LEX_BUF_SIZE); *yyextra->lex_buf_ptr++ = '\"'; yyextra->lex_buf_len++;} YY_BREAK case 61: YY_RULE_SETUP -#line 309 "lex.l" +#line 342 "lex.l" { LEX_CHECK_SPACE_OK("\\", yyextra->lex_buf_len, LEX_BUF_SIZE); *yyextra->lex_buf_ptr++ = '\\'; yyextra->lex_buf_len++;} YY_BREAK case 62: YY_RULE_SETUP -#line 311 "lex.l" +#line 344 "lex.l" { int result; @@ -1495,7 +1527,7 @@ YY_RULE_SETUP YY_BREAK case 63: YY_RULE_SETUP -#line 320 "lex.l" +#line 353 "lex.l" { YYTEXT_TO_BUFFER; } @@ -1503,7 +1535,7 @@ YY_RULE_SETUP case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 324 "lex.l" +#line 357 "lex.l" { yyerror(yyscanner, "unterminated string"); yyterminate(); @@ -1512,14 +1544,14 @@ YY_RULE_SETUP case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 329 "lex.l" +#line 362 "lex.l" { yyerror(yyscanner, "illegal escape sequence"); } YY_BREAK case 66: YY_RULE_SETUP -#line 334 "lex.l" +#line 367 "lex.l" { SIZED_STRING* s; @@ -1544,7 +1576,7 @@ YY_RULE_SETUP YY_BREAK case 67: YY_RULE_SETUP -#line 356 "lex.l" +#line 389 "lex.l" { LEX_CHECK_SPACE_OK("/", yyextra->lex_buf_len, LEX_BUF_SIZE); *yyextra->lex_buf_ptr++ = '/'; @@ -1553,7 +1585,7 @@ YY_RULE_SETUP YY_BREAK case 68: YY_RULE_SETUP -#line 362 "lex.l" +#line 395 "lex.l" { LEX_CHECK_SPACE_OK("\\.", yyextra->lex_buf_len, LEX_BUF_SIZE); *yyextra->lex_buf_ptr++ = yytext[0]; @@ -1563,7 +1595,7 @@ YY_RULE_SETUP YY_BREAK case 69: YY_RULE_SETUP -#line 369 "lex.l" +#line 402 "lex.l" { YYTEXT_TO_BUFFER; } @@ -1571,7 +1603,7 @@ YY_RULE_SETUP case 70: /* rule 70 can match eol */ YY_RULE_SETUP -#line 373 "lex.l" +#line 406 "lex.l" { yyerror(yyscanner, "unterminated regular expression"); yyterminate(); @@ -1579,7 +1611,7 @@ YY_RULE_SETUP YY_BREAK case 71: YY_RULE_SETUP -#line 378 "lex.l" +#line 411 "lex.l" { yyextra->lex_buf_ptr = yyextra->lex_buf; yyextra->lex_buf_len = 0; @@ -1588,7 +1620,7 @@ YY_RULE_SETUP YY_BREAK case 72: YY_RULE_SETUP -#line 384 "lex.l" +#line 417 "lex.l" { yyextra->lex_buf_ptr = yyextra->lex_buf; yyextra->lex_buf_len = 0; @@ -1598,7 +1630,7 @@ YY_RULE_SETUP case 73: /* rule 73 can match eol */ YY_RULE_SETUP -#line 390 "lex.l" +#line 423 "lex.l" { int len = strlen(yytext); @@ -1616,22 +1648,22 @@ YY_RULE_SETUP case 74: /* rule 74 can match eol */ YY_RULE_SETUP -#line 404 "lex.l" +#line 437 "lex.l" /* skip whitespace */ YY_BREAK case 75: YY_RULE_SETUP -#line 406 "lex.l" +#line 439 "lex.l" { return yytext[0]; } YY_BREAK case 76: YY_RULE_SETUP -#line 409 "lex.l" +#line 442 "lex.l" ECHO; YY_BREAK -#line 1635 "lex.c" +#line 1667 "lex.c" case YY_END_OF_BUFFER: { @@ -2806,7 +2838,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 409 "lex.l" +#line 442 "lex.l" diff --git a/libyara/lex.h b/libyara/lex.h index 9be52e8976..6346d8d4f7 100644 --- a/libyara/lex.h +++ b/libyara/lex.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include "yara.h" diff --git a/libyara/lex.l b/libyara/lex.l index 10caa27f08..08b3200b93 100644 --- a/libyara/lex.l +++ b/libyara/lex.l @@ -1,3 +1,36 @@ +/* +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +*/ + /* Lexical analyzer for YARA */ %{ diff --git a/libyara/libyara.c b/libyara/libyara.c index 9e8d6197ce..398d7ea11e 100644 --- a/libyara/libyara.c +++ b/libyara/libyara.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include diff --git a/libyara/mem.c b/libyara/mem.c index 72d3d6393d..9dc5a6f83e 100644 --- a/libyara/mem.c +++ b/libyara/mem.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifdef WIN32 diff --git a/libyara/pe.h b/libyara/pe.h index 8e49784470..c93bb14ecf 100644 --- a/libyara/pe.h +++ b/libyara/pe.h @@ -1,3 +1,35 @@ +/* +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +*/ #include #include diff --git a/libyara/proc.c b/libyara/proc.c index 020a2f6185..9bb060c02e 100644 --- a/libyara/proc.c +++ b/libyara/proc.c @@ -1,22 +1,21 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com] & + Stefan Buehlmann [stefan.buehlmann@joebox.org]. -Copyright(c) 2010. Victor M. Alvarez [plusvic@gmail.com] & - Stefan Buehlmann [stefan.buehlmann@joebox.org]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ - #ifdef WIN32 #include diff --git a/libyara/proc.h b/libyara/proc.h index 517f5693a6..2c706b2537 100644 --- a/libyara/proc.h +++ b/libyara/proc.h @@ -1,18 +1,18 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com] & + Stefan Buehlmann [stefan.buehlmann@joebox.org]. -Copyright(c) 2010. Victor M. Alvarez [plusvic@gmail.com] & - Stefan Buehlmann [stefan.buehlmann@joebox.org]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ diff --git a/libyara/regex.h b/libyara/regex.h index 4610f9ce64..a983bac1c0 100644 --- a/libyara/regex.h +++ b/libyara/regex.h @@ -1,15 +1,17 @@ /* Copyright(c) 2011, Google, Inc. [mjwiacek@google.com]. -This program 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 2, or (at your option) -any later version. - -This program 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. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #ifndef _REGEX_H diff --git a/libyara/regex/regex-pcre.c b/libyara/regex/regex-pcre.c index 56c362f9ea..0eeda31f65 100644 --- a/libyara/regex/regex-pcre.c +++ b/libyara/regex/regex-pcre.c @@ -1,17 +1,34 @@ /* - Copyright(c) 2011, Google, Inc. [mjwiacek@google.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Google, Inc. and its + contributors. +4. Neither the name of Google, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include "regex.h" diff --git a/libyara/regex/regex-re2.cc b/libyara/regex/regex-re2.cc index d349f22efa..5db459ce9f 100644 --- a/libyara/regex/regex-re2.cc +++ b/libyara/regex/regex-re2.cc @@ -1,17 +1,17 @@ /* - Copyright(c) 2011, Google, Inc. [mjwiacek@google.com]. -This program 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 2, or (at your option) -any later version. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #include "regex.h" diff --git a/libyara/scan.c b/libyara/scan.c index 9bf81a4a56..38aa51c60f 100644 --- a/libyara/scan.c +++ b/libyara/scan.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include diff --git a/libyara/scan.h b/libyara/scan.h index 3d010e12b8..46e1bda102 100644 --- a/libyara/scan.h +++ b/libyara/scan.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifndef _SCAN_H diff --git a/libyara/sizedstr.h b/libyara/sizedstr.h index ae075cedd3..5302649a0b 100644 --- a/libyara/sizedstr.h +++ b/libyara/sizedstr.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifndef _SIZEDSTR_H diff --git a/libyara/weight.c b/libyara/weight.c index 26607a76a1..336a7a2d68 100644 --- a/libyara/weight.c +++ b/libyara/weight.c @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #include "weight.h" diff --git a/libyara/weight.h b/libyara/weight.h index 5de7ad8b0c..7ca1dcafa3 100644 --- a/libyara/weight.h +++ b/libyara/weight.h @@ -1,17 +1,34 @@ /* - -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. - +Copyright (c) 2007. Victor M. Alvarez [plusvic@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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ #ifndef _SIZEDSTR_H diff --git a/libyara/xtoi.c b/libyara/xtoi.c index bc7614c15e..d0edfc1553 100644 --- a/libyara/xtoi.c +++ b/libyara/xtoi.c @@ -1,17 +1,34 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +All rights reserved. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. +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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ // diff --git a/libyara/xtoi.h b/libyara/xtoi.h index bd58df17b0..1e3b31d567 100644 --- a/libyara/xtoi.h +++ b/libyara/xtoi.h @@ -1,17 +1,34 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +All rights reserved. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. - -This program 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 2, or (at your option) -any later version. - -This program 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. +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. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Victor M. Alvarez and its + contributors. +4. Neither the name of Victor M. Alvarez nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. */ // diff --git a/libyara/yara.h b/libyara/yara.h index db7ffc346e..2ba9718b84 100644 --- a/libyara/yara.h +++ b/libyara/yara.h @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #ifndef _YARA_H diff --git a/yara-python/yara-python.c b/yara-python/yara-python.c index 6dc5325a9a..7f8240c53e 100644 --- a/yara-python/yara-python.c +++ b/yara-python/yara-python.c @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2008. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ /* headers */ diff --git a/yara.c b/yara.c index def4955e18..975c1db374 100644 --- a/yara.c +++ b/yara.c @@ -1,17 +1,17 @@ /* +Copyright (c) 2007. Victor M. Alvarez [plusvic@gmail.com]. -Copyright(c) 2007. Victor M. Alvarez [plusvic@gmail.com]. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -This program 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 2, or (at your option) -any later version. - -This program 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. + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ #ifndef WIN32