From 2f4f36160ca49f42559bfc8ba21089adbfe917ae Mon Sep 17 00:00:00 2001 From: Humberto Date: Tue, 12 May 2009 07:28:37 -0300 Subject: [PATCH] Com o autor --- LICENSE | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README | 34 ++++++++++++ TODO | 9 ++++ abi.c | 3 ++ allegrex.c | 4 ++ allegrex.h | 4 ++ alloc.c | 3 ++ alloc.h | 3 ++ analyser.c | 3 ++ cfg.c | 3 ++ code.h | 4 ++ constants.c | 3 ++ dataflow.c | 3 ++ decoder.c | 3 ++ graph.c | 3 ++ hash.c | 3 ++ hash.h | 4 ++ lists.c | 3 ++ lists.h | 3 ++ liveness.c | 3 ++ main.c | 4 ++ module.c | 3 ++ nids.c | 3 ++ nids.h | 4 ++ operations.c | 3 ++ outcode.c | 3 ++ outgraph.c | 3 ++ output.c | 3 ++ output.h | 3 ++ prx.c | 3 ++ prx.h | 4 ++ relocs.c | 3 ++ ssa.c | 3 ++ structures.c | 3 ++ subroutines.c | 3 ++ switches.c | 3 ++ types.h | 4 ++ utils.c | 4 ++ utils.h | 4 ++ 39 files changed, 327 insertions(+) create mode 100644 LICENSE create mode 100644 README create mode 100644 TODO diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ea811ce --- /dev/null +++ b/LICENSE @@ -0,0 +1,166 @@ + + The Academic Free License + v. 2.0 + +This Academic Free License (the "License") applies to any original work +of authorship (the "Original Work") whose owner (the "Licensor") has +placed the following notice immediately following the copyright notice +for the Original Work: + + *Licensed under the Academic Free License version 2.0* + +1) *Grant of Copyright License.* Licensor hereby grants You a +world-wide, royalty-free, non-exclusive, perpetual, sublicenseable +license to do the following: + + a) to reproduce the Original Work in copies; + + b) to prepare derivative works ("Derivative Works") based upon the + Original Work; + + c) to distribute copies of the Original Work and Derivative Works to + the public; + + d) to perform the Original Work publicly; and + + e) to display the Original Work publicly. + +2) *Grant of Patent License.* Licensor hereby grants You a world-wide, +royalty-free, non-exclusive, perpetual, sublicenseable license, under +patent claims owned or controlled by the Licensor that are embodied in +the Original Work as furnished by the Licensor, to make, use, sell and +offer for sale the Original Work and Derivative Works. + +3) *Grant of Source Code License.* The term "Source Code" means the +preferred form of the Original Work for making modifications to it and +all available documentation describing how to modify the Original Work. +Licensor hereby agrees to provide a machine-readable copy of the Source +Code of the Original Work along with each copy of the Original Work that +Licensor distributes. Licensor reserves the right to satisfy this +obligation by placing a machine-readable copy of the Source Code in an +information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute +the Original Work, and by publishing the address of that information +repository in a notice immediately following the copyright notice that +applies to the Original Work. + +4) *Exclusions From License Grant. *Neither the names of Licensor, nor +the names of any contributors to the Original Work, nor any of their +trademarks or service marks, may be used to endorse or promote products +derived from this Original Work without express prior written permission +of the Licensor. Nothing in this License shall be deemed to grant any +rights to trademarks, copyrights, patents, trade secrets or any other +intellectual property of Licensor except as expressly stated herein. No +patent license is granted to make, use, sell or offer to sell +embodiments of any patent claims other than the licensed claims defined +in Section 2. No right is granted to the trademarks of Licensor even if +such marks are included in the Original Work. Nothing in this License +shall be interpreted to prohibit Licensor from licensing under different +terms from this License any Original Work that Licensor otherwise would +have a right to license. + +5) This section intentionally omitted. + +6) *Attribution Rights.* You must retain, in the Source Code of any +Derivative Works that You create, all copyright, patent or trademark +notices from the Source Code of the Original Work, as well as any +notices of licensing and any descriptive text identified therein as an +"Attribution Notice." You must cause the Source Code for any Derivative +Works that You create to carry a prominent Attribution Notice reasonably +calculated to inform recipients that You have modified the Original Work. + +7) *Warranty of Provenance and Disclaimer of Warranty.* Licensor +warrants that the copyright in and to the Original Work and the patent +rights granted herein by Licensor are owned by the Licensor or are +sublicensed to You under the terms of this License with the permission +of the contributor(s) of those copyrights and patent rights. Except as +expressly stated in the immediately proceeding sentence, the Original +Work is provided under this License on an "AS IS" BASIS and WITHOUT +WARRANTY, either express or implied, including, without limitation, the +warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL +WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential +part of this License. No license to Original Work is granted hereunder +except under this disclaimer. + +8) *Limitation of Liability.* Under no circumstances and under no legal +theory, whether in tort (including negligence), contract, or otherwise, +shall the Licensor be liable to any person for any direct, indirect, +special, incidental, or consequential damages of any character arising +as a result of this License or the use of the Original Work including, +without limitation, damages for loss of goodwill, work stoppage, +computer failure or malfunction, or any and all other commercial damages +or losses. This limitation of liability shall not apply to liability for +death or personal injury resulting from Licensor's negligence to the +extent applicable law prohibits such limitation. Some jurisdictions do +not allow the exclusion or limitation of incidental or consequential +damages, so this exclusion and limitation may not apply to You. + +9) *Acceptance and Termination.* If You distribute copies of the +Original Work or a Derivative Work, You must make a reasonable effort +under the circumstances to obtain the express assent of recipients to +the terms of this License. Nothing else but this License (or another +written agreement between Licensor and You) grants You permission to +create Derivative Works based upon the Original Work or to exercise any +of the rights granted in Section 1 herein, and any attempt to do so +except under the terms of this License (or another written agreement +between Licensor and You) is expressly prohibited by U.S. copyright law, +the equivalent laws of other countries, and by international treaty. +Therefore, by exercising any of the rights granted to You in Section 1 +herein, You indicate Your acceptance of this License and all of its +terms and conditions. + +10) *Termination for Patent Action.* This License shall terminate +automatically and You may no longer exercise any of the rights granted +to You by this License as of the date You commence an action, including +a cross-claim or counterclaim, for patent infringement (i) against +Licensor with respect to a patent applicable to software or (ii) against +any entity with respect to a patent applicable to the Original Work (but +excluding combinations of the Original Work with other software or +hardware). + +11) *Jurisdiction, Venue and Governing Law.* Any action or suit relating +to this License may be brought only in the courts of a jurisdiction +wherein the Licensor resides or in which Licensor conducts its primary +business, and under the laws of that jurisdiction excluding its +conflict-of-law provisions. The application of the United Nations +Convention on Contracts for the International Sale of Goods is expressly +excluded. Any use of the Original Work outside the scope of this License +or after its termination shall be subject to the requirements and +penalties of the U.S. Copyright Act, 17 U.S.C. ยง 101 et seq., the +equivalent laws of other countries, and international treaty. This +section shall survive the termination of this License. + +12) *Attorneys Fees.* In any action to enforce the terms of this License +or seeking damages relating thereto, the prevailing party shall be +entitled to recover its costs and expenses, including, without +limitation, reasonable attorneys' fees and costs incurred in connection +with such action, including any appeal of such action. This section +shall survive the termination of this License. + +13) *Miscellaneous.* This License represents the complete agreement +concerning the subject matter hereof. If any provision of this License +is held to be unenforceable, such provision shall be reformed only to +the extent necessary to make it enforceable. + +14) *Definition of "You" in This License.* "You" throughout this +License, whether in upper or lower case, means an individual or a legal +entity exercising rights under, and complying with all of the terms of, +this License. For legal entities, "You" includes any entity that +controls, is controlled by, or is under common control with you. For +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. + +15) *Right to Use.* You may use the Original Work in all ways not +otherwise restricted or conditioned by this License or by law, and +Licensor promises not to interfere with or be responsible for such uses +by You. + +This license is Copyright (C) 2003 Lawrence E. Rosen. All rights +reserved. Permission is hereby granted to copy and distribute this +license without modification. This license may not be modified without +the express written permission of its copyright owner. + diff --git a/README b/README new file mode 100644 index 0000000..f53c3de --- /dev/null +++ b/README @@ -0,0 +1,34 @@ +pspdecompiler: A simple tool to decompile Sony PSP(tm) PRX files. + +pspdecompiler is licensed under the AFL v2.0. Please read the LICENSE file for further information. + +Requirements: + - libexpat1-dev + +Compiling: + +make clean +make all + +Usage: + pspdecompiler [-g] [-n nidsfile] [-v] prxfile +Where: + -g output graphviz dot + -t print depth first search number + -r print the reverse depth first search number + -d print the dominator + -x print the reverse dominator + -f print the frontier + -z print the reverse frontier + -p print phi functions + -q print code into nodes + -s print structures + -e print edge types + -c output code + -v increase verbosity + -n specify nids xml file + -i print prx info + + +Special thanks for TyRaNiD + diff --git a/TODO b/TODO new file mode 100644 index 0000000..76a0b8f --- /dev/null +++ b/TODO @@ -0,0 +1,9 @@ +The list is long: + - Support for fpu + - Improve the detection of subroutine args + - Missing shape analysis + - Missing points-to analysis + - Detection of loop types + - Missing type reconstruction (unsigned/signed, size, etc) + - ... + diff --git a/abi.c b/abi.c index 223fbb5..1339388 100644 --- a/abi.c +++ b/abi.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/allegrex.c b/allegrex.c index 1ad9107..3cb99c8 100644 --- a/allegrex.c +++ b/allegrex.c @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + * Special thanks to Tyranid for the prxtool "disasm.C" + */ #include #include diff --git a/allegrex.h b/allegrex.h index b7e39de..d236bdf 100644 --- a/allegrex.h +++ b/allegrex.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __ALLEGREX_H #define __ALLEGREX_H diff --git a/alloc.c b/alloc.c index 1dd8499..a8dc99c 100644 --- a/alloc.c +++ b/alloc.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/alloc.h b/alloc.h index 4cafb70..3f4891c 100644 --- a/alloc.h +++ b/alloc.h @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #ifndef __ALLOC_H #define __ALLOC_H diff --git a/analyser.c b/analyser.c index e1108ed..499bc08 100644 --- a/analyser.c +++ b/analyser.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/cfg.c b/cfg.c index 42b4dce..47fbb23 100644 --- a/cfg.c +++ b/cfg.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/code.h b/code.h index d7ddfa2..f22ed51 100644 --- a/code.h +++ b/code.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __CODE_H #define __CODE_H diff --git a/constants.c b/constants.c index 1a1ef61..bb71ece 100644 --- a/constants.c +++ b/constants.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" diff --git a/dataflow.c b/dataflow.c index 3fffaaf..9551d48 100644 --- a/dataflow.c +++ b/dataflow.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/decoder.c b/decoder.c index 7493c2d..2e2e3e6 100644 --- a/decoder.c +++ b/decoder.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include diff --git a/graph.c b/graph.c index cdcf8ce..4504d02 100644 --- a/graph.c +++ b/graph.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/hash.c b/hash.c index 6d8d594..09afbe6 100644 --- a/hash.c +++ b/hash.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/hash.h b/hash.h index 093c310..68832a5 100644 --- a/hash.h +++ b/hash.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __HASH_H #define __HASH_H diff --git a/lists.c b/lists.c index 1bd56c5..62d5264 100644 --- a/lists.c +++ b/lists.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include diff --git a/lists.h b/lists.h index a2563c7..f87b441 100644 --- a/lists.h +++ b/lists.h @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #ifndef __LISTS_H #define __LISTS_H diff --git a/liveness.c b/liveness.c index 5816ae7..4abfc3e 100644 --- a/liveness.c +++ b/liveness.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/main.c b/main.c index 519d361..87a39bd 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #include #include diff --git a/module.c b/module.c index 6b68e3d..5715fa3 100644 --- a/module.c +++ b/module.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/nids.c b/nids.c index dd67bc6..dc35df4 100644 --- a/nids.c +++ b/nids.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/nids.h b/nids.h index a06237f..76c6be5 100644 --- a/nids.h +++ b/nids.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __NIDS_H #define __NIDS_H diff --git a/operations.c b/operations.c index 0721509..9687134 100644 --- a/operations.c +++ b/operations.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/outcode.c b/outcode.c index 131ee45..d744415 100644 --- a/outcode.c +++ b/outcode.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/outgraph.c b/outgraph.c index b77fdfb..d4f7602 100644 --- a/outgraph.c +++ b/outgraph.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include diff --git a/output.c b/output.c index da623a7..14c7cb5 100644 --- a/output.c +++ b/output.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/output.h b/output.h index 8b31c65..34100ee 100644 --- a/output.h +++ b/output.h @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #ifndef __OUTPUT_H #define __OUTPUT_H diff --git a/prx.c b/prx.c index 410df0c..65dc18e 100644 --- a/prx.c +++ b/prx.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/prx.h b/prx.h index 20e88e4..35e6eab 100644 --- a/prx.h +++ b/prx.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __PRX_H #define __PRX_H diff --git a/relocs.c b/relocs.c index 8cff25d..59095ff 100644 --- a/relocs.c +++ b/relocs.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include #include diff --git a/ssa.c b/ssa.c index a5f9a70..8704701 100644 --- a/ssa.c +++ b/ssa.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/structures.c b/structures.c index 8e63352..13998c0 100644 --- a/structures.c +++ b/structures.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/subroutines.c b/subroutines.c index ed5cd2b..1b7a069 100644 --- a/subroutines.c +++ b/subroutines.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/switches.c b/switches.c index 7d89f2a..41cbd90 100644 --- a/switches.c +++ b/switches.c @@ -1,3 +1,6 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ #include "code.h" #include "utils.h" diff --git a/types.h b/types.h index e30f60d..0a1296b 100644 --- a/types.h +++ b/types.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __TYPES_H #define __TYPES_H diff --git a/utils.c b/utils.c index 4d0c9dd..0cc780f 100644 --- a/utils.c +++ b/utils.c @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #include #include #include diff --git a/utils.h b/utils.h index d3cd980..400973d 100644 --- a/utils.h +++ b/utils.h @@ -1,3 +1,7 @@ +/** + * Author: Humberto Naves (hsnaves@gmail.com) + */ + #ifndef __UTILS_H #define __UTILS_H -- 2.11.4.GIT