mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2026-05-23 06:41:42 +00:00
Compare commits
144 Commits
v0.0.1
..
25f827da0d
| Author | SHA1 | Date | |
|---|---|---|---|
| 25f827da0d | |||
| afbbdd2d11 | |||
| d417f41992 | |||
| 812a7424fe | |||
| bf1632f4ec | |||
| 4bd1ff9a66 | |||
| 9b8680b7bd | |||
| 646b5a3264 | |||
| 3e9fcc5fda | |||
| 83ffa1c324 | |||
| fd80b4c55a | |||
| 348bf99bd6 | |||
| 0c128ca259 | |||
| 232ce3bcaa | |||
| 483c7126c8 | |||
| 0cd113b33f | |||
| 4c77045add | |||
| b0ccd678d3 | |||
| f4ac726a1e | |||
| 3a4595a641 | |||
| a3a7b8847c | |||
| 7fccea636f | |||
| 38a860e4ce | |||
| 3995bed200 | |||
| 3502a70933 | |||
| 1a33de617d | |||
| 59e57d05f7 | |||
| 23f5c28c29 | |||
| 0e29d35407 | |||
| a756ab6cc0 | |||
| c15f3c21d5 | |||
| 5a944f8711 | |||
| e0728eb375 | |||
| bafc637be8 | |||
| 7da012fdf3 | |||
| d9c3b7cab5 | |||
| 8a36e02fdd | |||
| 944bab5e5c | |||
| 8ca8002067 | |||
| afc01a05e3 | |||
| 8cb282da97 | |||
| 0327434187 | |||
| b3b693a56e | |||
| 347033f424 | |||
| 4c78d6fe41 | |||
| 33b6006a34 | |||
| 98b2c3f4d6 | |||
| beb90edc3d | |||
| df9ef00a64 | |||
| 1f0717edef | |||
| 7a82be782d | |||
| f0c95340bf | |||
| 4843c61e2e | |||
| b79b776f63 | |||
| d1a0277861 | |||
| 4963a9180a | |||
| 56e8c485af | |||
| 9648a38fbe | |||
| 3fdcf3261d | |||
| deed3b66f5 | |||
| fce9fcee51 | |||
| cfd4640035 | |||
| 827d7c955e | |||
| c5eaf6f961 | |||
| eec84e91ff | |||
| 3f406c26e7 | |||
| 18659448d7 | |||
| 3bff917ce3 | |||
| d6a6a096fd | |||
| c147f3fbe2 | |||
| 8ea93169da | |||
| f22dc8d151 | |||
| 7da463ccd3 | |||
| e6a0913893 | |||
| 069442dca9 | |||
| 9b10a3e32f | |||
| 7e87e04413 | |||
| fc336c490a | |||
| c5195b4983 | |||
| c1adb9aee3 | |||
| 7503e8988b | |||
| df2440a3ba | |||
| 5d0e5e4227 | |||
| d976434e38 | |||
| 78b82978bc | |||
| 30332a743c | |||
| 1f7a75ca4c | |||
| 1b13ebbb35 | |||
| f8ba9185ab | |||
| fe99318dce | |||
| c380983b34 | |||
| 320c21fb66 | |||
| 24762485e0 | |||
| cdd7b2d656 | |||
| 63412a7017 | |||
| 7f0403e487 | |||
| 6b612395b5 | |||
| 2e50e3274d | |||
| 1f66cb6a43 | |||
| d8e10441ec | |||
| 15309fc2c0 | |||
| bd25b6429b | |||
| 9b19bc56ac | |||
| bde17390e5 | |||
| a49298d915 | |||
| 2c922da647 | |||
| 6627aff577 | |||
| a970d02d98 | |||
| a38c4ea524 | |||
| 93a9fd55d5 | |||
| 623d0001a9 | |||
| 64f8dfca8d | |||
| 84c212ed2b | |||
| ff218452ec | |||
| b830aba980 | |||
| 14b96a0082 | |||
| c66cb27032 | |||
| c35a0e9bb2 | |||
| e60c6c756b | |||
| 644097748c | |||
| af697a4460 | |||
| b99a335d96 | |||
| a21b76b0a3 | |||
| d57945fece | |||
| 81261522c3 | |||
| 4bddc60b05 | |||
| d657f8ac65 | |||
| 6b3996416a | |||
| bd128a1366 | |||
| 601a661fe0 | |||
| 5e51712a02 | |||
| cb7619851c | |||
| db053c05d2 | |||
| ca306d785b | |||
| 8c36a218de | |||
| 30ce0ad8eb | |||
| bb216441bf | |||
| b17a56a7fd | |||
| 2d9c35420c | |||
| 8e04a4fd43 | |||
| 469e8f9630 | |||
| 00dcc0e424 | |||
| 27c3bf2d32 | |||
| 0184ba0dcb |
@@ -1,7 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: gitsubmodule
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 10
|
||||
@@ -53,11 +53,12 @@ jobs:
|
||||
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:PlatformTarget=x86 build/t4sp-server-plugin.sln
|
||||
|
||||
- name: Upload ${{matrix.configuration}} binaries
|
||||
uses: actions/upload-artifact@v3.1.0
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: ${{matrix.configuration}} binaries
|
||||
path: |
|
||||
build/bin/${{matrix.configuration}}/t4sp-server-plugin.dll
|
||||
build/bin/${{matrix.configuration}}/t4sp-server-plugin.pdb
|
||||
|
||||
deploy:
|
||||
name: Deploy release
|
||||
@@ -70,7 +71,7 @@ jobs:
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Download Binaries
|
||||
uses: actions/download-artifact@v3.0.2
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: Release binaries
|
||||
|
||||
@@ -82,3 +83,4 @@ jobs:
|
||||
draft: true
|
||||
files: |
|
||||
t4sp-server-plugin.dll
|
||||
t4sp-server-plugin.pdb
|
||||
@@ -23,3 +23,12 @@
|
||||
[submodule "deps/libtommath"]
|
||||
path = deps/libtommath
|
||||
url = https://github.com/libtom/libtommath.git
|
||||
[submodule "deps/csv-parser"]
|
||||
path = deps/csv-parser
|
||||
url = https://github.com/AriaFallah/csv-parser
|
||||
[submodule "deps/SQLiteCpp"]
|
||||
path = deps/SQLiteCpp
|
||||
url = https://github.com/SRombauts/SQLiteCpp
|
||||
[submodule "deps/plutonium-sdk"]
|
||||
path = deps/plutonium-sdk
|
||||
url = https://github.com/plutoniummod/plutonium-sdk.git
|
||||
|
||||
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are 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.
|
||||
|
||||
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.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
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 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 work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
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 AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
@@ -1,10 +1,15 @@
|
||||
# T4SP-Server-Plugin
|
||||
A server plugin that has code that hopefully compiles and the game will load it to do things. Stability not guaranteed.
|
||||
A plugin that has no code that hopefully compiles and the game will load it to do nothing. Stability not guaranteed.
|
||||
|
||||
Requires Git (https://git-scm.com/), Premake5 (https://premake.github.io/), and MSVC 2022 (https://visualstudio.microsoft.com/vs/features/cplusplus/) to build.
|
||||
|
||||
# Installation
|
||||
Move the `t4sp-server-plugin.dll` to `%LOCALAPPDATA%\Plutonium\storage\t4\plugins\`, the plugin will be loaded when you start up a dedicated server for Plutonium T4SP.
|
||||
Move the `t4sp-server-plugin.dll` to `%LOCALAPPDATA%\Plutonium\plugins\`, the plugin will be loaded when you start up a dedicated server for Plutonium T4SP.
|
||||
|
||||
# Features
|
||||
|
||||
Nothing.
|
||||
|
||||
|
||||
# Credits
|
||||
- momo5502 (https://github.com/momo5502)
|
||||
|
||||
Vendored
+1
-1
Submodule deps/GSL updated: 43d60c5e38...e64c97fc2c
+1
Submodule deps/SQLiteCpp added at bcb4c78fed
Vendored
+1
-1
Submodule deps/asmjit updated: f1ea8a46c3...416f735696
+1
Submodule deps/csv-parser added at 4965c9f320
Vendored
+1
-1
Submodule deps/curl updated: 4528690cd5...78a1814b33
Vendored
+1
-1
Submodule deps/json updated: 546370c9e7...a259ecc51e
Vendored
+1
-1
Submodule deps/libtomcrypt updated: b96e96cf8b...7e863d2142
Vendored
+1
-1
Submodule deps/libtommath updated: 7f96509df1...8314bde5e5
Vendored
+1
-1
Submodule deps/minhook updated: 49d03ad118...f5485b8454
+1
Submodule deps/plutonium-sdk added at 17e9a0a4d5
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
SQLiteCpp = {
|
||||
source = path.join(dependencies.basePath, "SQLiteCpp"),
|
||||
}
|
||||
|
||||
function SQLiteCpp.import()
|
||||
links { "SQLiteCpp" }
|
||||
SQLiteCpp.includes()
|
||||
end
|
||||
|
||||
function SQLiteCpp.includes()
|
||||
includedirs {
|
||||
path.join(SQLiteCpp.source, "include"),
|
||||
path.join(SQLiteCpp.source, "sqlite3")
|
||||
}
|
||||
end
|
||||
|
||||
function SQLiteCpp.project()
|
||||
project "SQLiteCpp"
|
||||
language "C"
|
||||
|
||||
SQLiteCpp.includes()
|
||||
|
||||
files {
|
||||
path.join(path.join(SQLiteCpp.source, "src"), "**.cpp"),
|
||||
path.join(path.join(SQLiteCpp.source, "include"), "**.h"),
|
||||
path.join(path.join(SQLiteCpp.source, "sqlite3"), "**.c"),
|
||||
path.join(path.join(SQLiteCpp.source, "sqlite3"), "**.h")
|
||||
}
|
||||
|
||||
warnings "Off"
|
||||
kind "StaticLib"
|
||||
end
|
||||
|
||||
table.insert(dependencies, SQLiteCpp)
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
csv_parser = {
|
||||
source = path.join(dependencies.basePath, "csv-parser"),
|
||||
}
|
||||
|
||||
function csv_parser.import()
|
||||
dependson "csv-parser"
|
||||
csv_parser.includes()
|
||||
end
|
||||
|
||||
function csv_parser.includes()
|
||||
includedirs {
|
||||
csv_parser.source
|
||||
}
|
||||
end
|
||||
|
||||
function csv_parser.project()
|
||||
|
||||
end
|
||||
|
||||
table.insert(dependencies, csv_parser)
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
plutonium_sdk = {
|
||||
source = path.join(dependencies.basePath, "plutonium-sdk"),
|
||||
}
|
||||
|
||||
function plutonium_sdk.import()
|
||||
plutonium_sdk.includes()
|
||||
end
|
||||
|
||||
function plutonium_sdk.includes()
|
||||
includedirs {
|
||||
plutonium_sdk.source,
|
||||
}
|
||||
end
|
||||
|
||||
function plutonium_sdk.project()
|
||||
end
|
||||
|
||||
table.insert(dependencies, plutonium_sdk)
|
||||
Vendored
+1
-1
Submodule deps/zlib updated: 04f42ceca4...643e17b749
+1
-1
@@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
call git submodule update --init --recursive
|
||||
tools\premake5.exe vs2022
|
||||
premake5.exe vs2022
|
||||
+4
-4
@@ -50,6 +50,8 @@ workspace "t4sp-server-plugin"
|
||||
warnings "Extra"
|
||||
characterset "ASCII"
|
||||
|
||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||
|
||||
flags
|
||||
{
|
||||
"NoIncrementalLink",
|
||||
@@ -101,20 +103,18 @@ workspace "t4sp-server-plugin"
|
||||
|
||||
dependencies.imports()
|
||||
|
||||
exceptionhandling ("Off")
|
||||
|
||||
if _OPTIONS["copy-to"] then
|
||||
postbuildcommands {"copy /y \"$(TargetPath)\" \"" .. _OPTIONS["copy-to"] .. "\""}
|
||||
else
|
||||
filter "configurations:Release"
|
||||
postbuildcommands {
|
||||
"if \"%COMPUTERNAME%\" == \"NEW-BUILT\" ( copy /y \"$(TargetPath)\" \"$(CODWAW_PATH)\\t4\\plugins\\\" )"
|
||||
"if \"%COMPUTERNAME%\" == \"\" ( copy /y \"$(TargetPath)\" \"$(LOCALAPPDATA)\\Plutonium\\plugins\\\" )"
|
||||
}
|
||||
filter {}
|
||||
|
||||
filter "configurations:Debug"
|
||||
postbuildcommands {
|
||||
"if \"%COMPUTERNAME%\" == \"NEW-BUILT\" ( copy /y \"$(TargetPath)\" \"$(CODWAW_PATH)\\t4staging\\plugins\\\" )"
|
||||
"if \"%COMPUTERNAME%\" == \"\" ( copy /y \"$(TargetPath)\" \"$(LOCALAPPDATA)\\Plutonium-staging\\plugins\\\" )"
|
||||
}
|
||||
filter {}
|
||||
end
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include <utils/thread.hpp>
|
||||
#include <utils/compression.hpp>
|
||||
|
||||
#include <exception/minidump.hpp>
|
||||
|
||||
namespace exception
|
||||
{
|
||||
namespace
|
||||
{
|
||||
thread_local struct
|
||||
{
|
||||
DWORD code = 0;
|
||||
PVOID address = nullptr;
|
||||
} exception_data;
|
||||
|
||||
void show_mouse_cursor()
|
||||
{
|
||||
while (ShowCursor(TRUE) < 0);
|
||||
}
|
||||
|
||||
void display_error_dialog()
|
||||
{
|
||||
std::string error_str = utils::string::va("Fatal error (0x%08X) at 0x%p.\n"
|
||||
"A minidump has been written.\n\n",
|
||||
exception_data.code, exception_data.address);
|
||||
|
||||
error_str += "Make sure to update your graphics card drivers and install operating system updates!";
|
||||
|
||||
utils::thread::suspend_other_threads();
|
||||
show_mouse_cursor();
|
||||
MessageBoxA(nullptr, error_str.data(), "Plutonium T4 ERROR", MB_ICONERROR);
|
||||
TerminateProcess(GetCurrentProcess(), exception_data.code);
|
||||
}
|
||||
|
||||
void reset_state()
|
||||
{
|
||||
display_error_dialog();
|
||||
}
|
||||
|
||||
size_t get_reset_state_stub()
|
||||
{
|
||||
static auto* stub = utils::hook::assemble([](utils::hook::assembler& a)
|
||||
{
|
||||
a.sub(esp, 0x10);
|
||||
a.or_(esp, 0x8);
|
||||
a.jmp(reset_state);
|
||||
});
|
||||
|
||||
return reinterpret_cast<size_t>(stub);
|
||||
}
|
||||
|
||||
std::string generate_crash_info(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
std::string info{};
|
||||
const auto line = [&info](const std::string& text)
|
||||
{
|
||||
info.append(text);
|
||||
info.append("\r\n");
|
||||
};
|
||||
|
||||
line("Plutonium T4 Crash Dump");
|
||||
line("");
|
||||
line("Timestamp: "s + utils::string::get_timestamp());
|
||||
line(utils::string::va("Exception: 0x%08X", exceptioninfo->ExceptionRecord->ExceptionCode));
|
||||
line(utils::string::va("Address: 0x%lX", exceptioninfo->ExceptionRecord->ExceptionAddress));
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
OSVERSIONINFOEXA version_info;
|
||||
ZeroMemory(&version_info, sizeof(version_info));
|
||||
version_info.dwOSVersionInfoSize = sizeof(version_info);
|
||||
GetVersionExA(reinterpret_cast<LPOSVERSIONINFOA>(&version_info));
|
||||
#pragma warning(pop)
|
||||
|
||||
line(utils::string::va("OS Version: %u.%u", version_info.dwMajorVersion, version_info.dwMinorVersion));
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void write_minidump(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
const std::string crash_name = utils::string::va("minidumps/plutonium-t4-crash-%s.zip",
|
||||
utils::string::get_timestamp().data());
|
||||
|
||||
utils::compression::zip::archive zip_file{};
|
||||
zip_file.add("crash.dmp", create_minidump(exceptioninfo));
|
||||
zip_file.add("info.txt", generate_crash_info(exceptioninfo));
|
||||
zip_file.write(crash_name, "Plutonium T4 Crash Dump");
|
||||
}
|
||||
|
||||
bool is_harmless_error(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
const auto code = exceptioninfo->ExceptionRecord->ExceptionCode;
|
||||
return code == STATUS_INTEGER_OVERFLOW || code == STATUS_FLOAT_OVERFLOW || code == STATUS_SINGLE_STEP;
|
||||
}
|
||||
|
||||
LONG WINAPI exception_filter(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
if (is_harmless_error(exceptioninfo))
|
||||
{
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
|
||||
write_minidump(exceptioninfo);
|
||||
|
||||
exception_data.code = exceptioninfo->ExceptionRecord->ExceptionCode;
|
||||
exception_data.address = exceptioninfo->ExceptionRecord->ExceptionAddress;
|
||||
exceptioninfo->ContextRecord->Eip = get_reset_state_stub();
|
||||
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI set_unhandled_exception_filter_stub(LPTOP_LEVEL_EXCEPTION_FILTER)
|
||||
{
|
||||
// Don't register anything here...
|
||||
return &exception_filter;
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
SetUnhandledExceptionFilter(exception_filter);
|
||||
utils::hook::jump(reinterpret_cast<uintptr_t>(&SetUnhandledExceptionFilter), set_unhandled_exception_filter_stub);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(exception::component)
|
||||
+4
-119
@@ -1,111 +1,14 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
|
||||
#include "scheduler.hpp"
|
||||
|
||||
#include <json.hpp>
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include "gsc.hpp"
|
||||
|
||||
namespace gsc
|
||||
{
|
||||
std::unordered_map<std::string, game::BuiltinFunction> functions;
|
||||
std::unordered_map<std::string, game::BuiltinMethod> methods;
|
||||
|
||||
utils::hook::detour scr_getmethod_hook;
|
||||
void* scr_getfunction_stub_ret_loc;
|
||||
|
||||
namespace
|
||||
{
|
||||
game::BuiltinFunction scr_getfunction_call(const char** pName, int* pType)
|
||||
{
|
||||
auto itr = functions.find(*pName);
|
||||
|
||||
if (itr == functions.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
*pType = 0;
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
game::BuiltinFunction NAKED scr_getfunction_stub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push eax;
|
||||
pushad;
|
||||
|
||||
lea eax, [esp + 0x24 + 0x2C - 0x1C];
|
||||
push eax;
|
||||
push edx;
|
||||
call scr_getfunction_call;
|
||||
add esp, 8;
|
||||
mov [esp + 0x20], eax;
|
||||
|
||||
popad;
|
||||
pop eax;
|
||||
|
||||
test eax, eax;
|
||||
jnz just_ret;
|
||||
|
||||
// go do original code
|
||||
push scr_getfunction_stub_ret_loc;
|
||||
ret;
|
||||
|
||||
just_ret:
|
||||
add esp, 4;
|
||||
push 0x682DC8;
|
||||
ret;
|
||||
}
|
||||
}
|
||||
|
||||
game::BuiltinMethod scr_getmethod_call(const char** pName, int* pType)
|
||||
{
|
||||
auto itr = methods.find(*pName);
|
||||
|
||||
if (itr == methods.end())
|
||||
{
|
||||
// call og
|
||||
const auto og_addr = scr_getmethod_hook.get_original();
|
||||
game::BuiltinMethod answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edi, pType;
|
||||
mov esi, pName;
|
||||
call og_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
*pType = 0;
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
game::BuiltinMethod NAKED scr_getmethod_stub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push edi;
|
||||
push esi;
|
||||
call scr_getmethod_call;
|
||||
add esp, 8;
|
||||
|
||||
ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace function
|
||||
{
|
||||
void add(const std::string& name, const game::BuiltinFunction function)
|
||||
{
|
||||
functions.insert_or_assign(name, function);
|
||||
plugin::get()->get_interface()->gsc()->register_function(name, function);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,26 +16,8 @@ namespace gsc
|
||||
{
|
||||
void add(const std::string& name, const game::BuiltinMethod method)
|
||||
{
|
||||
methods.insert_or_assign(name, method);
|
||||
plugin::get()->get_interface()->gsc()->register_method(name, (plutonium::sdk::v1::interfaces::gsc::method_callback)method);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
// custom gsc methods
|
||||
scr_getmethod_hook.create(utils::hook::get_displacement_addr(SELECT(0x0, 0x683043)), scr_getmethod_stub);
|
||||
|
||||
// custom gsc funcs
|
||||
scr_getfunction_stub_ret_loc = utils::hook::get_displacement_addr(SELECT(0x0, 0x682D99));
|
||||
utils::hook::jump(SELECT(0x0, 0x682D99), scr_getfunction_stub);
|
||||
}
|
||||
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(gsc::component)
|
||||
|
||||
|
||||
+2
-186
@@ -1,195 +1,11 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
|
||||
#include "scheduler.hpp"
|
||||
|
||||
#include <utils/concurrency.hpp>
|
||||
#include <utils/hook.hpp>
|
||||
|
||||
namespace scheduler
|
||||
{
|
||||
namespace
|
||||
void on_scr_execute(void(*callback)())
|
||||
{
|
||||
struct task
|
||||
{
|
||||
std::function<bool()> handler{};
|
||||
std::chrono::milliseconds interval{};
|
||||
std::chrono::high_resolution_clock::time_point last_call{};
|
||||
};
|
||||
|
||||
using task_list = std::vector<task>;
|
||||
|
||||
class task_pipeline
|
||||
{
|
||||
public:
|
||||
void add(task&& task)
|
||||
{
|
||||
new_callbacks_.access([&task](task_list& tasks)
|
||||
{
|
||||
tasks.emplace_back(std::move(task));
|
||||
});
|
||||
}
|
||||
|
||||
void execute()
|
||||
{
|
||||
callbacks_.access([&](task_list& tasks)
|
||||
{
|
||||
this->merge_callbacks();
|
||||
|
||||
for (auto i = tasks.begin(); i != tasks.end();)
|
||||
{
|
||||
const auto now = std::chrono::high_resolution_clock::now();
|
||||
const auto diff = now - i->last_call;
|
||||
|
||||
if (diff < i->interval)
|
||||
{
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
|
||||
i->last_call = now;
|
||||
|
||||
const auto res = i->handler();
|
||||
if (res == cond_end)
|
||||
{
|
||||
i = tasks.erase(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
++i;
|
||||
plugin::get()->get_interface()->callbacks()->on_scripts_execute(callback);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private:
|
||||
utils::concurrency::container<task_list> new_callbacks_;
|
||||
utils::concurrency::container<task_list, std::recursive_mutex> callbacks_;
|
||||
|
||||
void merge_callbacks()
|
||||
{
|
||||
callbacks_.access([&](task_list& tasks)
|
||||
{
|
||||
new_callbacks_.access([&](task_list& new_tasks)
|
||||
{
|
||||
tasks.insert(tasks.end(), std::move_iterator<task_list::iterator>(new_tasks.begin()), std::move_iterator<task_list::iterator>(new_tasks.end()));
|
||||
new_tasks = {};
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
std::thread thread;
|
||||
task_pipeline pipelines[pipeline::count];
|
||||
|
||||
void execute(const pipeline type)
|
||||
{
|
||||
assert(type >= 0 && type < pipeline::count);
|
||||
pipelines[type].execute();
|
||||
}
|
||||
|
||||
void execute_server()
|
||||
{
|
||||
execute(pipeline::server);
|
||||
}
|
||||
|
||||
void execute_main()
|
||||
{
|
||||
execute(pipeline::main);
|
||||
}
|
||||
|
||||
utils::hook::detour com_init_hook;
|
||||
utils::hook::detour gscr_postloadscripts_hook;
|
||||
|
||||
std::vector<std::function<void()>> post_init_funcs;
|
||||
bool com_inited = false;
|
||||
|
||||
void on_post_init_hook()
|
||||
{
|
||||
if (com_inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
com_inited = true;
|
||||
for (const auto& func : post_init_funcs)
|
||||
{
|
||||
func();
|
||||
}
|
||||
|
||||
post_init_funcs.clear();
|
||||
}
|
||||
|
||||
void com_init_stub()
|
||||
{
|
||||
com_init_hook.invoke<void>();
|
||||
on_post_init_hook();
|
||||
}
|
||||
}
|
||||
|
||||
void schedule(const std::function<bool()>& callback, const pipeline type,
|
||||
const std::chrono::milliseconds delay)
|
||||
{
|
||||
assert(type >= 0 && type < pipeline::count);
|
||||
|
||||
task task;
|
||||
task.handler = callback;
|
||||
task.interval = delay;
|
||||
task.last_call = std::chrono::high_resolution_clock::now();
|
||||
|
||||
pipelines[type].add(std::move(task));
|
||||
}
|
||||
|
||||
void loop(const std::function<void()>& callback, const pipeline type,
|
||||
const std::chrono::milliseconds delay)
|
||||
{
|
||||
schedule([callback]()
|
||||
{
|
||||
callback();
|
||||
return cond_continue;
|
||||
}, type, delay);
|
||||
}
|
||||
|
||||
void once(const std::function<void()>& callback, const pipeline type,
|
||||
const std::chrono::milliseconds delay)
|
||||
{
|
||||
schedule([callback]()
|
||||
{
|
||||
callback();
|
||||
return cond_end;
|
||||
}, type, delay);
|
||||
}
|
||||
|
||||
void on_init(const std::function<void()>& callback)
|
||||
{
|
||||
if (com_inited)
|
||||
{
|
||||
once(callback, pipeline::main);
|
||||
}
|
||||
else
|
||||
{
|
||||
post_init_funcs.push_back(callback);
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
thread = std::thread([]()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
execute(pipeline::async);
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
});
|
||||
|
||||
com_init_hook.create(SELECT(0x0, 0x59D710), com_init_stub);
|
||||
utils::hook::call(SELECT(0x0, 0x503B5D), execute_server);
|
||||
utils::hook::call(SELECT(0x0, 0x59DCFD), execute_main);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(scheduler::component)
|
||||
|
||||
@@ -2,23 +2,5 @@
|
||||
|
||||
namespace scheduler
|
||||
{
|
||||
enum pipeline
|
||||
{
|
||||
server,
|
||||
async,
|
||||
main,
|
||||
count,
|
||||
};
|
||||
|
||||
static const bool cond_continue = false;
|
||||
static const bool cond_end = true;
|
||||
|
||||
void schedule(const std::function<bool()>& callback, pipeline type = pipeline::main,
|
||||
std::chrono::milliseconds delay = 0ms);
|
||||
void loop(const std::function<void()>& callback, pipeline type = pipeline::main,
|
||||
std::chrono::milliseconds delay = 0ms);
|
||||
void once(const std::function<void()>& callback, pipeline type = pipeline::main,
|
||||
std::chrono::milliseconds delay = 0ms);
|
||||
|
||||
void on_init(const std::function<void()>& callback);
|
||||
void on_scr_execute(void(*callback)());
|
||||
}
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "signatures.hpp"
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include <utils/cryptography.hpp>
|
||||
#include <utils/compression.hpp>
|
||||
#include <json.hpp>
|
||||
|
||||
namespace signatures
|
||||
{
|
||||
std::string read_sigs_file()
|
||||
{
|
||||
return utils::compression::zlib::decompress(utils::cryptography::des::decrypt(utils::io::read_file("t4sp-server-plugin/sigs")));
|
||||
}
|
||||
|
||||
bool write_sigs_file(const std::string& f)
|
||||
{
|
||||
return utils::io::write_file("t4sp-server-plugin/sigs", utils::cryptography::des::encrypt(utils::compression::zlib::compress(f)));
|
||||
}
|
||||
|
||||
const char* get_current_version()
|
||||
{
|
||||
return *reinterpret_cast<const char**>(0x4FF72D + 4);
|
||||
}
|
||||
|
||||
std::unordered_map<std::string, std::string> get_cache_info_for_our_version()
|
||||
{
|
||||
std::unordered_map<std::string, std::string> answer;
|
||||
|
||||
auto* version = get_current_version();
|
||||
|
||||
nlohmann::json cache_json = nlohmann::json::parse(read_sigs_file(), nullptr, false, true);
|
||||
if (!cache_json.is_discarded() && cache_json.is_object())
|
||||
{
|
||||
for (const auto& [key, value] : cache_json.items())
|
||||
{
|
||||
if (key != version)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!value.is_object())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
answer = value.get<std::unordered_map<std::string, std::string>>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
bool save_cache_info_for_our_version(const std::unordered_map<std::string, std::string>& cache_info)
|
||||
{
|
||||
auto* version = get_current_version();
|
||||
|
||||
nlohmann::json cache_json = nlohmann::json::parse(read_sigs_file(), nullptr, false, true);
|
||||
if (cache_json.is_discarded() || !cache_json.is_object())
|
||||
{
|
||||
cache_json = nlohmann::json::parse("{}", nullptr, false, true);
|
||||
|
||||
if (cache_json.is_discarded() || !cache_json.is_object())
|
||||
{
|
||||
return false; // can't happen?
|
||||
}
|
||||
}
|
||||
|
||||
cache_json[version] = cache_info;
|
||||
return write_sigs_file(cache_json.dump());
|
||||
}
|
||||
|
||||
size_t load_image_size()
|
||||
{
|
||||
MODULEINFO info{};
|
||||
GetModuleInformation(GetCurrentProcess(),
|
||||
GetModuleHandle("plutonium-bootstrapper-win32.exe"), &info, sizeof(MODULEINFO));
|
||||
return info.SizeOfImage;
|
||||
}
|
||||
|
||||
size_t get_image_size()
|
||||
{
|
||||
static const auto image_size = load_image_size();
|
||||
return image_size;
|
||||
}
|
||||
|
||||
size_t find_string_ptr(const std::string& string)
|
||||
{
|
||||
const char* string_ptr = nullptr;
|
||||
std::string mask(string.size(), 'x');
|
||||
const auto base = reinterpret_cast<size_t>(GetModuleHandle("plutonium-bootstrapper-win32.exe"));
|
||||
utils::hook::signature signature(base, get_image_size() - base);
|
||||
|
||||
signature.add({
|
||||
string,
|
||||
mask,
|
||||
[&](char* address)
|
||||
{
|
||||
string_ptr = address;
|
||||
}
|
||||
});
|
||||
|
||||
signature.process();
|
||||
return reinterpret_cast<size_t>(string_ptr);
|
||||
}
|
||||
|
||||
size_t find_string_ref(const std::string& string)
|
||||
{
|
||||
char bytes[4] = {0};
|
||||
const auto string_ptr = find_string_ptr(string);
|
||||
if (!string_ptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::memcpy(bytes, &string_ptr, sizeof(bytes));
|
||||
return find_string_ptr({bytes, 4});
|
||||
}
|
||||
|
||||
bool process_printf()
|
||||
{
|
||||
auto cache_info = get_cache_info_for_our_version();
|
||||
|
||||
if (cache_info.contains("printf"))
|
||||
{
|
||||
game::plutonium::printf.set(std::atoi(cache_info.at("printf").c_str()));
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto string_ref = find_string_ref("A critical exception occured!\n");
|
||||
if (!string_ref)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto offset = *reinterpret_cast<size_t*>(string_ref + 5);
|
||||
game::plutonium::printf.set(string_ref + 4 + 5 + offset);
|
||||
|
||||
cache_info.insert_or_assign("printf", std::to_string(string_ref + 4 + 5 + offset));
|
||||
save_cache_info_for_our_version(cache_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool handle_funcs()
|
||||
{
|
||||
game::plutonium::load_custom_script_func.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x689C80)) + 0x6)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process()
|
||||
{
|
||||
utils::cryptography::des::set_key("694201337");
|
||||
|
||||
handle_funcs();
|
||||
|
||||
return process_printf();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace signatures
|
||||
{
|
||||
bool process();
|
||||
}
|
||||
+9
-15
@@ -1,14 +1,8 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
|
||||
#include "scheduler.hpp"
|
||||
#include "gsc.hpp"
|
||||
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include <utils/http.hpp>
|
||||
#include <json.hpp>
|
||||
#include "gsc.hpp"
|
||||
|
||||
namespace test
|
||||
{
|
||||
@@ -21,15 +15,15 @@ namespace test
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
//Disable AI print spam
|
||||
utils::hook::nop(0x4BAB7D, 5);
|
||||
utils::hook::nop(0x4BAAFA, 5);
|
||||
gsc::function::add("testfunc", []()
|
||||
{
|
||||
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER, "this is a test builtin\n");
|
||||
});
|
||||
|
||||
//Disable asset loading print spam
|
||||
utils::hook::nop(0x48D9D9, 5);
|
||||
|
||||
//Disable unknown dvar spam
|
||||
utils::hook::nop(0x5F04AF, 5);
|
||||
gsc::method::add("testmeth", [](game::scr_entref_t ref)
|
||||
{
|
||||
game::Com_Printf(game::CON_CHANNEL_DONT_FILTER, "this is a test builtin on ent %d\n", ref.entnum);
|
||||
});
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+3
-31
@@ -1,39 +1,11 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "component/signatures.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE /*module_*/, DWORD ul_reason_for_call, LPVOID /*reserved_*/)
|
||||
PLUTONIUM_API plutonium::sdk::plugin* PLUTONIUM_CALLBACK on_initialize()
|
||||
{
|
||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
if (game::environment::t4sp())
|
||||
{
|
||||
if (!signatures::process())
|
||||
{
|
||||
MessageBoxA(NULL,
|
||||
"This version of t4sp-server-plugin is outdated.\n" \
|
||||
"Download the latest dll from here: https://github.com/JezuzLizard/T4SP-Server-Plugin/releases",
|
||||
"ERROR", MB_ICONERROR);
|
||||
|
||||
return FALSE;
|
||||
return plugin::get();
|
||||
}
|
||||
|
||||
if (game::plutonium::printf.get() != nullptr)
|
||||
BOOL APIENTRY DllMain(HMODULE /*module_*/, DWORD /*ul_reason_for_call*/, LPVOID /*reserved_*/)
|
||||
{
|
||||
utils::hook::jump(reinterpret_cast<uintptr_t>(&printf), game::plutonium::printf);
|
||||
}
|
||||
|
||||
component_loader::post_unpack();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxA(nullptr, "Unsupported game executable. (t4sp is only supported)", "ERROR, BRO!", 0);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "minidump.hpp"
|
||||
|
||||
#include <DbgHelp.h>
|
||||
#pragma comment(lib, "dbghelp.lib")
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
namespace exception
|
||||
{
|
||||
namespace
|
||||
{
|
||||
constexpr MINIDUMP_TYPE get_minidump_type()
|
||||
{
|
||||
const auto type = MiniDumpIgnoreInaccessibleMemory //
|
||||
| MiniDumpWithHandleData //
|
||||
| MiniDumpScanMemory //
|
||||
| MiniDumpWithProcessThreadData //
|
||||
| MiniDumpWithFullMemoryInfo //
|
||||
| MiniDumpWithThreadInfo //
|
||||
| MiniDumpWithUnloadedModules;
|
||||
|
||||
return static_cast<MINIDUMP_TYPE>(type);
|
||||
}
|
||||
|
||||
std::string get_temp_filename()
|
||||
{
|
||||
char filename[MAX_PATH] = {0};
|
||||
char pathname[MAX_PATH] = {0};
|
||||
|
||||
GetTempPathA(sizeof(pathname), pathname);
|
||||
GetTempFileNameA(pathname, "Plutonium T4 -", 0, filename);
|
||||
return filename;
|
||||
}
|
||||
|
||||
HANDLE write_dump_to_temp_file(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
MINIDUMP_EXCEPTION_INFORMATION minidump_exception_info = {GetCurrentThreadId(), exceptioninfo, FALSE};
|
||||
|
||||
auto* const file_handle = CreateFileA(get_temp_filename().data(), GENERIC_WRITE | GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS,
|
||||
FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE,
|
||||
nullptr);
|
||||
|
||||
if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), file_handle, get_minidump_type(),
|
||||
&minidump_exception_info,
|
||||
nullptr,
|
||||
nullptr))
|
||||
{
|
||||
MessageBoxA(nullptr, "There was an error creating the minidump! Hit OK to close the program.",
|
||||
"Minidump Error", MB_OK | MB_ICONERROR);
|
||||
TerminateProcess(GetCurrentProcess(), 123);
|
||||
}
|
||||
|
||||
return file_handle;
|
||||
}
|
||||
|
||||
std::string read_file(HANDLE file_handle)
|
||||
{
|
||||
FlushFileBuffers(file_handle);
|
||||
SetFilePointer(file_handle, 0, nullptr, FILE_BEGIN);
|
||||
|
||||
std::string buffer{};
|
||||
|
||||
DWORD bytes_read = 0;
|
||||
char temp_bytes[0x2000];
|
||||
|
||||
do
|
||||
{
|
||||
if (!ReadFile(file_handle, temp_bytes, sizeof(temp_bytes), &bytes_read, nullptr))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
buffer.append(temp_bytes, bytes_read);
|
||||
}
|
||||
while (bytes_read == sizeof(temp_bytes));
|
||||
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
std::string create_minidump(const LPEXCEPTION_POINTERS exceptioninfo)
|
||||
{
|
||||
auto* const file_handle = write_dump_to_temp_file(exceptioninfo);
|
||||
|
||||
const auto _ = gsl::finally([file_handle]()
|
||||
{
|
||||
CloseHandle(file_handle);
|
||||
});
|
||||
|
||||
return read_file(file_handle);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace exception
|
||||
{
|
||||
std::string create_minidump(LPEXCEPTION_POINTERS exceptioninfo);
|
||||
}
|
||||
@@ -1,5 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#define VAR_STAT_FREE 0
|
||||
#define VAR_STAT_MASK 0x60
|
||||
#define VAR_STAT_MOVABLE 0x20
|
||||
#define VAR_STAT_HEAD 0x40
|
||||
#define VAR_STAT_EXTERNAL 0x60
|
||||
|
||||
#define VAR_MASK 0x1F
|
||||
#define VAR_ENT_MASK 0x3FFF
|
||||
#define VAR_CLIENT_MASK 0xE
|
||||
#define VAR_NAME_LOW_MASK 0xFF000000
|
||||
#define VAR_NAME_HIGH_MASK 0xFFFFFF00
|
||||
#define VAR_NAME_BIT_SHIFT 8
|
||||
#define VAR_PARENTID_BIT_SHIFT 8
|
||||
#define OBJECT_STACK 0x15FFE
|
||||
#define OBJECT_NOTIFY_LIST 0x15FFE
|
||||
|
||||
#define VARIABLELIST_CHILD_SIZE 0x10000
|
||||
#define VARIABLELIST_CHILD_BEGIN 0x6000
|
||||
|
||||
#define IsObject(__parentValue__) \
|
||||
((__parentValue__->w.status & VAR_MASK) >= game::VAR_THREAD) \
|
||||
|
||||
#define MT_NODE_BITS 16
|
||||
#define MT_NODE_SIZE sizeof(game::MemoryNode)
|
||||
#define MT_SIZE sizeof(game::scrMemTreeGlob_t::nodes)
|
||||
#define MT_NODE_COUNT (1 << MT_NODE_BITS)
|
||||
#define MT_NUM_BUCKETS 256
|
||||
|
||||
#define HASH_STAT_MASK 0x30000
|
||||
#define HASH_STAT_HEAD 0x20000
|
||||
#define HASH_STAT_MOVABLE 0x10000
|
||||
#define HASH_STAT_FREE 0
|
||||
#define HASH_MAX_HASHES 25000
|
||||
#define SL_MAX_STRING_LEN 0x2000
|
||||
#define SL_MAX_STRING_INDEX 0x10000
|
||||
|
||||
#define MAX_VM_STACK_DEPTH 30
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace game
|
||||
{
|
||||
@@ -15,6 +53,7 @@ namespace game
|
||||
struct sentient_s;
|
||||
struct gclient_s;
|
||||
struct game_hudelem_s;
|
||||
struct dvar_s;
|
||||
|
||||
#pragma region "enums"
|
||||
|
||||
@@ -34,6 +73,13 @@ namespace game
|
||||
SCRIPT_INSTANCE_MAX = 0x2,
|
||||
};
|
||||
|
||||
enum animUserInstance_t
|
||||
{
|
||||
ANIM_USER_CLIENT = 0x0,
|
||||
ANIM_USER_SERVER = 0x1,
|
||||
ANIM_USER_COUNT = 0x2
|
||||
};
|
||||
|
||||
enum OpcodeVM : __int32
|
||||
{
|
||||
OP_End = 0x0,
|
||||
@@ -271,7 +317,7 @@ namespace game
|
||||
ENUM_argument = 0x59,
|
||||
};
|
||||
|
||||
enum HASH_e
|
||||
/*enum HASH_e
|
||||
{
|
||||
HASH_STAT_MASK = 0x30000,
|
||||
HASH_STAT_HEAD = 0x20000,
|
||||
@@ -297,6 +343,16 @@ namespace game
|
||||
SL_MAX_STRING_INDEX = 0x10000,
|
||||
OBJECT_STACK = 0x15FFE,
|
||||
FIRST_OBJECT = 0x14,
|
||||
};*/
|
||||
|
||||
enum ObjectTypes
|
||||
{
|
||||
FIRST_OBJECT = 0xD,
|
||||
FIRST_CLEARABLE_OBJECT = 0x11,
|
||||
LAST_NONENTITY_OBJECT = 0x11,
|
||||
FIRST_ENTITY_OBJECT = 0x13,
|
||||
FIRST_NONFIELD_OBJECT = 0x14,
|
||||
FIRST_DEAD_OBJECT = 0x15,
|
||||
};
|
||||
|
||||
enum VariableType
|
||||
@@ -328,6 +384,44 @@ namespace game
|
||||
VAR_ENDON_LIST = 0x18,
|
||||
};
|
||||
|
||||
enum scr_builtin_type_t
|
||||
{
|
||||
BUILTIN_ANY = 0x0,
|
||||
BUILTIN_DEVELOPER_ONLY = 0x1,
|
||||
};
|
||||
|
||||
enum Scr_SourceType_t
|
||||
{
|
||||
SOURCE_TYPE_NONE = 0x0,
|
||||
SOURCE_TYPE_BREAKPOINT = 0x1,
|
||||
SOURCE_TYPE_CALL = 0x2,
|
||||
};
|
||||
|
||||
enum scr_abort_t
|
||||
{
|
||||
SCR_ABORT_NONE = 0x0,
|
||||
SCR_ABORT_CONTINUE = 0x1,
|
||||
SCR_ABORT_BREAK = 0x2,
|
||||
SCR_ABORT_RETURN = 0x3,
|
||||
SCR_ABORT_MAX = 0x3,
|
||||
};
|
||||
|
||||
enum scr_call_type_t
|
||||
{
|
||||
CALL_NONE = 0x0,
|
||||
CALL_BUILTIN = 0x1,
|
||||
CALL_THREAD = 0x2,
|
||||
CALL_FUNCTION = 0x3,
|
||||
};
|
||||
|
||||
enum sl_user_type_e
|
||||
{
|
||||
SL_USER_GAME = 0x1,
|
||||
SL_USER_TEMP = 0x2,
|
||||
SL_USER_XZONE = 0x4,
|
||||
SL_USER_XZONE_TEMP = 0x8,
|
||||
};
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region "structs"
|
||||
@@ -683,15 +777,13 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(MemoryNode, next, 0x2);
|
||||
ASSERT_STRUCT_OFFSET(MemoryNode, padding, 0x4);
|
||||
|
||||
struct scrMemTreeGlob_t
|
||||
struct __declspec(align(128)) scrMemTreeGlob_t
|
||||
{
|
||||
MemoryNode nodes[65536]; //OFS: 0x0 SIZE: 0xC0000
|
||||
unsigned __int8 leftBits[256]; //OFS: 0xC0000 SIZE: 0x100
|
||||
unsigned __int8 numBits[256]; //OFS: 0xC0100 SIZE: 0x100
|
||||
unsigned __int8 logBits[256]; //OFS: 0xC0200 SIZE: 0x100
|
||||
unsigned __int16 head[17]; //OFS: 0xC0300 SIZE: 0x22
|
||||
_BYTE gap_C0322[93]; //OFS: 0xC0322 SIZE: 0x5D
|
||||
char field_C037F; //OFS: 0xC037F SIZE: 0x1
|
||||
MemoryNode nodes[MT_NODE_COUNT];
|
||||
unsigned __int8 leftBits[MT_NUM_BUCKETS];
|
||||
unsigned __int8 numBits[MT_NUM_BUCKETS];
|
||||
unsigned __int8 logBits[MT_NUM_BUCKETS];
|
||||
unsigned __int16 head[MT_NODE_BITS + 1];
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(scrMemTreeGlob_t, 0xC0380);
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, nodes, 0x0);
|
||||
@@ -699,8 +791,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, numBits, 0xC0100);
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, logBits, 0xC0200);
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, head, 0xC0300);
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, gap_C0322, 0xC0322);
|
||||
ASSERT_STRUCT_OFFSET(scrMemTreeGlob_t, field_C037F, 0xC037F);
|
||||
|
||||
struct OpcodeLookup
|
||||
{
|
||||
@@ -2134,47 +2224,138 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(node_field_t, type, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(node_field_t, getter, 0xC);
|
||||
|
||||
#pragma endregion
|
||||
struct yy_buffer_state
|
||||
{
|
||||
FILE * yy_input_file; //OFS: 0x0 SIZE: 0x4
|
||||
char * yy_ch_buf; //OFS: 0x4 SIZE: 0x4
|
||||
char * yy_buf_pos; //OFS: 0x8 SIZE: 0x4
|
||||
unsigned int yy_buf_size; //OFS: 0xC SIZE: 0x4
|
||||
int yy_n_chars; //OFS: 0x10 SIZE: 0x4
|
||||
int yy_is_our_buffer; //OFS: 0x14 SIZE: 0x4
|
||||
int yy_is_interactive; //OFS: 0x18 SIZE: 0x4
|
||||
int yy_at_bol; //OFS: 0x1C SIZE: 0x4
|
||||
int yy_fill_buffer; //OFS: 0x20 SIZE: 0x4
|
||||
int yy_buffer_status; //OFS: 0x24 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(yy_buffer_state, 0x28);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_input_file, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_ch_buf, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buf_pos, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buf_size, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_n_chars, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_is_our_buffer, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_is_interactive, 0x18);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_at_bol, 0x1C);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_fill_buffer, 0x20);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buffer_status, 0x24);
|
||||
|
||||
#pragma region "data"
|
||||
#pragma endregion
|
||||
|
||||
#pragma region "functions"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region "cscr_main"
|
||||
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, const char* file, PrecacheEntry* entries, int entriesCount)> Scr_LoadScriptInternal{ 0x0, 0x689980 };
|
||||
WEAK symbol<void(scriptInstance_t a1)>Scr_EndLoadScripts{ 0x0, 0x689C80 };
|
||||
WEAK symbol<void(scriptInstance_t inst, void *(__cdecl *Alloc)(int), int user, int modChecksum)> Scr_PrecacheAnimTrees{0x0, 0x689D60};
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_EndLoadAnimTrees{ 0x0, 0x689DC0 };
|
||||
|
||||
inline void* Scr_IsIdentifier_ADDR() { return CALL_ADDR(0x0, 0x689470); }
|
||||
bool Scr_IsIdentifier(char* token, void* call_addr = Scr_IsIdentifier_ADDR());
|
||||
inline void* Scr_GetFunctionHandle_ADDR() { return CALL_ADDR(0x0, 0x6894B0); }
|
||||
unsigned int Scr_GetFunctionHandle(const char* file, scriptInstance_t inst, const char* handle, void* call_addr = Scr_GetFunctionHandle_ADDR());
|
||||
inline void* SL_TransferToCanonicalString_ADDR() { return CALL_ADDR(0x0, 0x6895A0); }
|
||||
unsigned int SL_TransferToCanonicalString(scriptInstance_t inst, unsigned int stringValue, void* call_addr = SL_TransferToCanonicalString_ADDR());
|
||||
inline void* SL_GetCanonicalString_ADDR() { return CALL_ADDR(0x0, 0x6895F0); }
|
||||
unsigned int SL_GetCanonicalString(const char* token, scriptInstance_t inst, void* call_addr = SL_GetCanonicalString_ADDR());
|
||||
inline void* Scr_BeginLoadScripts_ADDR() { return CALL_ADDR(0x0, 0x689660); }
|
||||
void Scr_BeginLoadScripts(scriptInstance_t inst, int user, void* call_addr = Scr_BeginLoadScripts_ADDR());
|
||||
inline void* Scr_BeginLoadAnimTrees_ADDR() { return CALL_ADDR(0x0, 0x689880); }
|
||||
void Scr_BeginLoadAnimTrees(scriptInstance_t inst, int user, void* call_addr = Scr_BeginLoadAnimTrees_ADDR());
|
||||
inline void* Scr_ScanFile_ADDR() { return CALL_ADDR(0x0, 0x689900); }
|
||||
int Scr_ScanFile(int max_size, char* buf, void* call_addr = Scr_ScanFile_ADDR());
|
||||
inline void* Scr_LoadScript_ADDR() { return CALL_ADDR(0x0, 0x689C60); }
|
||||
unsigned int Scr_LoadScript(const char* file, scriptInstance_t inst, void* call_addr = Scr_LoadScript_ADDR());
|
||||
inline void* Scr_FreeScripts_ADDR() { return CALL_ADDR(0x0, 0x689E50); }
|
||||
void Scr_FreeScripts(scriptInstance_t a1, void* call_addr = Scr_FreeScripts_ADDR());
|
||||
|
||||
int Scr_IsInOpcodeMemory(scriptInstance_t inst, const char* pos);
|
||||
void SL_BeginLoadScripts(scriptInstance_t inst);
|
||||
void Scr_SetLoadedImpureScript(bool loadedImpureScript);
|
||||
struct stype_t
|
||||
{
|
||||
sval_u val; //OFS: 0x0 SIZE: 0x4
|
||||
unsigned int pos; //OFS: 0x4 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(stype_t, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(stype_t, val, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(stype_t, pos, 0x4);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#ifdef __cplusplus
|
||||
#pragma region "data"
|
||||
WEAK symbol<scrVmPub_t> gScrVmPub{ 0x0, 0x3BD4700 };
|
||||
WEAK symbol<scrVmGlob_t> gScrVmGlob{ 0x0, 0x3BDDDF8 };
|
||||
WEAK symbol<scrVarPub_t> gScrVarPub{ 0x0, 0x3882B70 };
|
||||
WEAK symbol<scrCompilePub_t> gScrCompilePub{ 0x0, 0x36BFF70 };
|
||||
WEAK symbol<scrAnimPub_t> gScrAnimPub{ 0x0, 0x36BF738 };
|
||||
WEAK symbol<jmp_buf> g_script_error{ 0x0, 0x3BDCD40 };
|
||||
WEAK symbol<int> g_script_error_level{ 0x0, 0x3BDDDC0 };
|
||||
WEAK symbol<function_stack_t> gFs{ 0x0, 0x3BDDDD0 };
|
||||
WEAK symbol<OpcodeVM> gOpcode{ 0x0, 0x3BDDDC8 };
|
||||
WEAK symbol<scrVarGlob_t> gScrVarGlob{ 0x0, 0x3914700 };
|
||||
WEAK symbol<scrMemTreePub_t> gScrMemTreePub{ 0x0, 0x3702390 };
|
||||
WEAK symbol<const char*> var_typename{ 0x0, 0x8CF4B0 };
|
||||
WEAK symbol<int> gThreadCount{ 0x0, 0x3882B5C };
|
||||
WEAK symbol<int> gCaseCount{ 0x0, 0x3882B54 };
|
||||
WEAK symbol<scrMemTreeGlob_t> gScrMemTreeGlob{ 0x0, 0x3702400 };
|
||||
WEAK symbol<int> gScrExecuteTime{ 0x0, 0x3882B4C };
|
||||
WEAK symbol<char> g_EndPos{ 0x0, 0x46E54C3 };
|
||||
WEAK symbol<scrStringGlob_t> gScrStringGlob{ 0x0, 0x38B2C00 };
|
||||
WEAK symbol<scrParserGlob_t> gScrParserGlob{ 0x0, 0x3702398 };
|
||||
WEAK symbol<scrParserPub_t> gScrParserPub{ 0x0, 0x3882B00 };
|
||||
WEAK symbol<scr_classStruct_t*> gScrClassMap{ 0x0, 0x8CF568 };
|
||||
WEAK symbol<scr_const_t> scr_const{ 0x0, 0x1F33B90 };
|
||||
WEAK symbol<bool> loadedImpureScript{ 0x0, 0x22C1352 };
|
||||
WEAK symbol<dvar_s*> sv_clientside{ 0x0, 0x3882B6C };
|
||||
WEAK symbol<char> error_message_buff{ 0x0, 0x3BE1E30 };
|
||||
WEAK symbol<scrCompileGlob_t> gScrCompileGlob{ 0x0, 0x3701FE0 };
|
||||
WEAK symbol<scrAnimGlob_t> gScrAnimGlob{ 0x0, 0x36BF320 };
|
||||
|
||||
WEAK symbol<unsigned char> g_parse_user{ 0x0, 0x234F72E };
|
||||
WEAK symbol<scriptInstance_t> gInst{ 0x0, 0x3BE624C };
|
||||
WEAK symbol<int> yynerrs{ 0x0, 0x3BE6264 };
|
||||
WEAK symbol<int> yychar{ 0x0, 0x3BE6260 };
|
||||
WEAK symbol<stype_t> yylval{ 0x0, 0x3BE6240 };
|
||||
WEAK symbol<unsigned int> g_sourcePos{ 0x0, 0x3BE623C };
|
||||
WEAK symbol<sval_u> yaccResult{ 0x0, 0x3BE6258 };
|
||||
WEAK symbol<sval_u> g_dummyVal{ 0x0, 0x3BE6254 };
|
||||
WEAK symbol<int> yy_init{ 0x0, 0x8CF4A0 };
|
||||
WEAK symbol<int> yy_start{ 0x0, 0x46E54D4 };
|
||||
WEAK symbol<FILE*> yyin{ 0x0, 0x46E54D8 };
|
||||
WEAK symbol<FILE*> yyout{ 0x0, 0x46E54DC };
|
||||
WEAK symbol<yy_buffer_state*> yy_current_buffer{ 0x0, 0x46E54CC };
|
||||
WEAK symbol<int> yy_n_chars{ 0x0, 0x3BE6250 };
|
||||
WEAK symbol<char> yy_hold_char{ 0x0, 0x22C1353 };
|
||||
WEAK symbol<char*> yy_c_buf_p{ 0x0, 0x46E54D0 };
|
||||
WEAK symbol<int> yy_last_accepting_state{ 0x0, 0x3BE626C };
|
||||
WEAK symbol<char*> yy_last_accepting_cpos{ 0x0, 0x3BE2230 };
|
||||
WEAK symbol<size_t> yyleng{ 0x0, 0x3BE6248 };
|
||||
WEAK symbol<char*> yytext{ 0x0, 0x3BE2234 };
|
||||
WEAK symbol<int> yy_did_buffer_switch_on_eof{ 0x0, 0x3BE6268 };
|
||||
WEAK symbol<unsigned int> g_out_pos{ 0x0, 0x3BE625C };
|
||||
WEAK symbol<char> ch_buf{ 0x0, 0x3BE2238 };
|
||||
WEAK symbol<short> yypact{ 0x0, 0x82F2D0 };
|
||||
WEAK symbol<char> yytranslate{ 0x0, 0x82ED08 };
|
||||
WEAK symbol<short> yycheck{ 0x0, 0x82FFA0 };
|
||||
WEAK symbol<short> yytable{ 0x0, 0x82F518 };
|
||||
WEAK symbol<short> yyr1{ 0x0, 0x82EE68 };
|
||||
WEAK symbol<short> yyr2{ 0x0, 0x82EF78 };
|
||||
WEAK symbol<short> yydefact{ 0x0, 0x82F088 };
|
||||
WEAK symbol<int> yy_ec{ 0x0, 0x830C30 };
|
||||
WEAK symbol<short> yy_accept{ 0x0, 0x830A28 };
|
||||
WEAK symbol<short> yy_chk{ 0x0, 0x831930 };
|
||||
WEAK symbol<short> yy_base{ 0x0, 0x831120 };
|
||||
WEAK symbol<short> yy_def{ 0x0, 0x831338 };
|
||||
WEAK symbol<short> yy_nxt{ 0x0, 0x831550 };
|
||||
WEAK symbol<int> yy_meta{ 0x0, 0x831030 };
|
||||
WEAK symbol<short> yypgoto{ 0x0, 0x82F426 };
|
||||
WEAK symbol<short> yydefgoto{ 0x0, 0x82F1DE };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region "functions"
|
||||
WEAK symbol<int(jmp_buf buf, int count)>_setjmp3{ 0x0, 0x7E1894 };
|
||||
WEAK symbol<void(jmp_buf Buf, int Value)>longjmp{ 0x0, 0x7AD57C };
|
||||
|
||||
inline void* CScr_SetEntityField_ADDR() { return CALL_ADDR(0x0, 0x671470); }
|
||||
int CScr_SetEntityField(int ofs, int entnum, unsigned int clientnum, void* call_addr = CScr_SetEntityField_ADDR());
|
||||
inline void* Scr_SetObjectField_ADDR() { return CALL_ADDR(0x0, 0x5469C0); }
|
||||
int Scr_SetObjectField(int ofs, int entnum, classNum_e classnum, scriptInstance_t inst, void* call_addr = Scr_SetObjectField_ADDR());
|
||||
inline void* CScr_GetEntityField_ADDR() { return CALL_ADDR(0x0, 0x671410); }
|
||||
void CScr_GetEntityField(int ofs, int entnum, unsigned int clientnum, void* call_addr = CScr_GetEntityField_ADDR());
|
||||
inline void* Scr_GetObjectField_ADDR() { return CALL_ADDR(0x0, 0x546D30); }
|
||||
void Scr_GetObjectField(int ofs, int inst, classNum_e classnum, int entnum, void* call_addr = Scr_GetObjectField_ADDR());
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
#include "cscr_main.hpp"
|
||||
#include "cscr_memorytree.hpp"
|
||||
#include "cscr_parser.hpp"
|
||||
#include "cscr_parsetree.hpp"
|
||||
#include "cscr_readwrite.hpp"
|
||||
#include "cscr_stringlist.hpp"
|
||||
#include "cscr_tempmemory.hpp"
|
||||
#include "cscr_variable.hpp"
|
||||
#include "cscr_vm.hpp"
|
||||
#include "cscr_compiler.hpp"
|
||||
#include "cscr_yacc.hpp"
|
||||
#include "cscr_animtree.hpp"
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
int CScr_SetEntityField/*@<eax>*/(int ofs/*@<edx>*/, int entnum/*@<ecx>*/, unsigned int clientnum, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push clientnum;
|
||||
mov edx, ofs;
|
||||
mov ecx, entnum;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
int Scr_SetObjectField/*@<eax>*/(int ofs/*@<eax>*/, int entnum/*@<edx>*/, classNum_e classnum, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push inst;
|
||||
push classnum;
|
||||
mov eax, ofs;
|
||||
mov edx, entnum;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
void CScr_GetEntityField(int ofs/*@<edx>*/, int entnum/*@<ecx>*/, unsigned int clientnum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push clientnum;
|
||||
mov edx, ofs;
|
||||
mov ecx, entnum;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
void Scr_GetObjectField(int ofs/*@<eax>*/, int inst/*@<edx>*/, classNum_e classnum, int entnum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push entnum;
|
||||
push classnum;
|
||||
mov eax, ofs;
|
||||
mov edx, inst;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<void(scriptInstance_t inst, const char * errorMsg)>AnimTreeCompileError{ 0x0, 0x67D4B0};
|
||||
WEAK symbol<int(scriptInstance_t inst)>GetAnimTreeParseProperties{ 0x0, 0x67D510};
|
||||
WEAK symbol<char(scriptInstance_t inst, int parentId, int names, int bIncludeParent, int bLoop, int bComplete)>AnimTreeParseInternal{ 0x0, 0x67D770};
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int parentNode)>Scr_GetAnimTreeSize{ 0x0, 0x67DE20};
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int parentNode, unsigned int rootData, XAnim_s* animtree, unsigned int childIndex, const char* name, unsigned int parentIndex, unsigned int filename, int treeIndex, int flags)>Scr_CreateAnimationTree{ 0x0, 0x67DFB0};
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int parentNode)>Scr_PrecacheAnimationTree{ 0x0, 0x67E360};
|
||||
WEAK symbol<void(const char * animtreeName)>Scr_SetAnimTreeConfigstring{ 0x0, 0x67E670};
|
||||
|
||||
inline void* Scr_EmitAnimationInternal_ADDR() { return CALL_ADDR(0x0, 0x67D6B0); }
|
||||
void Scr_EmitAnimationInternal(scriptInstance_t inst, const char * pos, unsigned int animName, unsigned int names, void* call_addr = Scr_EmitAnimationInternal_ADDR());
|
||||
inline void* Scr_AnimTreeParse_ADDR() { return CALL_ADDR(0x0, 0x67DDA0); }
|
||||
void Scr_AnimTreeParse(scriptInstance_t inst, const char * pos, unsigned int parentNode, unsigned int names, void* call_addr = Scr_AnimTreeParse_ADDR());
|
||||
inline void* ConnectScriptToAnim_ADDR() { return CALL_ADDR(0x0, 0x67DEC0); }
|
||||
void ConnectScriptToAnim(unsigned int name, unsigned int names, scriptInstance_t inst, int index, unsigned int filename, int treeIndex, void* call_addr = ConnectScriptToAnim_ADDR());
|
||||
inline void* Scr_GetAnimsIndex_ADDR() { return CALL_ADDR(0x0, 0x67DF90); }
|
||||
int Scr_GetAnimsIndex(XAnim_s * anim, void* call_addr = Scr_GetAnimsIndex_ADDR());
|
||||
inline void* Scr_CheckAnimsDefined_ADDR() { return CALL_ADDR(0x0, 0x67E260); }
|
||||
void Scr_CheckAnimsDefined(unsigned int names, scriptInstance_t a2, unsigned int filename, void* call_addr = Scr_CheckAnimsDefined_ADDR());
|
||||
inline void* Scr_UsingTreeInternal_ADDR() { return CALL_ADDR(0x0, 0x67E420); }
|
||||
unsigned int Scr_UsingTreeInternal(const char * filename, int user, scriptInstance_t inst, unsigned int * index, void* call_addr = Scr_UsingTreeInternal_ADDR());
|
||||
inline void* Scr_UsingTree_ADDR() { return CALL_ADDR(0x0, 0x67E5F0); }
|
||||
void Scr_UsingTree(scriptInstance_t a1, const char * filename, unsigned int sourcePos, void* call_addr = Scr_UsingTree_ADDR());
|
||||
inline void* Scr_LoadAnimTreeInternal_ADDR() { return CALL_ADDR(0x0, 0x67E710); }
|
||||
bool Scr_LoadAnimTreeInternal(const char * animtreeName, scriptInstance_t inst, unsigned int parentNode, unsigned int names, void* call_addr = Scr_LoadAnimTreeInternal_ADDR());
|
||||
inline void* Scr_LoadAnimTreeAtIndex_ADDR() { return CALL_ADDR(0x0, 0x67E7D0); }
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void *(__cdecl * Alloc)(int), int modCheckSum, void* call_addr = Scr_LoadAnimTreeAtIndex_ADDR());
|
||||
inline void* Scr_FindAnimTree_ADDR() { return CALL_ADDR(0x0, 0x67EA70); }
|
||||
scr_animtree_t Scr_FindAnimTree(const char * filename, void* call_addr = Scr_FindAnimTree_ADDR());
|
||||
inline void* Scr_FindAnim_ADDR() { return CALL_ADDR(0x0, 0x67EB10); }
|
||||
void Scr_FindAnim(const char * animName, scr_anim_s a2, int user, void* call_addr = Scr_FindAnim_ADDR());
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
#include <stdinc.hpp>
|
||||
//#include "codsrc/clientscript/cscr_animtree.hpp"
|
||||
|
||||
namespace game
|
||||
{
|
||||
// void __usercall Scr_EmitAnimationInternal(scriptInstance_t inst@<edi>, const char *pos, unsigned int animName, unsigned int names)
|
||||
void Scr_EmitAnimationInternal(scriptInstance_t inst, const char * pos, unsigned int animName, unsigned int names, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push animName;
|
||||
push pos;
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_AnimTreeParse(scriptInstance_t inst@<eax>, const char *pos@<edi>, unsigned int parentNode, unsigned int names)
|
||||
void Scr_AnimTreeParse(scriptInstance_t inst, const char * pos, unsigned int parentNode, unsigned int names, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push parentNode;
|
||||
mov eax, inst;
|
||||
mov edi, pos;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall ConnectScriptToAnim(unsigned int name@<eax>, unsigned int names@<edi>, scriptInstance_t inst, int index, unsigned int filename, int treeIndex)
|
||||
void ConnectScriptToAnim(unsigned int name, unsigned int names, scriptInstance_t inst, int index, unsigned int filename, int treeIndex, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push treeIndex;
|
||||
push filename;
|
||||
push index;
|
||||
push inst;
|
||||
mov eax, name;
|
||||
mov edi, names;
|
||||
call call_addr;
|
||||
add esp, 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
// int __usercall Scr_GetAnimsIndex@<eax>(XAnim_s *anim@<ecx>)
|
||||
int Scr_GetAnimsIndex(XAnim_s * anim, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, anim;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_CheckAnimsDefined(unsigned int names@<eax>, scriptInstance_t a2@<ecx>, unsigned int filename)
|
||||
void Scr_CheckAnimsDefined(unsigned int names, scriptInstance_t a2, unsigned int filename, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push filename;
|
||||
mov eax, names;
|
||||
mov ecx, a2;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_UsingTreeInternal@<eax>(const char *filename@<eax>, int user@<ecx>, scriptInstance_t inst, unsigned int *index)
|
||||
unsigned int Scr_UsingTreeInternal(const char * filename, int user, scriptInstance_t inst, unsigned int * index, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push index;
|
||||
push inst;
|
||||
mov eax, filename;
|
||||
mov ecx, user;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_UsingTree(scriptInstance_t a1@<edi>, const char *filename, unsigned int sourcePos)
|
||||
void Scr_UsingTree(scriptInstance_t a1, const char * filename, unsigned int sourcePos, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push sourcePos;
|
||||
push filename;
|
||||
mov edi, a1;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// bool __usercall Scr_LoadAnimTreeInternal@<al>(const char *animtreeName@<eax>, scriptInstance_t inst@<ecx>, unsigned int parentNode, unsigned int names)
|
||||
bool Scr_LoadAnimTreeInternal(const char * animtreeName, scriptInstance_t inst, unsigned int parentNode, unsigned int names, void* call_addr)
|
||||
{
|
||||
bool answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push parentNode;
|
||||
mov eax, animtreeName;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, al;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_LoadAnimTreeAtIndex(scriptInstance_t inst@<ecx>, int a2@<eax>, int a3, int (__cdecl *a4)(int), int a5)
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void* (__cdecl* Alloc)(int), int modCheckSum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push modCheckSum;
|
||||
push Alloc;
|
||||
push index;
|
||||
mov eax, user;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
// XAnim_s *__usercall Scr_FindAnimTree@<eax>(const char *filename@<eax>)
|
||||
scr_animtree_t Scr_FindAnimTree(const char * filename, void* call_addr)
|
||||
{
|
||||
scr_animtree_t answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, filename;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_FindAnim(const char *animName@<edx>, scr_anim_s a2, int user)
|
||||
void Scr_FindAnim(const char * animName, scr_anim_s a2, int user, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push user;
|
||||
push a2;
|
||||
mov edx, animName;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<void(scriptInstance_t inst, VariableValue* value)>RemoveRefToValue{ 0x0, 0x67EB70 };
|
||||
WEAK symbol<void(scriptInstance_t inst, OpcodeVM op, int offset, int callType)>EmitOpcode{ 0x0, 0x67ECA0 };
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int name, sval_u sourcePos, int create, scr_block_s* block)>Scr_FindLocalVarIndex{ 0x0, 0x67F500 };
|
||||
WEAK symbol<void(scriptInstance_t inst, scr_block_s* block)>EmitCreateLocalVars{ 0x0, 0x67F730 };
|
||||
WEAK symbol<void(scr_block_s** childBlocks, int childCount, scr_block_s* block)>Scr_InitFromChildBlocks{ 0x0, 0x67FA00 };
|
||||
WEAK symbol<void(scr_block_s** childBlocks, int childCount, scr_block_s* block)>Scr_MergeChildBlocks{ 0x0, 0x67FB80 };
|
||||
WEAK symbol<void(scriptInstance_t inst, VariableCompileValue* constValue)>EmitValue{ 0x0, 0x680050 };
|
||||
WEAK symbol<void(unsigned int name, sval_u sourcePos, scr_block_s* block)>Scr_RegisterLocalVar{ 0x0, 0x680D10 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u sourcePos)>EmitCastFieldObject{ 0x0, 0x681720 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, scr_block_s* block)>EmitVariableExpression{ 0x0, 0x681990 };
|
||||
WEAK symbol<int(scriptInstance_t inst, sval_u exprlist, scr_block_s* block)>EmitExpressionList{ 0x0, 0x681AD0 };
|
||||
WEAK symbol<int(scriptInstance_t inst, int func)>AddFunction{ 0x0, 0x682040 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u func, int param_count, int bMethod, sval_u nameSourcePos)>EmitPostScriptFunction{ 0x0, 0x6820B0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u func_name, sval_u params, sval_u methodSourcePos, int bStatement, scr_block_s* block)>EmitMethod{ 0x0, 0x682F40 };
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int posId, unsigned int name, unsigned int sourcePos)>CheckThreadPosition{ 0x0, 0x683580 };
|
||||
WEAK symbol<bool(scriptInstance_t inst, sval_u exprlist, sval_u sourcePos, VariableCompileValue* constValue)>EvalPrimitiveExpressionList{ 0x0, 0x6837C0 };
|
||||
WEAK symbol<bool(scriptInstance_t inst, sval_u expr, VariableCompileValue* constValue)>EvalPrimitiveExpression{ 0x0, 0x683B50 };
|
||||
WEAK symbol<bool(scriptInstance_t inst, sval_u expr, VariableCompileValue* constValue, scr_block_s* block)>EmitOrEvalPrimitiveExpression{ 0x0, 0x683CF0 };
|
||||
WEAK symbol<bool(scriptInstance_t inst, sval_u expr1, sval_u expr2, sval_u opcode, sval_u sourcePos, VariableCompileValue* constValue)>EvalBinaryOperatorExpression{ 0x0, 0x684220 };
|
||||
WEAK symbol<bool(scriptInstance_t inst, sval_u expr, VariableCompileValue* constValue, scr_block_s* block)>EmitOrEvalExpression{ 0x0, 0x684590 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, scr_block_s* block)>EmitExpression{ 0x0, 0x684750 };
|
||||
WEAK symbol<void(sval_u expr, scr_block_s* block)>Scr_CalcLocalVarsArrayVariableRef{ 0x0, 0x684950 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u sourcePos, scr_block_s* block)>EmitPrimitiveExpressionFieldObject{ 0x0, 0x6849A0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u stmt, scr_block_s* block, sval_u* ifStatBlock)>Scr_CalcLocalVarsIfStatement{ 0x0, 0x685170 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u stmt1, sval_u stmt2, sval_u sourcePos, sval_u elseSourcePos, int lastStatement, unsigned int endSourcePos, scr_block_s* block, sval_u* ifStatBlock, sval_u* elseStatBlock)>EmitIfElseStatement{ 0x0, 0x6851D0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u stmt1, sval_u stmt2, scr_block_s* block, sval_u* ifStatBlock, sval_u* elseStatBlock)>Scr_CalcLocalVarsIfElseStatement{ 0x0, 0x685590 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u stmt, sval_u sourcePos, sval_u whileSourcePos, scr_block_s* block, sval_u* whileStatBlock)>EmitWhileStatement{ 0x0, 0x685760 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u stmt, scr_block_s* block, sval_u* whileStatBlock)>Scr_CalcLocalVarsWhileStatement{ 0x0, 0x685C30 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u stmt1, sval_u expr, sval_u stmt2, sval_u stmt, sval_u sourcePos, sval_u forSourcePos, scr_block_s* block, sval_u* forStatBlock, sval_u* forStatPostBlock)>EmitForStatement{ 0x0, 0x685DF0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u stmt1, sval_u expr, sval_u stmt2, sval_u stmt, scr_block_s* block, sval_u* forStatBlock, sval_u* forStatPostBlock)>Scr_CalcLocalVarsForStatement{ 0x0, 0x686330 };
|
||||
WEAK symbol<int(const void* elem1, const void* elem2)>CompareCaseInfo{ 0x0, 0x6870E0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, int lastStatement, unsigned int endSourcePos, scr_block_s* block)>EmitSwitchStatementList{ 0x0, 0x6871A0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u stmtlist, scr_block_s* block)>Scr_CalcLocalVarsSwitchStatement{ 0x0, 0x6873D0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, sval_u stmtlist, sval_u sourcePos, int lastStatement, unsigned int endSourcePos, scr_block_s* block)>EmitSwitchStatement{ 0x0, 0x6875F0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, int lastStatement, unsigned int endSourcePos, scr_block_s* block)>EmitStatement{ 0x0, 0x687DB0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, scr_block_s* block)>Scr_CalcLocalVarsStatement{ 0x0, 0x688210 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, int lastStatement, unsigned int endSourcePos, scr_block_s* block)>EmitStatementList{ 0x0, 0x688470 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, scr_block_s* block, sval_u* devStatBlock)>Scr_CalcLocalVarsDeveloperStatementList{ 0x0, 0x688530 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val, sval_u sourcePos, scr_block_s* block, sval_u* devStatBlock)>EmitDeveloperStatementList{ 0x0, 0x6885A0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u val)>EmitThreadList{ 0x0, 0x688D40 };
|
||||
WEAK symbol<void(scriptInstance_t inst, sval_u expr, scr_block_s* block)>EmitVariableExpressionRef{ 0x0, 0x684790 };
|
||||
|
||||
inline void* Scr_CompileRemoveRefToString_ADDR() { return CALL_ADDR(0x0, 0x67EB90); }
|
||||
void Scr_CompileRemoveRefToString(scriptInstance_t inst, unsigned int stringVal, void* call_addr = Scr_CompileRemoveRefToString_ADDR());
|
||||
inline void* EmitCanonicalString_ADDR() { return CALL_ADDR(0x0, 0x67EBB0); }
|
||||
void EmitCanonicalString(scriptInstance_t inst, unsigned int stringVal, void* call_addr = EmitCanonicalString_ADDR());
|
||||
inline void* CompileTransferRefToString_ADDR() { return CALL_ADDR(0x0, 0x67EC30); }
|
||||
void CompileTransferRefToString(unsigned int stringValue, scriptInstance_t inst, unsigned int user, void* call_addr = CompileTransferRefToString_ADDR());
|
||||
inline void* EmitEnd_ADDR() { return CALL_ADDR(0x0, 0x67F0C0); }
|
||||
void EmitEnd(scriptInstance_t inst, void* call_addr = EmitEnd_ADDR());
|
||||
inline void* EmitReturn_ADDR() { return CALL_ADDR(0x0, 0x67F1A0); }
|
||||
void EmitReturn(scriptInstance_t inst, void* call_addr = EmitReturn_ADDR());
|
||||
inline void* EmitCodepos_ADDR() { return CALL_ADDR(0x0, 0x67F290); }
|
||||
void EmitCodepos(scriptInstance_t inst, int codepos, void* call_addr = EmitCodepos_ADDR());
|
||||
inline void* EmitShort_ADDR() { return CALL_ADDR(0x0, 0x67F2C0); }
|
||||
void EmitShort(scriptInstance_t inst, int value, void* call_addr = EmitShort_ADDR());
|
||||
inline void* EmitByte_ADDR() { return CALL_ADDR(0x0, 0x67F2F0); }
|
||||
void EmitByte(scriptInstance_t inst, int value, void* call_addr = EmitByte_ADDR());
|
||||
inline void* EmitGetInteger_ADDR() { return CALL_ADDR(0x0, 0x67F320); }
|
||||
void EmitGetInteger(scriptInstance_t inst, int value, sval_u sourcePos, void* call_addr = EmitGetInteger_ADDR());
|
||||
inline void* EmitGetFloat_ADDR() { return CALL_ADDR(0x0, 0x67F470); }
|
||||
void EmitGetFloat(scriptInstance_t inst, float value, sval_u sourcePos, void* call_addr = EmitGetFloat_ADDR());
|
||||
inline void* EmitAnimTree_ADDR() { return CALL_ADDR(0x0, 0x67F4C0); }
|
||||
void EmitAnimTree(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitAnimTree_ADDR());
|
||||
inline void* EmitRemoveLocalVars_ADDR() { return CALL_ADDR(0x0, 0x67F880); }
|
||||
void EmitRemoveLocalVars(scriptInstance_t inst, scr_block_s* outerBlock, scr_block_s* block, void* call_addr = EmitRemoveLocalVars_ADDR());
|
||||
inline void* EmitNOP2_ADDR() { return CALL_ADDR(0x0, 0x67F9A0); }
|
||||
void EmitNOP2(scr_block_s* block, scriptInstance_t inst, int lastStatement, unsigned int endSourcePos, void* call_addr = EmitNOP2_ADDR());
|
||||
inline void* Scr_AppendChildBlocks_ADDR() { return CALL_ADDR(0x0, 0x67FAA0); }
|
||||
void Scr_AppendChildBlocks(scr_block_s* block, scr_block_s** childBlocks, int childCount, void* call_addr = Scr_AppendChildBlocks_ADDR());
|
||||
inline void* Scr_TransferBlock_ADDR() { return CALL_ADDR(0x0, 0x67FC60); }
|
||||
void Scr_TransferBlock(scr_block_s* to, scr_block_s* from, void* call_addr = Scr_TransferBlock_ADDR());
|
||||
inline void* EmitSafeSetVariableField_ADDR() { return CALL_ADDR(0x0, 0x67FD50); }
|
||||
void EmitSafeSetVariableField(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitSafeSetVariableField_ADDR());
|
||||
inline void* EmitSafeSetWaittillVariableField_ADDR() { return CALL_ADDR(0x0, 0x67FDC0); }
|
||||
void EmitSafeSetWaittillVariableField(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitSafeSetWaittillVariableField_ADDR());
|
||||
inline void* EmitGetString_ADDR() { return CALL_ADDR(0x0, 0x67FEE0); }
|
||||
void EmitGetString(unsigned int value, scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitGetString_ADDR());
|
||||
inline void* EmitGetIString_ADDR() { return CALL_ADDR(0x0, 0x67FF30); }
|
||||
void EmitGetIString(unsigned int value, scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitGetIString_ADDR());
|
||||
inline void* EmitGetVector_ADDR() { return CALL_ADDR(0x0, 0x67FF80); }
|
||||
void EmitGetVector(const float* value, scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitGetVector_ADDR());
|
||||
inline void* Scr_PushValue_ADDR() { return CALL_ADDR(0x0, 0x680120); }
|
||||
void Scr_PushValue(scriptInstance_t inst, VariableCompileValue* constValue, void* call_addr = Scr_PushValue_ADDR());
|
||||
inline void* EmitCastBool_ADDR() { return CALL_ADDR(0x0, 0x680180); }
|
||||
void EmitCastBool(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitCastBool_ADDR());
|
||||
inline void* EmitBoolNot_ADDR() { return CALL_ADDR(0x0, 0x680270); }
|
||||
void EmitBoolNot(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitBoolNot_ADDR());
|
||||
inline void* EmitBoolComplement_ADDR() { return CALL_ADDR(0x0, 0x680360); }
|
||||
void EmitBoolComplement(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitBoolComplement_ADDR());
|
||||
inline void* EmitSize_ADDR() { return CALL_ADDR(0x0, 0x680450); }
|
||||
void EmitSize(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitSize_ADDR());
|
||||
inline void* EmitSelf_ADDR() { return CALL_ADDR(0x0, 0x680560); }
|
||||
void EmitSelf(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitSelf_ADDR());
|
||||
inline void* EmitLevel_ADDR() { return CALL_ADDR(0x0, 0x680660); }
|
||||
void EmitLevel(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitLevel_ADDR());
|
||||
inline void* EmitGame_ADDR() { return CALL_ADDR(0x0, 0x680760); }
|
||||
void EmitGame(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitGame_ADDR());
|
||||
inline void* EmitAnim_ADDR() { return CALL_ADDR(0x0, 0x680860); }
|
||||
void EmitAnim(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitAnim_ADDR());
|
||||
inline void* EmitSelfObject_ADDR() { return CALL_ADDR(0x0, 0x680960); }
|
||||
void EmitSelfObject(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitSelfObject_ADDR());
|
||||
inline void* EmitLevelObject_ADDR() { return CALL_ADDR(0x0, 0x680A50); }
|
||||
void EmitLevelObject(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitLevelObject_ADDR());
|
||||
inline void* EmitAnimObject_ADDR() { return CALL_ADDR(0x0, 0x680B40); }
|
||||
void EmitAnimObject(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitAnimObject_ADDR());
|
||||
inline void* EmitLocalVariable_ADDR() { return CALL_ADDR(0x0, 0x680C30); }
|
||||
void EmitLocalVariable(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitLocalVariable_ADDR());
|
||||
inline void* EmitLocalVariableRef_ADDR() { return CALL_ADDR(0x0, 0x680CA0); }
|
||||
void EmitLocalVariableRef(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitLocalVariableRef_ADDR());
|
||||
inline void* EmitGameRef_ADDR() { return CALL_ADDR(0x0, 0x680D60); }
|
||||
void EmitGameRef(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitGameRef_ADDR());
|
||||
inline void* EmitClearArray_ADDR() { return CALL_ADDR(0x0, 0x680E50); }
|
||||
void EmitClearArray(scriptInstance_t inst, sval_u sourcePos, sval_u indexSourcePos, void* call_addr = EmitClearArray_ADDR());
|
||||
inline void* EmitEmptyArray_ADDR() { return CALL_ADDR(0x0, 0x680F50); }
|
||||
void EmitEmptyArray(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitEmptyArray_ADDR());
|
||||
inline void* EmitAnimation_ADDR() { return CALL_ADDR(0x0, 0x681050); }
|
||||
void EmitAnimation(scriptInstance_t inst, sval_u anim, sval_u sourcePos, void* call_addr = EmitAnimation_ADDR());
|
||||
inline void* EmitFieldVariable_ADDR() { return CALL_ADDR(0x0, 0x6811C0); }
|
||||
void EmitFieldVariable(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u field, sval_u sourcePos, void* call_addr = EmitFieldVariable_ADDR());
|
||||
inline void* EmitClearFieldVariable_ADDR() { return CALL_ADDR(0x0, 0x681200); }
|
||||
void EmitClearFieldVariable(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u field, sval_u sourcePos, sval_u rhsSourcePos, void* call_addr = EmitClearFieldVariable_ADDR());
|
||||
inline void* EmitObject_ADDR() { return CALL_ADDR(0x0, 0x681310); }
|
||||
void EmitObject(scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitObject_ADDR());
|
||||
inline void* EmitDecTop_ADDR() { return CALL_ADDR(0x0, 0x681630); }
|
||||
void EmitDecTop(scriptInstance_t inst, void* call_addr = EmitDecTop_ADDR());
|
||||
inline void* EmitArrayVariable_ADDR() { return CALL_ADDR(0x0, 0x681840); }
|
||||
void EmitArrayVariable(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u index, sval_u sourcePos, sval_u indexSourcePos, void* call_addr = EmitArrayVariable_ADDR());
|
||||
inline void* EmitArrayVariableRef_ADDR() { return CALL_ADDR(0x0, 0x6818C0); }
|
||||
void EmitArrayVariableRef(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u index, sval_u sourcePos, sval_u indexSourcePos, void* call_addr = EmitArrayVariableRef_ADDR());
|
||||
inline void* EmitClearArrayVariable_ADDR() { return CALL_ADDR(0x0, 0x681930); }
|
||||
void EmitClearArrayVariable(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u index, sval_u sourcePos, sval_u indexSourcePos, void* call_addr = EmitClearArrayVariable_ADDR());
|
||||
inline void* AddExpressionListOpcodePos_ADDR() { return CALL_ADDR(0x0, 0x681B30); }
|
||||
void AddExpressionListOpcodePos(scriptInstance_t inst, sval_u exprlist, void* call_addr = AddExpressionListOpcodePos_ADDR());
|
||||
inline void* AddFilePrecache_ADDR() { return CALL_ADDR(0x0, 0x681B70); }
|
||||
void AddFilePrecache(scriptInstance_t inst, unsigned int filename, unsigned int sourcePos, int include, unsigned int* filePosId, unsigned int* fileCountId, void* call_addr = AddFilePrecache_ADDR());
|
||||
inline void* EmitFunction_ADDR() { return CALL_ADDR(0x0, 0x681C30); }
|
||||
void EmitFunction(scriptInstance_t inst, sval_u func, sval_u sourcePos, void* call_addr = EmitFunction_ADDR());
|
||||
inline void* EmitGetFunction_ADDR() { return CALL_ADDR(0x0, 0x681F30); }
|
||||
void EmitGetFunction(scriptInstance_t inst, sval_u func, sval_u sourcePos, void* call_addr = EmitGetFunction_ADDR());
|
||||
inline void* EmitPostScriptFunctionPointer_ADDR() { return CALL_ADDR(0x0, 0x6822F0); }
|
||||
void EmitPostScriptFunctionPointer(scr_block_s* block, scriptInstance_t inst, sval_u expr, int param_count, int bMethod, sval_u nameSourcePos, sval_u sourcePos, void* call_addr = EmitPostScriptFunctionPointer_ADDR());
|
||||
inline void* EmitPostScriptThread_ADDR() { return CALL_ADDR(0x0, 0x682500); }
|
||||
void EmitPostScriptThread(scriptInstance_t inst, sval_u func, int param_count, int bMethod, sval_u sourcePos, void* call_addr = EmitPostScriptThread_ADDR());
|
||||
inline void* EmitPostScriptThreadPointer_ADDR() { return CALL_ADDR(0x0, 0x682730); }
|
||||
void EmitPostScriptThreadPointer(scr_block_s* block, scriptInstance_t inst, sval_u expr, int param_count, int bMethod, sval_u sourcePos, void* call_addr = EmitPostScriptThreadPointer_ADDR());
|
||||
inline void* EmitPostScriptFunctionCall_ADDR() { return CALL_ADDR(0x0, 0x682950); }
|
||||
void EmitPostScriptFunctionCall(scriptInstance_t inst, int bMethod, int param_count, sval_u func_name, sval_u nameSourcePos, scr_block_s* block, void* call_addr = EmitPostScriptFunctionCall_ADDR());
|
||||
inline void* EmitPostScriptThreadCall_ADDR() { return CALL_ADDR(0x0, 0x6829A0); }
|
||||
void EmitPostScriptThreadCall(scriptInstance_t inst, int isMethod, int param_count, sval_u func_name, sval_u sourcePos, sval_u nameSourcePos, scr_block_s* block, void* call_addr = EmitPostScriptThreadCall_ADDR());
|
||||
inline void* EmitPreFunctionCall_ADDR() { return CALL_ADDR(0x0, 0x6829F0); }
|
||||
void EmitPreFunctionCall(scriptInstance_t inst, void* call_addr = EmitPreFunctionCall_ADDR());
|
||||
inline void* EmitPostFunctionCall_ADDR() { return CALL_ADDR(0x0, 0x682AE0); }
|
||||
void EmitPostFunctionCall(scriptInstance_t inst, int bMethod, sval_u func_name, int param_count, scr_block_s* block, void* call_addr = EmitPostFunctionCall_ADDR());
|
||||
inline void* Scr_BeginDevScript_ADDR() { return CALL_ADDR(0x0, 0x682B30); }
|
||||
void Scr_BeginDevScript(scriptInstance_t isnt, int* type_, char** savedPos, void* call_addr = Scr_BeginDevScript_ADDR());
|
||||
inline void* Scr_EndDevScript_ADDR() { return CALL_ADDR(0x0, 0x682BA0); }
|
||||
void Scr_EndDevScript(scriptInstance_t inst, char** savedPos, void* call_addr = Scr_EndDevScript_ADDR());
|
||||
inline void* EmitCallBuiltinOpcode_ADDR() { return CALL_ADDR(0x0, 0x682BD0); }
|
||||
void EmitCallBuiltinOpcode(scriptInstance_t inst, int param_count, sval_u sourcePos, void* call_addr = EmitCallBuiltinOpcode_ADDR());
|
||||
inline void* EmitCallBuiltinMethodOpcode_ADDR() { return CALL_ADDR(0x0, 0x682C40); }
|
||||
void EmitCallBuiltinMethodOpcode(scriptInstance_t inst, int param_count, sval_u sourcePos, void* call_addr = EmitCallBuiltinMethodOpcode_ADDR());
|
||||
inline void* EmitCall_ADDR() { return CALL_ADDR(0x0, 0x682CA0); }
|
||||
void EmitCall(scriptInstance_t inst, sval_u func_name, sval_u params, int bStatement, scr_block_s* block, void* call_addr = EmitCall_ADDR());
|
||||
inline void* LinkThread_ADDR() { return CALL_ADDR(0x0, 0x683250); }
|
||||
void LinkThread(scriptInstance_t inst, unsigned int threadCountId, VariableValue* pos, int allowFarCall, void* call_addr = LinkThread_ADDR());
|
||||
inline void* LinkFile_ADDR() { return CALL_ADDR(0x0, 0x6833F0); }
|
||||
void LinkFile(scriptInstance_t inst, unsigned int filePosId, unsigned int fileCountId, void* call_addr = LinkFile_ADDR());
|
||||
inline void* EmitCallExpression_ADDR() { return CALL_ADDR(0x0, 0x683640); }
|
||||
void EmitCallExpression(scriptInstance_t inst, scr_block_s* block, sval_u expr, int bStatement, void* call_addr = EmitCallExpression_ADDR());
|
||||
inline void* EmitCallExpressionFieldObject_ADDR() { return CALL_ADDR(0x0, 0x683690); }
|
||||
void EmitCallExpressionFieldObject(scr_block_s* block, scriptInstance_t inst, sval_u expr, void* call_addr = EmitCallExpressionFieldObject_ADDR());
|
||||
inline void* Scr_CreateVector_ADDR() { return CALL_ADDR(0x0, 0x6836F0); }
|
||||
void Scr_CreateVector(scriptInstance_t inst, VariableCompileValue* constValue, VariableValue* value, void* call_addr = Scr_CreateVector_ADDR());
|
||||
inline void* EmitOrEvalPrimitiveExpressionList_ADDR() { return CALL_ADDR(0x0, 0x6838D0); }
|
||||
bool EmitOrEvalPrimitiveExpressionList(scriptInstance_t inst, sval_u exprlist, sval_u sourcePos, VariableCompileValue* constValue, scr_block_s* a5, void* call_addr = EmitOrEvalPrimitiveExpressionList_ADDR());
|
||||
inline void* EmitExpressionListFieldObject_ADDR() { return CALL_ADDR(0x0, 0x683AF0); }
|
||||
void EmitExpressionListFieldObject(scriptInstance_t inst, sval_u exprlist, sval_u sourcePos, scr_block_s* block, void* call_addr = EmitExpressionListFieldObject_ADDR());
|
||||
inline void* EmitBoolOrExpression_ADDR() { return CALL_ADDR(0x0, 0x683F00); }
|
||||
void EmitBoolOrExpression(scriptInstance_t inst, sval_u expr1, sval_u expr2, sval_u expr1sourcePos, sval_u expr2sourcePos, scr_block_s* block, void* call_addr = EmitBoolOrExpression_ADDR());
|
||||
inline void* EmitBoolAndExpression_ADDR() { return CALL_ADDR(0x0, 0x684090); }
|
||||
void EmitBoolAndExpression(scriptInstance_t inst, sval_u expr1, sval_u expr2, sval_u expr1sourcePos, sval_u expr2sourcePos, scr_block_s* a6, void* call_addr = EmitBoolAndExpression_ADDR());
|
||||
inline void* EmitOrEvalBinaryOperatorExpression_ADDR() { return CALL_ADDR(0x0, 0x684350); }
|
||||
bool EmitOrEvalBinaryOperatorExpression(scriptInstance_t inst, sval_u expr1, sval_u expr2, sval_u opcode, sval_u sourcePos, VariableCompileValue* constValue, scr_block_s* a8, void* call_addr = EmitOrEvalBinaryOperatorExpression_ADDR());
|
||||
inline void* EmitBinaryEqualsOperatorExpression_ADDR() { return CALL_ADDR(0x0, 0x684460); }
|
||||
void EmitBinaryEqualsOperatorExpression(scr_block_s* block, scriptInstance_t inst, sval_u lhs, sval_u rhs, sval_u opcode, sval_u sourcePos, void* call_addr = EmitBinaryEqualsOperatorExpression_ADDR());
|
||||
inline void* Scr_CalcLocalVarsVariableExpressionRef_ADDR() { return CALL_ADDR(0x0, 0x684500); }
|
||||
void Scr_CalcLocalVarsVariableExpressionRef(scr_block_s* block, sval_u expr, void* call_addr = Scr_CalcLocalVarsVariableExpressionRef_ADDR());
|
||||
inline void* EvalExpression_ADDR() { return CALL_ADDR(0x0, 0x684540); }
|
||||
bool EvalExpression(VariableCompileValue* constValue, scriptInstance_t inst, sval_u expr, void* call_addr = EvalExpression_ADDR());
|
||||
inline void* EmitArrayPrimitiveExpressionRef_ADDR() { return CALL_ADDR(0x0, 0x684900); }
|
||||
void EmitArrayPrimitiveExpressionRef(scriptInstance_t inst, sval_u expr, sval_u sourcePos, scr_block_s* block, void* call_addr = EmitArrayPrimitiveExpressionRef_ADDR());
|
||||
inline void* ConnectBreakStatements_ADDR() { return CALL_ADDR(0x0, 0x684AC0); }
|
||||
void ConnectBreakStatements(scriptInstance_t inst, void* call_addr = ConnectBreakStatements_ADDR());
|
||||
inline void* ConnectContinueStatements_ADDR() { return CALL_ADDR(0x0, 0x684B00); }
|
||||
void ConnectContinueStatements(scriptInstance_t inst, void* call_addr = ConnectContinueStatements_ADDR());
|
||||
inline void* EmitClearVariableExpression_ADDR() { return CALL_ADDR(0x0, 0x684B40); }
|
||||
bool EmitClearVariableExpression(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u rhsSourcePos, void* call_addr = EmitClearVariableExpression_ADDR());
|
||||
inline void* EmitAssignmentStatement_ADDR() { return CALL_ADDR(0x0, 0x684C40); }
|
||||
void EmitAssignmentStatement(scriptInstance_t inst, sval_u lhs, sval_u rhs, sval_u sourcePos, sval_u rhsSourcePos, scr_block_s* block, void* call_addr = EmitAssignmentStatement_ADDR());
|
||||
inline void* EmitCallExpressionStatement_ADDR() { return CALL_ADDR(0x0, 0x684CD0); }
|
||||
void EmitCallExpressionStatement(scriptInstance_t inst, scr_block_s* block, sval_u expr, void* call_addr = EmitCallExpressionStatement_ADDR());
|
||||
inline void* EmitReturnStatement_ADDR() { return CALL_ADDR(0x0, 0x684D20); }
|
||||
void EmitReturnStatement(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitReturnStatement_ADDR());
|
||||
inline void* EmitWaitStatement_ADDR() { return CALL_ADDR(0x0, 0x684D80); }
|
||||
void EmitWaitStatement(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, sval_u waitSourcePos, void* call_addr = EmitWaitStatement_ADDR());
|
||||
inline void* EmitWaittillFrameEnd_ADDR() { return CALL_ADDR(0x0, 0x684EB0); }
|
||||
void EmitWaittillFrameEnd(scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitWaittillFrameEnd_ADDR());
|
||||
inline void* EmitIfStatement_ADDR() { return CALL_ADDR(0x0, 0x684FB0); }
|
||||
void EmitIfStatement(scriptInstance_t inst, sval_u expr, sval_u stmt, sval_u sourcePos, int lastStatement, unsigned int endSourcePos, scr_block_s* block, sval_u* ifStatBlock, void* call_addr = EmitIfStatement_ADDR());
|
||||
inline void* Scr_AddBreakBlock_ADDR() { return CALL_ADDR(0x0, 0x6856A0); }
|
||||
void Scr_AddBreakBlock(scriptInstance_t inst, scr_block_s* block, void* call_addr = Scr_AddBreakBlock_ADDR());
|
||||
inline void* Scr_AddContinueBlock_ADDR() { return CALL_ADDR(0x0, 0x685700); }
|
||||
void Scr_AddContinueBlock(scriptInstance_t inst, scr_block_s* block, void* call_addr = Scr_AddContinueBlock_ADDR());
|
||||
inline void* EmitIncStatement_ADDR() { return CALL_ADDR(0x0, 0x686570); }
|
||||
void EmitIncStatement(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitIncStatement_ADDR());
|
||||
inline void* EmitDecStatement_ADDR() { return CALL_ADDR(0x0, 0x686690); }
|
||||
void EmitDecStatement(scr_block_s* block, scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitDecStatement_ADDR());
|
||||
inline void* Scr_CalcLocalVarsFormalParameterListInternal_ADDR() { return CALL_ADDR(0x0, 0x6867B0); }
|
||||
void Scr_CalcLocalVarsFormalParameterListInternal(sval_u* node, scr_block_s* block, void* call_addr = Scr_CalcLocalVarsFormalParameterListInternal_ADDR());
|
||||
inline void* EmitWaittillStatement_ADDR() { return CALL_ADDR(0x0, 0x686810); }
|
||||
void EmitWaittillStatement(scriptInstance_t inst, sval_u obj, sval_u exprlist, sval_u sourcePos, sval_u waitSourcePos, scr_block_s* block, void* call_addr = EmitWaittillStatement_ADDR());
|
||||
inline void* EmitWaittillmatchStatement_ADDR() { return CALL_ADDR(0x0, 0x686A60); }
|
||||
void EmitWaittillmatchStatement(scriptInstance_t inst, sval_u obj, sval_u exprlist, sval_u sourcePos, sval_u waitSourcePos, scr_block_s* block, void* call_addr = EmitWaittillmatchStatement_ADDR());
|
||||
inline void* EmitNotifyStatement_ADDR() { return CALL_ADDR(0x0, 0x686D30); }
|
||||
void EmitNotifyStatement(scriptInstance_t inst, sval_u obj, sval_u exprlist, sval_u sourcePos, sval_u notifySourcePos, scr_block_s* block, void* call_addr = EmitNotifyStatement_ADDR());
|
||||
inline void* EmitEndOnStatement_ADDR() { return CALL_ADDR(0x0, 0x686F90); }
|
||||
void EmitEndOnStatement(scr_block_s* block, scriptInstance_t inst, sval_u obj, sval_u expr, sval_u sourcePos, sval_u exprSourcePos, void* call_addr = EmitEndOnStatement_ADDR());
|
||||
inline void* EmitCaseStatement_ADDR() { return CALL_ADDR(0x0, 0x687100); }
|
||||
void EmitCaseStatement(scriptInstance_t inst, sval_u expr, sval_u sourcePos, void* call_addr = EmitCaseStatement_ADDR());
|
||||
inline void* EmitCaseStatementInfo_ADDR() { return CALL_ADDR(0x0, 0x687990); }
|
||||
void EmitCaseStatementInfo(scriptInstance_t inst, unsigned int name, sval_u sourcePos, void* call_addr = EmitCaseStatementInfo_ADDR());
|
||||
inline void* EmitBreakStatement_ADDR() { return CALL_ADDR(0x0, 0x6879F0); }
|
||||
void EmitBreakStatement(scr_block_s* block, scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitBreakStatement_ADDR());
|
||||
inline void* EmitContinueStatement_ADDR() { return CALL_ADDR(0x0, 0x687B90); }
|
||||
void EmitContinueStatement(scr_block_s* block, scriptInstance_t inst, sval_u sourcePos, void* call_addr = EmitContinueStatement_ADDR());
|
||||
inline void* EmitProfStatement_ADDR() { return CALL_ADDR(0x0, 0x687D30); }
|
||||
void EmitProfStatement(scriptInstance_t inst, sval_u profileName, sval_u sourcePos, OpcodeVM op, void* call_addr = EmitProfStatement_ADDR());
|
||||
inline void* Scr_CalcLocalVarsStatementList_ADDR() { return CALL_ADDR(0x0, 0x6884F0); }
|
||||
void Scr_CalcLocalVarsStatementList(scr_block_s* block, scriptInstance_t inst, sval_u val, void* call_addr = Scr_CalcLocalVarsStatementList_ADDR());
|
||||
inline void* EmitFormalParameterList_ADDR() { return CALL_ADDR(0x0, 0x6886A0); }
|
||||
void EmitFormalParameterList(scriptInstance_t inst, sval_u exprlist, sval_u sourcePos, scr_block_s* block, void* call_addr = EmitFormalParameterList_ADDR());
|
||||
inline void* SpecifyThread_ADDR() { return CALL_ADDR(0x0, 0x6887C0); }
|
||||
void SpecifyThread(scriptInstance_t inst, sval_u val, void* call_addr = SpecifyThread_ADDR());
|
||||
inline void* EmitThreadInternal_ADDR() { return CALL_ADDR(0x0, 0x6888D0); }
|
||||
void EmitThreadInternal(scriptInstance_t inst, sval_u val, sval_u sourcePos, sval_u endSourcePos, scr_block_s* block, void* call_addr = EmitThreadInternal_ADDR());
|
||||
inline void* Scr_CalcLocalVarsThread_ADDR() { return CALL_ADDR(0x0, 0x688990); }
|
||||
void Scr_CalcLocalVarsThread(sval_u* stmttblock, scriptInstance_t inst, sval_u exprlist, sval_u stmtlist, void* call_addr = Scr_CalcLocalVarsThread_ADDR());
|
||||
inline void* InitThread_ADDR() { return CALL_ADDR(0x0, 0x688A00); }
|
||||
void InitThread(int type_, scriptInstance_t inst, void* call_addr = InitThread_ADDR());
|
||||
inline void* EmitNormalThread_ADDR() { return CALL_ADDR(0x0, 0x688A70); }
|
||||
void EmitNormalThread(scriptInstance_t inst, sval_u val, sval_u* stmttblock, void* call_addr = EmitNormalThread_ADDR());
|
||||
inline void* EmitDeveloperThread_ADDR() { return CALL_ADDR(0x0, 0x688B00); }
|
||||
void EmitDeveloperThread(scriptInstance_t inst, sval_u val, sval_u* stmttblock, void* call_addr = EmitDeveloperThread_ADDR());
|
||||
inline void* EmitThread_ADDR() { return CALL_ADDR(0x0, 0x688C40); }
|
||||
void EmitThread(scriptInstance_t inst, sval_u val, void* call_addr = EmitThread_ADDR());
|
||||
inline void* EmitInclude_ADDR() { return CALL_ADDR(0x0, 0x688DD0); }
|
||||
void EmitInclude(scriptInstance_t inst, sval_u val, void* call_addr = EmitInclude_ADDR());
|
||||
inline void* ScriptCompile_ADDR() { return CALL_ADDR(0x0, 0x688E70); }
|
||||
void ScriptCompile(scriptInstance_t inst, sval_u val, unsigned int filePosId, unsigned int fileCountId, unsigned int scriptId, PrecacheEntry* entries, int entriesCount, void* call_addr = ScriptCompile_ADDR());
|
||||
|
||||
void EmitFloat(scriptInstance_t inst, float value);
|
||||
void EmitCanonicalStringConst(scriptInstance_t inst, unsigned int stringValue);
|
||||
int Scr_FindLocalVar(scr_block_s* block, int startIndex, unsigned int name);
|
||||
void Scr_CheckLocalVarsCount(int localVarsCount);
|
||||
void EmitGetUndefined(scriptInstance_t inst, sval_u sourcePos);
|
||||
void EmitPrimitiveExpression(scriptInstance_t inst, sval_u expr, scr_block_s* block);
|
||||
void Scr_EmitAnimation(scriptInstance_t inst, char* pos, unsigned int animName, unsigned int sourcePos);
|
||||
void EmitEvalArray(scriptInstance_t inst, sval_u sourcePos, sval_u indexSourcePos);
|
||||
void EmitEvalArrayRef(scriptInstance_t inst, sval_u sourcePos, sval_u indexSourcePos);
|
||||
unsigned int Scr_GetBuiltin(scriptInstance_t inst, sval_u func_name);
|
||||
int Scr_GetUncacheType(int type);
|
||||
int Scr_GetCacheType(int type);
|
||||
BuiltinFunction Scr_GetFunction(const char** pName, int* type);
|
||||
BuiltinFunction GetFunction(scriptInstance_t inst, const char** pName, int* type);
|
||||
BuiltinMethod GetMethod(scriptInstance_t inst, const char** pName, int* type);
|
||||
unsigned int GetVariableName(scriptInstance_t inst, unsigned int id);
|
||||
int GetExpressionCount(sval_u exprlist);
|
||||
sval_u* GetSingleParameter(sval_u exprlist);
|
||||
void EmitExpressionFieldObject(scriptInstance_t inst, sval_u expr, sval_u sourcePos, scr_block_s* block);
|
||||
void EvalInteger(int value, sval_u sourcePos, VariableCompileValue* constValue);
|
||||
void EvalFloat(float value, sval_u sourcePos, VariableCompileValue* constValue);
|
||||
void EvalString(unsigned int value, sval_u sourcePos, VariableCompileValue* constValue);
|
||||
void EvalIString(unsigned int value, sval_u sourcePos, VariableCompileValue* constValue);
|
||||
void EvalUndefined(sval_u sourcePos, VariableCompileValue* constValue);
|
||||
void Scr_PopValue(scriptInstance_t inst);
|
||||
void EmitSetVariableField(scriptInstance_t inst, sval_u sourcePos);
|
||||
void EmitFieldVariableRef(scriptInstance_t inst, sval_u expr, sval_u field, sval_u sourcePos, scr_block_s* block);
|
||||
void Scr_CalcLocalVarsArrayPrimitiveExpressionRef(sval_u expr, scr_block_s* block);
|
||||
BOOL IsUndefinedPrimitiveExpression(sval_u expr);
|
||||
bool IsUndefinedExpression(sval_u expr);
|
||||
void Scr_CopyBlock(scr_block_s* from, scr_block_s** to);
|
||||
void Scr_CheckMaxSwitchCases(int count);
|
||||
void Scr_CalcLocalVarsSafeSetVariableField(sval_u expr, sval_u sourcePos, scr_block_s* block);
|
||||
void EmitFormalWaittillParameterListRefInternal(scriptInstance_t inst, sval_u* node, scr_block_s* block);
|
||||
void EmitDefaultStatement(scriptInstance_t inst, sval_u sourcePos);
|
||||
char Scr_IsLastStatement(scriptInstance_t inst, sval_u* node);
|
||||
void EmitEndStatement(scriptInstance_t inst, sval_u sourcePos, scr_block_s* block);
|
||||
void EmitProfBeginStatement(scriptInstance_t inst, sval_u profileName, sval_u sourcePos);
|
||||
void EmitProfEndStatement(scriptInstance_t inst, sval_u profileName, sval_u sourcePos);
|
||||
void Scr_CalcLocalVarsIncStatement(sval_u expr, scr_block_s *block);
|
||||
void Scr_CalcLocalVarsWaittillStatement(sval_u exprlist, scr_block_s* block);
|
||||
void EmitFormalParameterListInternal(scriptInstance_t inst, sval_u* node, scr_block_s* block);
|
||||
unsigned int SpecifyThreadPosition(scriptInstance_t inst, unsigned int posId, unsigned int name, unsigned int sourcePos, int type);
|
||||
void Scr_CalcLocalVarsFormalParameterList(sval_u exprlist, scr_block_s* block);
|
||||
void SetThreadPosition(scriptInstance_t inst, unsigned int posId);
|
||||
void EmitIncludeList(scriptInstance_t inst, sval_u val);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, const char* file, PrecacheEntry* entries, int entriesCount)> Scr_LoadScriptInternal { 0x0, 0x689980 };
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_EndLoadScripts { 0x0, 0x689C80 };
|
||||
WEAK symbol<void(scriptInstance_t inst, void *(__cdecl *Alloc)(int), int user, int modChecksum)> Scr_PrecacheAnimTrees { 0x0, 0x689D60 };
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_EndLoadAnimTrees { 0x0, 0x689DC0 };
|
||||
|
||||
inline void* Scr_IsIdentifier_ADDR() { return CALL_ADDR(0x0, 0x689470); }
|
||||
bool Scr_IsIdentifier(char* token, void* call_addr = Scr_IsIdentifier_ADDR());
|
||||
inline void* Scr_GetFunctionHandle_ADDR() { return CALL_ADDR(0x0, 0x6894B0); }
|
||||
unsigned int Scr_GetFunctionHandle(const char* file, scriptInstance_t inst, const char* handle, void* call_addr = Scr_GetFunctionHandle_ADDR());
|
||||
inline void* SL_TransferToCanonicalString_ADDR() { return CALL_ADDR(0x0, 0x6895A0); }
|
||||
unsigned int SL_TransferToCanonicalString(scriptInstance_t inst, unsigned int stringValue, void* call_addr = SL_TransferToCanonicalString_ADDR());
|
||||
inline void* SL_GetCanonicalString_ADDR() { return CALL_ADDR(0x0, 0x6895F0); }
|
||||
unsigned int SL_GetCanonicalString(const char* token, scriptInstance_t inst, void* call_addr = SL_GetCanonicalString_ADDR());
|
||||
inline void* Scr_BeginLoadScripts_ADDR() { return CALL_ADDR(0x0, 0x689660); }
|
||||
void Scr_BeginLoadScripts(scriptInstance_t inst, int user, void* call_addr = Scr_BeginLoadScripts_ADDR());
|
||||
inline void* Scr_BeginLoadAnimTrees_ADDR() { return CALL_ADDR(0x0, 0x689880); }
|
||||
void Scr_BeginLoadAnimTrees(scriptInstance_t inst, int user, void* call_addr = Scr_BeginLoadAnimTrees_ADDR());
|
||||
inline void* Scr_ScanFile_ADDR() { return CALL_ADDR(0x0, 0x689900); }
|
||||
int Scr_ScanFile(int max_size, char* buf, void* call_addr = Scr_ScanFile_ADDR());
|
||||
inline void* Scr_LoadScript_ADDR() { return CALL_ADDR(0x0, 0x689C60); }
|
||||
unsigned int Scr_LoadScript(const char* file, scriptInstance_t inst, void* call_addr = Scr_LoadScript_ADDR());
|
||||
inline void* Scr_FreeScripts_ADDR() { return CALL_ADDR(0x0, 0x689E50); }
|
||||
void Scr_FreeScripts(scriptInstance_t inst, void* call_addr = Scr_FreeScripts_ADDR());
|
||||
|
||||
int Scr_IsInOpcodeMemory(scriptInstance_t inst, const char* pos);
|
||||
void SL_BeginLoadScripts(scriptInstance_t inst);
|
||||
void Scr_SetLoadedImpureScript(bool loadedImpureScript);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// bool __usercall Scr_IsIdentifier@<al>(char *token@<ecx>)
|
||||
bool Scr_IsIdentifier(char* token, void* call_addr)
|
||||
{
|
||||
bool answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, token;
|
||||
call call_addr;
|
||||
mov answer, al;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_GetFunctionHandle@<eax>(const char *file@<eax>, scriptInstance_t inst@<ecx>, const char *handle)
|
||||
unsigned int Scr_GetFunctionHandle(const char* file, scriptInstance_t inst, const char* handle, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push handle;
|
||||
mov eax, file;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_TransferToCanonicalString@<eax>(scriptInstance_t inst@<eax>, unsigned int stringValue@<edi>)
|
||||
unsigned int SL_TransferToCanonicalString(scriptInstance_t inst, unsigned int stringValue, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, inst;
|
||||
mov edi, stringValue;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetCanonicalString@<eax>(char *token@<eax>, scriptInstance_t inst@<esi>)
|
||||
unsigned int SL_GetCanonicalString(const char* token, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, token;
|
||||
mov esi, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_BeginLoadScripts(scriptInstance_t inst@<edi>, int user)
|
||||
void Scr_BeginLoadScripts(scriptInstance_t inst, int user, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push user;
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_BeginLoadAnimTrees(scriptInstance_t inst@<ecx>, int user@<eax>)
|
||||
void Scr_BeginLoadAnimTrees(scriptInstance_t inst, int user, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov ecx, inst;
|
||||
mov eax, user;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// int __usercall Scr_ScanFile@<eax>(int max_size@<edi>, char *buf)
|
||||
int Scr_ScanFile(int max_size, char* buf, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push buf;
|
||||
mov edi, max_size;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_LoadScript@<eax>(const char *file@<ecx>, scriptInstance_t inst@<edx>)
|
||||
unsigned int Scr_LoadScript(const char* file, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, file;
|
||||
mov edx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_FreeScripts(scriptInstance_t a1@<eax>)
|
||||
void Scr_FreeScripts(scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
int Scr_IsInOpcodeMemory(scriptInstance_t inst, const char* pos)
|
||||
{
|
||||
assert(game::gScrVarPub[inst].programBuffer);
|
||||
assert(pos);
|
||||
|
||||
return (unsigned int)(pos - game::gScrVarPub[inst].programBuffer) < game::gScrCompilePub[inst].programLen;
|
||||
}
|
||||
|
||||
void SL_BeginLoadScripts(scriptInstance_t inst)
|
||||
{
|
||||
memset(game::gScrCompilePub[inst].canonicalStrings, 0, sizeof(game::gScrCompilePub[inst].canonicalStrings));
|
||||
game::gScrVarPub[inst].canonicalStrCount = 0;
|
||||
}
|
||||
|
||||
void Scr_SetLoadedImpureScript(bool loadedImpureScript)
|
||||
{
|
||||
*game::loadedImpureScript = loadedImpureScript;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<int(scriptInstance_t inst, int nodeNum)>MT_GetSubTreeSize{ 0x0, 0x689EF0 };
|
||||
WEAK symbol<void(scriptInstance_t inst)>MT_DumpTree{ 0x0, 0x689F40 };
|
||||
WEAK symbol<void(scriptInstance_t inst, int newNode, int size)>MT_AddMemoryNode{ 0x0, 0x68A0E0 };
|
||||
WEAK symbol<char(scriptInstance_t inst, int oldNode, int size)>MT_RemoveMemoryNode{ 0x0, 0x68A280 };
|
||||
WEAK symbol<void(scriptInstance_t inst, int size)>MT_RemoveHeadMemoryNode{ 0x0, 0x68A3E0 };
|
||||
WEAK symbol<void(void* p, int numBytes, scriptInstance_t inst)>MT_Free{ 0x0, 0x68A800 };
|
||||
|
||||
inline void* MT_InitBits_ADDR() { return CALL_ADDR(0x0, 0x68A010); }
|
||||
void MT_InitBits(scriptInstance_t inst, void* call_addr = MT_InitBits_ADDR());
|
||||
inline void* MT_GetScore_ADDR() { return CALL_ADDR(0x0, 0x68A080); }
|
||||
int MT_GetScore(scriptInstance_t inst, int num, void* call_addr = MT_GetScore_ADDR());
|
||||
inline void* MT_Init_ADDR() { return CALL_ADDR(0x0, 0x68A4F0); }
|
||||
void MT_Init(scriptInstance_t inst, void* call_addr = MT_Init_ADDR());
|
||||
inline void* MT_Error_ADDR() { return CALL_ADDR(0x0, 0x68A580); }
|
||||
void MT_Error(scriptInstance_t inst, const char* funcName, int numBytes, void* call_addr = MT_Error_ADDR());
|
||||
inline void* MT_GetSize_ADDR() { return CALL_ADDR(0x0, 0x68A5D0); }
|
||||
int MT_GetSize(int numBytes, scriptInstance_t inst, void* call_addr = MT_GetSize_ADDR());
|
||||
inline void* MT_AllocIndex_ADDR() { return CALL_ADDR(0x0, 0x68A630); }
|
||||
unsigned __int16 MT_AllocIndex(scriptInstance_t inst, int size_, void* call_addr = MT_AllocIndex_ADDR());
|
||||
inline void* MT_FreeIndex_ADDR() { return CALL_ADDR(0x0, 0x68A750); }
|
||||
void MT_FreeIndex(int numBytes, scriptInstance_t inst, int nodeNum, void* call_addr = MT_FreeIndex_ADDR());
|
||||
inline void* MT_Alloc_ADDR() { return CALL_ADDR(0x0, 0x68A7D0); }
|
||||
char* MT_Alloc(int numBytes, scriptInstance_t inst, void* call_addr = MT_Alloc_ADDR());
|
||||
|
||||
RefVector* GetRefVector(scriptInstance_t inst, unsigned int id);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// void __usercall MT_InitBits(scriptInstance_t a1@<ecx>)
|
||||
void MT_InitBits(scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// int __usercall MT_GetScore@<eax>(scriptInstance_t a1@<edx>, int num)
|
||||
int MT_GetScore(scriptInstance_t inst, int num, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push num;
|
||||
mov edx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall MT_Init(scriptInstance_t a1@<edi>)
|
||||
void MT_Init(scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall MT_Error(scriptInstance_t a1@<eax>, const char *funcName, int numBytes)
|
||||
void MT_Error(scriptInstance_t inst, const char* funcName, int numBytes, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push numBytes;
|
||||
push funcName;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// int __usercall MT_GetSize@<eax>(int numBytes@<eax>, scriptInstance_t inst@<ecx>)
|
||||
int MT_GetSize/*@<eax>*/(int numBytes/*@<eax>*/, scriptInstance_t inst/*@<ecx>*/, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, numBytes;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned __int16 __usercall MT_AllocIndex@<ax>(scriptInstance_t inst@<edi>, int size)
|
||||
unsigned __int16 MT_AllocIndex/*@<ax>*/(scriptInstance_t inst/*@<edi>*/, int size_, void* call_addr)
|
||||
{
|
||||
unsigned __int16 answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push size_;
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
mov answer, ax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall MT_FreeIndex(int numBytes@<eax>, scriptInstance_t a1, int nodeNum)
|
||||
void MT_FreeIndex(int numBytes/*@<eax>*/, scriptInstance_t inst, int nodeNum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push nodeNum;
|
||||
push inst;
|
||||
mov eax, numBytes;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// char *__usercall MT_Alloc@<eax>(int numBytes@<eax>, scriptInstance_t a2@<ecx>)
|
||||
char* MT_Alloc(int numBytes, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
char* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, numBytes;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
RefVector* GetRefVector(scriptInstance_t inst, unsigned int id)
|
||||
{
|
||||
assert(id);
|
||||
|
||||
assert((id * MT_NODE_SIZE) < MT_SIZE);
|
||||
|
||||
return (game::RefVector*)&game::gScrMemTreePub[inst].mt_buffer->nodes[id];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<char* (scriptInstance_t inst, int unused, char* filename, const char* codepos, int archive)>Scr_ReadFile_FastFile{ 0x0, 0x68AE30 };
|
||||
WEAK symbol<char* (scriptInstance_t inst, int unused_arg1, const char* filename, const char* codepos, int archive)>Scr_ReadFile_LoadObj{ 0x0, 0x68AED0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int codePos, const char* msg, ...)>CompileError{ 0x0, 0x68B470 };
|
||||
|
||||
inline void* Scr_InitOpcodeLookup_ADDR() { return CALL_ADDR(0x0, 0x68A840); }
|
||||
void Scr_InitOpcodeLookup(scriptInstance_t inst, void* call_addr = Scr_InitOpcodeLookup_ADDR());
|
||||
inline void* Scr_ShutdownOpcodeLookup_ADDR() { return CALL_ADDR(0x0, 0x68A950); }
|
||||
void Scr_ShutdownOpcodeLookup(scriptInstance_t inst, void* call_addr = Scr_ShutdownOpcodeLookup_ADDR());
|
||||
inline void* AddOpcodePos_ADDR() { return CALL_ADDR(0x0, 0x68A9A0); }
|
||||
void AddOpcodePos(scriptInstance_t inst, unsigned int sourcePos, int type_, void* call_addr = AddOpcodePos_ADDR());
|
||||
inline void* RemoveOpcodePos_ADDR() { return CALL_ADDR(0x0, 0x68AB80); }
|
||||
void RemoveOpcodePos(scriptInstance_t inst, void* call_addr = RemoveOpcodePos_ADDR());
|
||||
inline void* AddThreadStartOpcodePos_ADDR() { return CALL_ADDR(0x0, 0x68ABF0); }
|
||||
void AddThreadStartOpcodePos(scriptInstance_t inst, unsigned int sourcePos, void* call_addr = AddThreadStartOpcodePos_ADDR());
|
||||
inline void* Scr_GetSourceBuffer_ADDR() { return CALL_ADDR(0x0, 0x68B270); }
|
||||
unsigned int Scr_GetSourceBuffer(scriptInstance_t inst, const char* codePos, void* call_addr = Scr_GetSourceBuffer_ADDR());
|
||||
inline void* Scr_GetLineNumInternal_ADDR() { return CALL_ADDR(0x0, 0x68AC90); }
|
||||
unsigned int Scr_GetLineNumInternal(const char** startLine, const char* buf, const char* sourcePos, int* col, void* call_addr = Scr_GetLineNumInternal_ADDR());
|
||||
inline void* Scr_GetNewSourceBuffer_ADDR() { return CALL_ADDR(0x0, 0x68ACC0); }
|
||||
SourceBufferInfo* Scr_GetNewSourceBuffer(scriptInstance_t inst, void* call_addr = Scr_GetNewSourceBuffer_ADDR());
|
||||
inline void* Scr_AddSourceBufferInternal_ADDR() { return CALL_ADDR(0x0, 0x68AD50); }
|
||||
void Scr_AddSourceBufferInternal(const char* filename, scriptInstance_t inst, const char* codepos, char* buffer, int len, int archive, void* call_addr = Scr_AddSourceBufferInternal_ADDR());
|
||||
inline void* Scr_ReadFile_ADDR() { return CALL_ADDR(0x0, 0x68AFA0); }
|
||||
char* Scr_ReadFile(const char* codepos, char* filename, scriptInstance_t inst, int unused, void* call_addr = Scr_ReadFile_ADDR());
|
||||
inline void* Scr_AddSourceBuffer_ADDR() { return CALL_ADDR(0x0, 0x68B040); }
|
||||
char* Scr_AddSourceBuffer(scriptInstance_t inst, int unused_arg1, char* filename, const char* codepos, void* call_addr = Scr_AddSourceBuffer_ADDR());
|
||||
inline void* Scr_CopyFormattedLine_ADDR() { return CALL_ADDR(0x0, 0x68B0E0); }
|
||||
void Scr_CopyFormattedLine(const char* rawLine, char* line, void* call_addr = Scr_CopyFormattedLine_ADDR());
|
||||
inline void* Scr_GetLineInfo_ADDR() { return CALL_ADDR(0x0, 0x68B140); }
|
||||
unsigned int Scr_GetLineInfo(int* col, const char* buf, unsigned int sourcePos, char* line, void* call_addr = Scr_GetLineInfo_ADDR());
|
||||
inline void* Scr_PrintSourcePos_ADDR() { return CALL_ADDR(0x0, 0x68B190); }
|
||||
void Scr_PrintSourcePos(unsigned int sourcePos, const char* buf, con_channel_e channel, scriptInstance_t inst, const char* file, void* call_addr = Scr_PrintSourcePos_ADDR());
|
||||
inline void* Scr_GetPrevSourcePosOpcodeLookup_ADDR() { return CALL_ADDR(0x0, 0x68AC40); }
|
||||
OpcodeLookup* Scr_GetPrevSourcePosOpcodeLookup(scriptInstance_t inst, const char* codePos, void* call_addr = Scr_GetPrevSourcePosOpcodeLookup_ADDR());
|
||||
inline void* Scr_GetTextSourcePos_ADDR() { return CALL_ADDR(0x0, 0x68B2B0); }
|
||||
void Scr_GetTextSourcePos(char* line, const char* codePos, scriptInstance_t inst, void* call_addr = Scr_GetTextSourcePos_ADDR());
|
||||
inline void* Scr_PrintPrevCodePos_ADDR() { return CALL_ADDR(0x0, 0x68B340); }
|
||||
void Scr_PrintPrevCodePos(const char* codepos, scriptInstance_t scriptInstance, con_channel_e channel, unsigned int index, void* call_addr = Scr_PrintPrevCodePos_ADDR());
|
||||
inline void* CompileError2_ADDR() { return CALL_ADDR(0x0, 0x68B600); }
|
||||
void CompileError2(const char* codePos, scriptInstance_t a2, void* call_addr, const char* msg, ...);
|
||||
inline void* RuntimeErrorInternal_ADDR() { return CALL_ADDR(0x0, 0x68B6D0); }
|
||||
void RuntimeErrorInternal(const char* msg, scriptInstance_t inst, con_channel_e channel, const char* codepos, int index, void* call_addr = RuntimeErrorInternal_ADDR());
|
||||
inline void* RuntimeError_ADDR() { return CALL_ADDR(0x0, 0x68B790); }
|
||||
void RuntimeError(scriptInstance_t inst, const char* pos, int error_index, const char* err, const char* err2, void* call_addr = RuntimeError_ADDR());
|
||||
|
||||
unsigned int Scr_GetPrevSourcePos(scriptInstance_t inst, const char* codePos, unsigned int index);
|
||||
void Scr_ShutdownAllocNode(scriptInstance_t inst);
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// void __usercall Scr_InitOpcodeLookup(scriptInstance_t a1@<eax>)
|
||||
void Scr_InitOpcodeLookup(scriptInstance_t a1, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_ShutdownOpcodeLookup(scriptInstance_t a1@<ecx>)
|
||||
void Scr_ShutdownOpcodeLookup(scriptInstance_t a1, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov ecx, a1;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall AddOpcodePos(scriptInstance_t a1@<eax>, unsigned int sourcePos, int type)
|
||||
void AddOpcodePos(scriptInstance_t a1, unsigned int sourcePos, int type_, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push type_;
|
||||
push sourcePos;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall RemoveOpcodePos(scriptInstance_t result@<eax>)
|
||||
void RemoveOpcodePos(scriptInstance_t result, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, result;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall AddThreadStartOpcodePos(scriptInstance_t result@<eax>, unsigned int sourcePos)
|
||||
void AddThreadStartOpcodePos(scriptInstance_t result, unsigned int sourcePos, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push sourcePos;
|
||||
mov eax, result;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_GetSourceBuffer@<eax>(scriptInstance_t inst@<eax>, const char *codePos@<esi>)
|
||||
unsigned int Scr_GetSourceBuffer(scriptInstance_t a1, const char* codePos, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
mov esi, codePos;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_GetLineNumInternal@<eax>(const char **startLine@<edx>, const char *buf@<ecx>, const char *sourcePos, int *col)
|
||||
unsigned int Scr_GetLineNumInternal(const char** startLine, const char* buf, const char* sourcePos, int* col, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push col;
|
||||
push sourcePos;
|
||||
mov edx, startLine;
|
||||
mov ecx, buf;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// SourceBufferInfo *__usercall Scr_GetNewSourceBuffer@<eax>(scriptInstance_t a1@<eax>)
|
||||
SourceBufferInfo* Scr_GetNewSourceBuffer(scriptInstance_t a1, void* call_addr)
|
||||
{
|
||||
SourceBufferInfo* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_AddSourceBufferInternal(const char *filename@<eax>, scriptInstance_t inst, const char *codepos, char *buffer, int len, int archive)
|
||||
void Scr_AddSourceBufferInternal(const char* filename, scriptInstance_t inst, const char* codepos, char* buffer, int len, int archive, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push archive;
|
||||
push len;
|
||||
push buffer;
|
||||
push codepos;
|
||||
push inst;
|
||||
mov eax, filename;
|
||||
call call_addr;
|
||||
add esp, 0x14;
|
||||
}
|
||||
}
|
||||
|
||||
// char *__usercall Scr_ReadFile@<eax>(const char *codepos@<edi>, char *filename@<esi>, scriptInstance_t inst, int unused)
|
||||
char* Scr_ReadFile(const char* codepos, char* filename, scriptInstance_t inst, int unused, void* call_addr)
|
||||
{
|
||||
char* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push unused;
|
||||
push inst;
|
||||
mov edi, codepos;
|
||||
mov esi, filename;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// char *__usercall Scr_AddSourceBuffer@<eax>(scriptInstance_t inst@<eax>, int unused_arg1, char *filename, const char *codepos)
|
||||
char* Scr_AddSourceBuffer(scriptInstance_t inst, int unused_arg1, char* filename, const char* codepos, void* call_addr)
|
||||
{
|
||||
char* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push codepos;
|
||||
push filename;
|
||||
push unused_arg1;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0xC;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_CopyFormattedLine(const char *rawLine@<eax>, char *line)
|
||||
void Scr_CopyFormattedLine(const char* rawLine, char* line, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push line;
|
||||
mov eax, rawLine;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_GetLineInfo@<eax>(int *col@<edx>, _BYTE *buf@<ecx>, unsigned int sourcePos, char *line)
|
||||
unsigned int Scr_GetLineInfo(int* col, const char* buf, unsigned int sourcePos, char* line, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push line;
|
||||
push sourcePos;
|
||||
mov edx, col;
|
||||
mov ecx, buf;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_PrintSourcePos(unsigned int sourcePos@<edx>, const char *buf@<ecx>, con_channel_e channel@<esi>, scriptInstance_t a4, const char *file)
|
||||
void Scr_PrintSourcePos(unsigned int sourcePos, const char* buf, con_channel_e channel, scriptInstance_t a4, const char* file, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push file;
|
||||
push a4;
|
||||
mov edx, sourcePos;
|
||||
mov ecx, buf;
|
||||
mov esi, channel;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// OpcodeLookup *__usercall Scr_GetPrevSourcePosOpcodeLookup@<eax>(scriptInstance_t a1@<eax>, const char *codePos@<edi>)
|
||||
OpcodeLookup* Scr_GetPrevSourcePosOpcodeLookup(scriptInstance_t a1, const char* codePos, void* call_addr)
|
||||
{
|
||||
OpcodeLookup* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
mov edi, codePos;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_GetTextSourcePos(char *line@<edx>, const char *codePos@<ecx>, scriptInstance_t a3)
|
||||
void Scr_GetTextSourcePos(char* line, const char* codePos, scriptInstance_t a3, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push a3;
|
||||
mov edx, line;
|
||||
mov ecx, codePos;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_PrintPrevCodePos(const char *codepos@<eax>, scriptInstance_t scriptInstance, con_channel_e channel, unsigned int index)
|
||||
void Scr_PrintPrevCodePos(const char* codepos, scriptInstance_t scriptInstance, con_channel_e channel, unsigned int index, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push index;
|
||||
push channel;
|
||||
push scriptInstance;
|
||||
mov eax, codepos;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
//void __usercall CompileError2(const char *codePos@<edi>, scriptInstance_t a2@<esi>, char *msg, ...)
|
||||
void CompileError2(const char* codePos, scriptInstance_t a2, void* call_addr, const char* msg, ...)
|
||||
{
|
||||
char Buffer[1024];
|
||||
char* Buf = Buffer;
|
||||
const char* str_ = "%s";
|
||||
va_list ArgList;
|
||||
|
||||
va_start(ArgList, msg);
|
||||
vsnprintf(Buffer, 0x400u, msg, ArgList);
|
||||
va_end(ArgList);
|
||||
|
||||
__asm
|
||||
{
|
||||
push Buf;
|
||||
push str_;
|
||||
mov esi, a2;
|
||||
mov edi, codePos;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall RuntimeErrorInternal(const char *msg@<eax>, scriptInstance_t inst@<edi>, con_channel_e channel, const char *codepos, int index)
|
||||
void RuntimeErrorInternal(const char* msg, scriptInstance_t inst, con_channel_e channel, const char* codepos, int index, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push index;
|
||||
push codepos;
|
||||
push channel;
|
||||
mov eax, msg;
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall RuntimeError(scriptInstance_t inst@<eax>, const char *pos, int error_index, const char *err, const char *err2)
|
||||
void RuntimeError(scriptInstance_t inst, const char* pos, int error_index, const char* err, const char* err2, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push err2;
|
||||
push err;
|
||||
push error_index;
|
||||
push pos;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
add esp, 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Scr_GetPrevSourcePos(scriptInstance_t inst, const char* codePos, unsigned int index)
|
||||
{
|
||||
return game::gScrParserGlob[inst].sourcePosLookup[index + game::Scr_GetPrevSourcePosOpcodeLookup(inst, codePos)->sourcePosIndex].sourcePos;
|
||||
}
|
||||
|
||||
void Scr_ShutdownAllocNode(scriptInstance_t inst)
|
||||
{
|
||||
if (game::g_allocNodeUser[inst])
|
||||
{
|
||||
game::Hunk_UserDestroy(game::g_allocNodeUser[inst]);
|
||||
game::g_allocNodeUser[inst] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_InitAllocNode{ 0x0, 0x68B870};
|
||||
WEAK symbol<sval_u()>node0{ 0x0, 0x68B900};
|
||||
WEAK symbol<sval_u(scr_enum_t type, sval_u val1)>node1{ 0x0, 0x68B920};
|
||||
WEAK symbol<sval_u(scr_enum_t type, sval_u val1, sval_u val2)>node2{ 0x0, 0x68B950};
|
||||
WEAK symbol<sval_u(scr_enum_t type, sval_u val1, sval_u val2, sval_u val3)>node3{ 0x0, 0x68B980};
|
||||
WEAK symbol<sval_u(scr_enum_t type, sval_u val1, sval_u val2, sval_u val3, sval_u val4)>node4{ 0x0, 0x68B9C0};
|
||||
WEAK symbol<sval_u(scr_enum_t type, sval_u val1, sval_u val2, sval_u val3, sval_u val4, sval_u val5)>node5{ 0x0, 0x68BA00};
|
||||
WEAK symbol<sval_u(sval_u val1, sval_u val2, sval_u val3, sval_u val4, sval_u val5, sval_u val6)>node6{ 0x0, 0x68BA50};
|
||||
WEAK symbol<sval_u(sval_u val1, sval_u val2, sval_u val3, sval_u val4, sval_u val5, sval_u val6, sval_u val7)>node7{ 0x0, 0x68BAA0};
|
||||
WEAK symbol<sval_u(sval_u val1, sval_u val2, sval_u val3, sval_u val4, sval_u val5, sval_u val6, sval_u val7, sval_u val8)>node8{ 0x0, 0x68BB00};
|
||||
WEAK symbol<sval_u(sval_u val1)>linked_list_end{ 0x0, 0x68BB60};
|
||||
WEAK symbol<sval_u(sval_u val1, sval_u val2)>prepend_node{ 0x0, 0x68BBB0};
|
||||
WEAK symbol<sval_u(sval_u val1, sval_u val2)>append_node{ 0x0, 0x68BBE0};
|
||||
|
||||
sval_u* Scr_AllocNode(scriptInstance_t inst, int size);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
sval_u* Scr_AllocNode(scriptInstance_t inst, int size)
|
||||
{
|
||||
assert(game::g_allocNodeUser[inst]);
|
||||
|
||||
return (game::sval_u*)game::Hunk_UserAlloc(game::g_allocNodeUser[inst], 4 * size, 4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
inline void* FindVariableIndexInternal2_ADDR() { return CALL_ADDR(0x0, 0x68BC20); }
|
||||
unsigned int FindVariableIndexInternal2(scriptInstance_t inst, unsigned int name, unsigned int index, void* call_addr = FindVariableIndexInternal2_ADDR());
|
||||
inline void* FindLastSibling_ADDR() { return CALL_ADDR(0x0, 0x68BCA0); }
|
||||
unsigned int FindLastSibling(unsigned int parentId, scriptInstance_t inst, void* call_addr = FindLastSibling_ADDR());
|
||||
|
||||
unsigned int FindVariableIndexInternal(scriptInstance_t inst, unsigned int parentId, unsigned int name);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// unsigned int __usercall FindVariableIndexInternal2@<eax>(scriptInstance_t inst@<eax>, unsigned int name, unsigned int index)
|
||||
unsigned int FindVariableIndexInternal2(scriptInstance_t inst, unsigned int name, unsigned int index, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push index;
|
||||
push name;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall FindLastSibling@<eax>(unsigned int parentId@<edx>, scriptInstance_t inst@<esi>)
|
||||
unsigned int FindLastSibling(unsigned int parentId, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edx, parentId;
|
||||
mov esi, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
unsigned int FindVariableIndexInternal(scriptInstance_t inst, unsigned int parentId, unsigned int name)
|
||||
{
|
||||
game::VariableValueInternal* parentValue;
|
||||
|
||||
assert(parentId);
|
||||
|
||||
parentValue = &game::gScrVarGlob[inst].parentVariables[parentId + 1];
|
||||
|
||||
assert((parentValue->w.status & VAR_STAT_MASK) == VAR_STAT_EXTERNAL);
|
||||
|
||||
assert((parentValue->w.status & VAR_STAT_MASK) != VAR_STAT_FREE);
|
||||
|
||||
assert(IsObject(parentValue));
|
||||
|
||||
return game::FindVariableIndexInternal2(inst, name, (parentId + name) % 0xFFFD + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<unsigned int(const char* str, scriptInstance_t inst)>SL_FindLowercaseString{ 0x0, 0x68DD50 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, const char* string, unsigned int user, unsigned int len)>SL_GetStringOfSize{ 0x0, 0x68DE50 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, const char* str, unsigned int user, unsigned int len)>SL_GetLowercaseStringOfLen{ 0x0, 0x68E390 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, unsigned int stringVal, unsigned int user)>SL_ConvertToLowercase{ 0x0, 0x68E450 };
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int stringValue, RefString* refStr, unsigned int len)>SL_FreeString{ 0x0, 0x68E570 };
|
||||
WEAK symbol<void()>SL_TransferSystem{ 0x0, 0x68E9D0 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, const char* filename)>Scr_CreateCanonicalFilename{ 0x0, 0x68EB00 };
|
||||
|
||||
inline void* SL_ConvertToString_ADDR() { return CALL_ADDR(0x0, 0x68D950); }
|
||||
char* SL_ConvertToString(unsigned int stringValue, scriptInstance_t inst, void* call_addr = SL_ConvertToString_ADDR());
|
||||
inline void* SL_GetStringLen_ADDR() { return CALL_ADDR(0x0, 0x68D970); }
|
||||
int SL_GetStringLen(unsigned int stringValue, scriptInstance_t inst, void* call_addr = SL_GetStringLen_ADDR());
|
||||
inline void* GetHashCode_ADDR() { return CALL_ADDR(0x0, 0x68D9A0); }
|
||||
unsigned int GetHashCode(unsigned int len, const char* str, void* call_addr = GetHashCode_ADDR());
|
||||
inline void* SL_Init_ADDR() { return CALL_ADDR(0x0, 0x68D9F0); }
|
||||
void SL_Init(scriptInstance_t inst, void* call_addr = SL_Init_ADDR());
|
||||
inline void* SL_FindStringOfSize_ADDR() { return CALL_ADDR(0x0, 0x68DA90); }
|
||||
unsigned int SL_FindStringOfSize(scriptInstance_t inst, const char* str, unsigned int len, void* call_addr = SL_FindStringOfSize_ADDR());
|
||||
inline void* SL_FindString_ADDR() { return CALL_ADDR(0x0, 0x68DD20); }
|
||||
unsigned int SL_FindString(const char* str, scriptInstance_t inst, void* call_addr = SL_FindString_ADDR());
|
||||
inline void* SL_AddUserInternal_ADDR() { return CALL_ADDR(0x0, 0x68DDE0); }
|
||||
signed __int32 SL_AddUserInternal(unsigned int user, RefString* refStr, void* call_addr = SL_AddUserInternal_ADDR());
|
||||
inline void* Mark_ScriptStringCustom_ADDR() { return CALL_ADDR(0x0, 0x68DE10); }
|
||||
int Mark_ScriptStringCustom(unsigned int stringValue, void* call_addr = Mark_ScriptStringCustom_ADDR());
|
||||
inline void* SL_GetString__ADDR() { return CALL_ADDR(0x0, 0x68E330); }
|
||||
unsigned int SL_GetString_(const char* str, scriptInstance_t inst, unsigned int user, void* call_addr = SL_GetString__ADDR());
|
||||
inline void* SL_GetString__0_ADDR() { return CALL_ADDR(0x0, 0x68E360); }
|
||||
unsigned int SL_GetString__0(const char* str, unsigned int user, scriptInstance_t inst, void* call_addr = SL_GetString__0_ADDR());
|
||||
inline void* SL_GetLowercaseString_ADDR() { return CALL_ADDR(0x0, 0x68E420); }
|
||||
unsigned int SL_GetLowercaseString(const char* str, void* call_addr = SL_GetLowercaseString_ADDR());
|
||||
inline void* SL_TransferRefToUser_ADDR() { return CALL_ADDR(0x0, 0x68E530); }
|
||||
void SL_TransferRefToUser(unsigned int stringValue, int user, scriptInstance_t inst, void* call_addr = SL_TransferRefToUser_ADDR());
|
||||
inline void* SL_RemoveRefToString_ADDR() { return CALL_ADDR(0x0, 0x68E680); }
|
||||
void SL_RemoveRefToString(unsigned int stringVal, scriptInstance_t inst, void* call_addr = SL_RemoveRefToString_ADDR());
|
||||
inline void* Scr_SetString_ADDR() { return CALL_ADDR(0x0, 0x68E6E0); }
|
||||
void Scr_SetString(scriptInstance_t inst, unsigned int from, unsigned __int16* to, void* call_addr = Scr_SetString_ADDR());
|
||||
inline void* Scr_SetStringFromCharString_ADDR() { return CALL_ADDR(0x0, 0x68E720); }
|
||||
void Scr_SetStringFromCharString(const char* from, unsigned short* to, void* call_addr = Scr_SetStringFromCharString_ADDR());
|
||||
inline void* GScr_AllocString_ADDR() { return CALL_ADDR(0x0, 0x68E770); }
|
||||
unsigned int GScr_AllocString(const char* str, scriptInstance_t inst, void* call_addr = GScr_AllocString_ADDR());
|
||||
inline void* SL_GetStringForFloat_ADDR() { return CALL_ADDR(0x0, 0x68E7A0); }
|
||||
unsigned int SL_GetStringForFloat(float value, scriptInstance_t inst, void* call_addr = SL_GetStringForFloat_ADDR());
|
||||
inline void* SL_GetStringForInt_ADDR() { return CALL_ADDR(0x0, 0x68E800); }
|
||||
unsigned int SL_GetStringForInt(int value, scriptInstance_t inst, void* call_addr = SL_GetStringForInt_ADDR());
|
||||
inline void* SL_GetStringForVector_ADDR() { return CALL_ADDR(0x0, 0x68E850); }
|
||||
unsigned int SL_GetStringForVector(float* value, scriptInstance_t inst, void* call_addr = SL_GetStringForVector_ADDR());
|
||||
inline void* SL_ShutdownSystem_ADDR() { return CALL_ADDR(0x0, 0x68E8D0); }
|
||||
void SL_ShutdownSystem(scriptInstance_t inst, unsigned int user, void* call_addr = SL_ShutdownSystem_ADDR());
|
||||
inline void* SL_CreateCanonicalFilename_ADDR() { return CALL_ADDR(0x0, 0x68EA80); }
|
||||
void SL_CreateCanonicalFilename(const char* filename, char* newFilename, void* call_addr = SL_CreateCanonicalFilename_ADDR());
|
||||
|
||||
RefString* GetRefString(scriptInstance_t inst, unsigned int id);
|
||||
void SL_AddRefToString(scriptInstance_t inst, unsigned int stringValue);
|
||||
void SL_RemoveRefToStringOfSize(scriptInstance_t inst, unsigned int stringValue, unsigned int len);
|
||||
int SL_GetRefStringLen(RefString* refString);
|
||||
void SL_AddUser(unsigned int stringValue, unsigned int user, scriptInstance_t inst);
|
||||
int SL_ConvertFromString(scriptInstance_t inst, const char* str);
|
||||
int SL_ConvertFromRefString(scriptInstance_t inst, RefString* refString);
|
||||
RefString* GetRefString_0(scriptInstance_t inst, const char* str);
|
||||
const char* SL_ConvertToStringSafe(unsigned int id, game::scriptInstance_t inst);
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// char *__usercall SL_ConvertToString@<eax>(unsigned int id@<eax>, scriptInstance_t inst@<ecx>)
|
||||
char* SL_ConvertToString(unsigned int id, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
char* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, id;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall SL_GetStringLen@<eax>(unsigned int a1@<eax>, scriptInstance_t a2@<ecx>)
|
||||
int SL_GetStringLen(unsigned int a1, scriptInstance_t a2, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
mov ecx, a2;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall GetHashCode@<eax>(unsigned int a1@<eax>, char *a2@<edx>)
|
||||
unsigned int GetHashCode(unsigned int a1, const char* a2, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
mov edx, a2;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall SL_Init(scriptInstance_t a1@<eax>)
|
||||
void SL_Init(scriptInstance_t a1, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_FindStringOfSize@<eax>(scriptInstance_t inst@<eax>, const char *str, unsigned int len)
|
||||
unsigned int SL_FindStringOfSize(scriptInstance_t inst, const char* str_, unsigned int len, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push len;
|
||||
push str_;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_FindString@<eax>(char *a1@<edx>, scriptInstance_t a2)
|
||||
unsigned int SL_FindString(const char* a1, scriptInstance_t a2, void* call_addr)
|
||||
{
|
||||
#if 0
|
||||
cscr_stringlist::SL_FindString
|
||||
#endif
|
||||
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov edx, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// signed __int32 __usercall SL_AddUserInternal@<eax>(int user@<eax>, volatile signed __int32 *a2@<edx>)
|
||||
signed __int32 SL_AddUserInternal(unsigned int user, RefString* a2, void* call_addr)
|
||||
{
|
||||
signed __int32 answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, user;
|
||||
mov edx, a2;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall Mark_ScriptStringCustom@<eax>(int a1@<eax>)
|
||||
int Mark_ScriptStringCustom(unsigned int a1, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetString_@<eax>(char *a1@<edx>, scriptInstance_t a2, int user)
|
||||
unsigned int SL_GetString_(const char* a1, scriptInstance_t a2, unsigned int user, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push user;
|
||||
push a2;
|
||||
mov edx, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetString__0@<eax>(char *a1@<edx>, int user, scriptInstance_t a3)
|
||||
unsigned int SL_GetString__0(const char* a1, unsigned int user, scriptInstance_t a3, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push a3;
|
||||
push user;
|
||||
mov edx, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetLowercaseString@<eax>(const char *a2@<edx>)
|
||||
unsigned int SL_GetLowercaseString(const char* a2, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edx, a2;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall SL_TransferRefToUser(unsigned int stringValue@<eax>, int user@<ecx>, scriptInstance_t inst)
|
||||
void SL_TransferRefToUser(unsigned int stringValue, int user, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push inst;
|
||||
mov eax, stringValue;
|
||||
mov ecx, user;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall SL_RemoveRefToString(unsigned int stringVal@<edx>, scriptInstance_t inst@<esi>)
|
||||
void SL_RemoveRefToString(unsigned int stringVal/*@<edx>*/, scriptInstance_t inst/*@<esi>*/, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edx, stringVal;
|
||||
mov esi, inst;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_SetString(scriptInstance_t inst@<eax>, unsigned int from@<edi>, unsigned __int16 *to)
|
||||
void Scr_SetString(scriptInstance_t inst, unsigned int from, unsigned __int16* to, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push to;
|
||||
mov eax, inst;
|
||||
mov edi, from;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_SetStringFromCharString@<eax>(char *a1@<edi>, _WORD *a2)
|
||||
void Scr_SetStringFromCharString(const char* a1, unsigned short* a2, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov edi, a1;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall GScr_AllocString@<eax>(char *a1@<edx>, scriptInstance_t inst)
|
||||
unsigned int GScr_AllocString(const char* a1, scriptInstance_t inst, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push inst;
|
||||
mov edx, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetStringForFloat@<eax>(float a1@<xmm0>, scriptInstance_t a2)
|
||||
unsigned int SL_GetStringForFloat(float a1, scriptInstance_t a2, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
movsd xmm0, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetStringForInt@<eax>(int a1@<eax>, scriptInstance_t a2)
|
||||
unsigned int SL_GetStringForInt(int a1, scriptInstance_t a2, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall SL_GetStringForVector@<eax>(float *a1@<eax>, scriptInstance_t a2)
|
||||
unsigned int SL_GetStringForVector(float* a1, scriptInstance_t a2, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall SL_ShutdownSystem(scriptInstance_t a1@<edi>, unsigned int a2)
|
||||
void SL_ShutdownSystem(scriptInstance_t a1, unsigned int a2, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov edi, a1;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall CreateCanonicalFilename(const char *a1@<eax>, char *a2)
|
||||
void SL_CreateCanonicalFilename(const char* a1, char* a2, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push a2;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
RefString* GetRefString(scriptInstance_t inst, unsigned int id)
|
||||
{
|
||||
assert(id);
|
||||
|
||||
assert((id * MT_NODE_SIZE) < MT_SIZE);
|
||||
|
||||
return (game::RefString*)&game::gScrMemTreePub[inst].mt_buffer->nodes[id];
|
||||
}
|
||||
|
||||
void SL_AddRefToString(scriptInstance_t inst, unsigned int stringValue)
|
||||
{
|
||||
game::RefString* refStr = game::GetRefString(inst, stringValue);
|
||||
InterlockedExchangeAdd((volatile unsigned int*)&refStr->u.data, 1u);
|
||||
}
|
||||
|
||||
void SL_RemoveRefToStringOfSize(scriptInstance_t inst, unsigned int stringValue, unsigned int len)
|
||||
{
|
||||
game::RefString* refStr;
|
||||
|
||||
refStr = game::GetRefString(inst, stringValue);
|
||||
if (!(unsigned __int16)InterlockedDecrement((volatile unsigned int*)&refStr->u.data))
|
||||
{
|
||||
game::SL_FreeString(inst, stringValue, refStr, len);
|
||||
}
|
||||
}
|
||||
|
||||
int SL_GetRefStringLen(RefString* refString)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (!refString->u.s.byteLen)
|
||||
{
|
||||
len = 256 - 1; //Bugfix for 256 % 256 = 0 or 512 % 256 = 0 or... Just promote it to 256
|
||||
}
|
||||
else
|
||||
{
|
||||
len = refString->u.s.byteLen - 1;
|
||||
}
|
||||
|
||||
while (refString->str[len])
|
||||
{
|
||||
len += 256;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
void SL_AddUser(unsigned int stringValue, unsigned int user, scriptInstance_t inst)
|
||||
{
|
||||
game::RefString* refStr;
|
||||
|
||||
refStr = game::GetRefString(inst, stringValue);
|
||||
game::SL_AddUserInternal(user, refStr);
|
||||
}
|
||||
|
||||
int SL_ConvertFromString(scriptInstance_t inst, const char* str)
|
||||
{
|
||||
game::RefString* v2;
|
||||
|
||||
assert(str);
|
||||
|
||||
v2 = game::GetRefString_0(inst, str);
|
||||
return game::SL_ConvertFromRefString(inst, v2);
|
||||
}
|
||||
|
||||
int SL_ConvertFromRefString(scriptInstance_t inst, RefString* refString)
|
||||
{
|
||||
return ((char*)refString - (char*)game::gScrMemTreePub[inst].mt_buffer) / MT_NODE_SIZE;
|
||||
}
|
||||
|
||||
RefString* GetRefString_0([[maybe_unused]]scriptInstance_t inst, const char* str)
|
||||
{
|
||||
assert(str >= (char*)game::gScrMemTreePub[inst].mt_buffer && str < (char*)(game::gScrMemTreePub[inst].mt_buffer + MT_SIZE));
|
||||
|
||||
return (game::RefString*)(str - 4);
|
||||
}
|
||||
|
||||
const char* SL_ConvertToStringSafe(unsigned int id, game::scriptInstance_t inst)
|
||||
{
|
||||
if (!id)
|
||||
{
|
||||
return "(NULL)";
|
||||
}
|
||||
|
||||
return game::GetRefString(inst, id)->str;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
void TempMemorySetPos(char* pos);
|
||||
void TempMemoryReset(HunkUser* user);
|
||||
char* TempMalloc(int len);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
void TempMemorySetPos(char* pos)
|
||||
{
|
||||
(*game::g_user)->pos = (int)pos;
|
||||
}
|
||||
|
||||
void TempMemoryReset(HunkUser* user)
|
||||
{
|
||||
*game::g_user = user;
|
||||
}
|
||||
|
||||
char* TempMalloc(int len)
|
||||
{
|
||||
return (char*)game::Hunk_UserAlloc(*game::g_user, len, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<int(const void * info1, const void * info2)>ThreadInfoCompare{ 0x0, 0x68EB50};
|
||||
WEAK symbol<void(scriptInstance_t scriptInstance)>Scr_DumpScriptThreads{ 0x0, 0x68EBA0};
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, unsigned int parentId, unsigned int name, unsigned int index)>GetNewVariableIndexInternal3{ 0x0, 0x68F090};
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int parentId)>ClearObjectInternal{ 0x0, 0x68F910};
|
||||
WEAK symbol<void(scriptInstance_t inst, VariableType type, VariableUnion a3)>RemoveRefToValueInternal{ 0x0, 0x6901C0};
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int parentId, unsigned int newParentId)>CopyArray{ 0x0, 0x690770};
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int parentId, unsigned int name, VariableValue * value)>SetVariableEntityFieldValue{ 0x0, 0x690910};
|
||||
WEAK symbol<void(scriptInstance_t inst, VariableValue * a2)>Scr_ClearVector{ 0x0, 0x691000};
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_FreeEntityList{ 0x0, 0x692160};
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_FreeObjects{ 0x0, 0x6921E0};
|
||||
WEAK symbol<void(unsigned int arrayId, scriptInstance_t inst)>Scr_AddArrayKeys{ 0x0, 0x692DE0};
|
||||
WEAK symbol<float(scriptInstance_t inst, unsigned int parentId)>Scr_GetObjectUsage{ 0x0, 0x693030};
|
||||
WEAK symbol<char *(const char * filename)>Scr_GetSourceFile_LoadObj{ 0x0, 0x6932C0};
|
||||
WEAK symbol<char *(const char * filename)>Scr_GetSourceFile_FastFile{ 0x0, 0x693350};
|
||||
WEAK symbol<void(scriptInstance_t inst, char * Format)>Scr_AddFieldsForFile{ 0x0, 0x693390};
|
||||
WEAK symbol<void(scriptInstance_t inst, const char * path, const char * extension)>Scr_AddFields_LoadObj{ 0x0, 0x6936B0};
|
||||
WEAK symbol<void(scriptInstance_t inst, const char * path, const char * extension)>Scr_AddFields_FastFile{ 0x0, 0x693830};
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int parentId)>Scr_MakeValuePrimitive{ 0x0, 0x6938B0};
|
||||
|
||||
inline void* Scr_InitVariableRange_ADDR() { return CALL_ADDR(0x0, 0x68EF90); }
|
||||
void Scr_InitVariableRange(unsigned int begin, unsigned int end, scriptInstance_t inst, void* call_addr = Scr_InitVariableRange_ADDR());
|
||||
inline void* Scr_InitClassMap_ADDR() { return CALL_ADDR(0x0, 0x68F030); }
|
||||
void Scr_InitClassMap(scriptInstance_t inst, void* call_addr = Scr_InitClassMap_ADDR());
|
||||
inline void* GetNewVariableIndexInternal2_ADDR() { return CALL_ADDR(0x0, 0x68F4A0); }
|
||||
unsigned int GetNewVariableIndexInternal2(unsigned int name, scriptInstance_t inst, unsigned int parentId, unsigned int index, void* call_addr = GetNewVariableIndexInternal2_ADDR());
|
||||
inline void* GetNewVariableIndexReverseInternal2_ADDR() { return CALL_ADDR(0x0, 0x68F560); }
|
||||
unsigned int GetNewVariableIndexReverseInternal2(unsigned int name, scriptInstance_t inst, unsigned int parentId, unsigned int index, void* call_addr = GetNewVariableIndexReverseInternal2_ADDR());
|
||||
inline void* MakeVariableExternal_ADDR() { return CALL_ADDR(0x0, 0x68F620); }
|
||||
void MakeVariableExternal(VariableValueInternal * parentValue, scriptInstance_t inst, unsigned int index, void* call_addr = MakeVariableExternal_ADDR());
|
||||
inline void* FreeChildValue_ADDR() { return CALL_ADDR(0x0, 0x68F800); }
|
||||
void FreeChildValue(unsigned int id, scriptInstance_t inst, unsigned int parentId, void* call_addr = FreeChildValue_ADDR());
|
||||
inline void* ClearObject_ADDR() { return CALL_ADDR(0x0, 0x68F9E0); }
|
||||
void ClearObject(unsigned int parentId, scriptInstance_t inst, void* call_addr = ClearObject_ADDR());
|
||||
inline void* Scr_StopThread_ADDR() { return CALL_ADDR(0x0, 0x68FA30); }
|
||||
void Scr_StopThread(scriptInstance_t inst, unsigned int threadId, void* call_addr = Scr_StopThread_ADDR());
|
||||
inline void* GetSafeParentLocalId_ADDR() { return CALL_ADDR(0x0, 0x68FAA0); }
|
||||
unsigned int GetSafeParentLocalId(scriptInstance_t inst, unsigned int threadId, void* call_addr = GetSafeParentLocalId_ADDR());
|
||||
inline void* GetStartLocalId_ADDR() { return CALL_ADDR(0x0, 0x68FAD0); }
|
||||
unsigned int GetStartLocalId(unsigned int threadId, scriptInstance_t inst, void* call_addr = GetStartLocalId_ADDR());
|
||||
inline void* Scr_KillThread_ADDR() { return CALL_ADDR(0x0, 0x68FB10); }
|
||||
void Scr_KillThread(scriptInstance_t inst, unsigned int parentId, void* call_addr = Scr_KillThread_ADDR());
|
||||
inline void* AllocVariable_ADDR() { return CALL_ADDR(0x0, 0x68FCE0); }
|
||||
unsigned __int16 AllocVariable(scriptInstance_t inst, void* call_addr = AllocVariable_ADDR());
|
||||
inline void* FreeVariable_ADDR() { return CALL_ADDR(0x0, 0x68FDC0); }
|
||||
void FreeVariable(unsigned int id, scriptInstance_t inst, void* call_addr = FreeVariable_ADDR());
|
||||
inline void* AllocValue_ADDR() { return CALL_ADDR(0x0, 0x68FE20); }
|
||||
unsigned int AllocValue(scriptInstance_t inst, void* call_addr = AllocValue_ADDR());
|
||||
inline void* AllocEntity_ADDR() { return CALL_ADDR(0x0, 0x68FF10); }
|
||||
unsigned int AllocEntity(unsigned int classnum, scriptInstance_t inst, int entnum, int clientnum, void* call_addr = AllocEntity_ADDR());
|
||||
inline void* Scr_AllocArray_ADDR() { return CALL_ADDR(0x0, 0x68FF60); }
|
||||
unsigned int Scr_AllocArray(scriptInstance_t inst, void* call_addr = Scr_AllocArray_ADDR());
|
||||
inline void* AllocChildThread_ADDR() { return CALL_ADDR(0x0, 0x68FF90); }
|
||||
unsigned int AllocChildThread(scriptInstance_t inst, unsigned int parentLocalId, unsigned int self, void* call_addr = AllocChildThread_ADDR());
|
||||
inline void* FreeValue_ADDR() { return CALL_ADDR(0x0, 0x68FFD0); }
|
||||
void FreeValue(unsigned int id, scriptInstance_t inst, void* call_addr = FreeValue_ADDR());
|
||||
inline void* RemoveRefToObject_ADDR() { return CALL_ADDR(0x0, 0x690040); }
|
||||
void RemoveRefToObject(unsigned int id, scriptInstance_t inst, void* call_addr = RemoveRefToObject_ADDR());
|
||||
inline void* Scr_AllocVector_ADDR() { return CALL_ADDR(0x0, 0x690100); }
|
||||
float * Scr_AllocVector(scriptInstance_t inst, void* call_addr = Scr_AllocVector_ADDR());
|
||||
inline void* RemoveRefToVector_ADDR() { return CALL_ADDR(0x0, 0x690130); }
|
||||
void RemoveRefToVector(const float* vectorValue, scriptInstance_t inst, void* call_addr = RemoveRefToVector_ADDR());
|
||||
inline void* AddRefToValue_ADDR() { return CALL_ADDR(0x0, 0x690160); }
|
||||
void AddRefToValue(scriptInstance_t inst, VariableType type_, VariableUnion u, void* call_addr = AddRefToValue_ADDR());
|
||||
inline void* FindArrayVariable_ADDR() { return CALL_ADDR(0x0, 0x690210); }
|
||||
int FindArrayVariable(unsigned int id, unsigned int intvalue, scriptInstance_t inst, void* call_addr = FindArrayVariable_ADDR());
|
||||
inline void* FindVariable_ADDR() { return CALL_ADDR(0x0, 0x690260); }
|
||||
unsigned int FindVariable(unsigned int unsignedValue, unsigned int parentId, scriptInstance_t inst, void* call_addr = FindVariable_ADDR());
|
||||
inline void* GetArrayVariableIndex_ADDR() { return CALL_ADDR(0x0, 0x6902A0); }
|
||||
unsigned int GetArrayVariableIndex(unsigned int unsignedValue, scriptInstance_t inst, unsigned int parentId, void* call_addr = GetArrayVariableIndex_ADDR());
|
||||
inline void* Scr_GetVariableFieldIndex_ADDR() { return CALL_ADDR(0x0, 0x6902F0); }
|
||||
unsigned int Scr_GetVariableFieldIndex(scriptInstance_t inst, unsigned int name, unsigned int parentId, void* call_addr = Scr_GetVariableFieldIndex_ADDR());
|
||||
inline void* Scr_FindVariableField_ADDR() { return CALL_ADDR(0x0, 0x6903B0); }
|
||||
VariableValue Scr_FindVariableField(scriptInstance_t inst, unsigned int parentId, unsigned int name, void* call_addr = Scr_FindVariableField_ADDR());
|
||||
inline void* ClearVariableField_ADDR() { return CALL_ADDR(0x0, 0x690450); }
|
||||
void ClearVariableField(scriptInstance_t inst, unsigned int id, unsigned int name, VariableValue * value, void* call_addr = ClearVariableField_ADDR());
|
||||
inline void* GetVariable_ADDR() { return CALL_ADDR(0x0, 0x690510); }
|
||||
unsigned int GetVariable(scriptInstance_t inst, unsigned int parentId, unsigned int name, void* call_addr = GetVariable_ADDR());
|
||||
inline void* GetNewVariable_ADDR() { return CALL_ADDR(0x0, 0x690570); }
|
||||
unsigned int GetNewVariable(scriptInstance_t inst, unsigned int unsignedValue, unsigned int parentId, void* call_addr = GetNewVariable_ADDR());
|
||||
inline void* GetObjectVariable_ADDR() { return CALL_ADDR(0x0, 0x6905B0); }
|
||||
unsigned int GetObjectVariable(unsigned int id, scriptInstance_t inst, unsigned int parentId, void* call_addr = GetObjectVariable_ADDR());
|
||||
inline void* GetNewObjectVariable_ADDR() { return CALL_ADDR(0x0, 0x690610); }
|
||||
unsigned int GetNewObjectVariable(scriptInstance_t inst, unsigned int name, unsigned int parentId, void* call_addr = GetNewObjectVariable_ADDR());
|
||||
inline void* RemoveVariable_ADDR() { return CALL_ADDR(0x0, 0x690650); }
|
||||
void RemoveVariable(unsigned int name, unsigned int parentId, scriptInstance_t inst, void* call_addr = RemoveVariable_ADDR());
|
||||
inline void* RemoveNextVariable_ADDR() { return CALL_ADDR(0x0, 0x6906A0); }
|
||||
void RemoveNextVariable(scriptInstance_t inst, unsigned int parentId, void* call_addr = RemoveNextVariable_ADDR());
|
||||
inline void* SafeRemoveVariable_ADDR() { return CALL_ADDR(0x0, 0x690710); }
|
||||
void SafeRemoveVariable(unsigned int unsignedValue, unsigned int parentId, scriptInstance_t inst, void* call_addr = SafeRemoveVariable_ADDR());
|
||||
inline void* SetVariableValue_ADDR() { return CALL_ADDR(0x0, 0x6908D0); }
|
||||
void SetVariableValue(scriptInstance_t inst, VariableValue * value, unsigned int id, void* call_addr = SetVariableValue_ADDR());
|
||||
inline void* Scr_EvalVariable_ADDR() { return CALL_ADDR(0x0, 0x690A10); }
|
||||
VariableValue Scr_EvalVariable(scriptInstance_t inst, unsigned int id, void* call_addr = Scr_EvalVariable_ADDR());
|
||||
inline void* Scr_EvalVariableObject_ADDR() { return CALL_ADDR(0x0, 0x690A50); }
|
||||
unsigned int Scr_EvalVariableObject(scriptInstance_t inst, int id, void* call_addr = Scr_EvalVariableObject_ADDR());
|
||||
inline void* Scr_EvalVariableEntityField_ADDR() { return CALL_ADDR(0x0, 0x690AB0); }
|
||||
VariableValue Scr_EvalVariableEntityField(unsigned int entId, scriptInstance_t inst, unsigned int name, void* call_addr = Scr_EvalVariableEntityField_ADDR());
|
||||
inline void* Scr_EvalVariableField_ADDR() { return CALL_ADDR(0x0, 0x690BB0); }
|
||||
VariableValue Scr_EvalVariableField(scriptInstance_t inst, unsigned int id, void* call_addr = Scr_EvalVariableField_ADDR());
|
||||
inline void* Scr_EvalSizeValue_ADDR() { return CALL_ADDR(0x0, 0x690C10); }
|
||||
void Scr_EvalSizeValue(scriptInstance_t inst, VariableValue * value, void* call_addr = Scr_EvalSizeValue_ADDR());
|
||||
inline void* GetObject_ADDR() { return CALL_ADDR(0x0, 0x690CF0); }
|
||||
unsigned int GetObject(scriptInstance_t inst, unsigned int id, void* call_addr = GetObject_ADDR());
|
||||
inline void* GetArray_ADDR() { return CALL_ADDR(0x0, 0x690D50); }
|
||||
unsigned int GetArray(scriptInstance_t inst, unsigned int id, void* call_addr = GetArray_ADDR());
|
||||
inline void* Scr_EvalBoolComplement_ADDR() { return CALL_ADDR(0x0, 0x690DB0); }
|
||||
void Scr_EvalBoolComplement(scriptInstance_t inst, VariableValue * value, void* call_addr = Scr_EvalBoolComplement_ADDR());
|
||||
inline void* Scr_CastBool_ADDR() { return CALL_ADDR(0x0, 0x690E00); }
|
||||
void Scr_CastBool(scriptInstance_t inst, VariableValue* value, void* call_addr = Scr_CastBool_ADDR());
|
||||
inline void* Scr_CastString_ADDR() { return CALL_ADDR(0x0, 0x690E80); }
|
||||
char Scr_CastString(scriptInstance_t inst, VariableValue* value, void* call_addr = Scr_CastString_ADDR());
|
||||
inline void* Scr_CastDebugString_ADDR() { return CALL_ADDR(0x0, 0x690F30); }
|
||||
void Scr_CastDebugString(scriptInstance_t inst, VariableValue* value, void* call_addr = Scr_CastDebugString_ADDR());
|
||||
inline void* Scr_CastVector_ADDR() { return CALL_ADDR(0x0, 0x691040); }
|
||||
void Scr_CastVector(scriptInstance_t inst, VariableValue* value, void* call_addr = Scr_CastVector_ADDR());
|
||||
inline void* Scr_EvalFieldObject_ADDR() { return CALL_ADDR(0x0, 0x691110); }
|
||||
VariableUnion Scr_EvalFieldObject(VariableValue * value, scriptInstance_t inst, int a3, void* call_addr = Scr_EvalFieldObject_ADDR());
|
||||
inline void* Scr_UnmatchingTypesError_ADDR() { return CALL_ADDR(0x0, 0x6911B0); }
|
||||
void Scr_UnmatchingTypesError(scriptInstance_t inst, VariableValue * value2, VariableValue * value1, void* call_addr = Scr_UnmatchingTypesError_ADDR());
|
||||
inline void* Scr_CastWeakerPair_ADDR() { return CALL_ADDR(0x0, 0x691270); }
|
||||
void Scr_CastWeakerPair(VariableValue * value2, VariableValue * value1, scriptInstance_t inst, void* call_addr = Scr_CastWeakerPair_ADDR());
|
||||
inline void* Scr_CastWeakerStringPair_ADDR() { return CALL_ADDR(0x0, 0x691370); }
|
||||
void Scr_CastWeakerStringPair(VariableValue * value2, VariableValue * value1, scriptInstance_t inst, void* call_addr = Scr_CastWeakerStringPair_ADDR());
|
||||
inline void* Scr_EvalOr_ADDR() { return CALL_ADDR(0x0, 0x6914E0); }
|
||||
void Scr_EvalOr(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalOr_ADDR());
|
||||
inline void* Scr_EvalExOr_ADDR() { return CALL_ADDR(0x0, 0x691510); }
|
||||
void Scr_EvalExOr(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalExOr_ADDR());
|
||||
inline void* Scr_EvalAnd_ADDR() { return CALL_ADDR(0x0, 0x691540); }
|
||||
void Scr_EvalAnd(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalAnd_ADDR());
|
||||
inline void* Scr_EvalEquality_ADDR() { return CALL_ADDR(0x0, 0x691570); }
|
||||
void Scr_EvalEquality(VariableValue * value1, scriptInstance_t inst, VariableValue * value2, void* call_addr = Scr_EvalEquality_ADDR());
|
||||
inline void* Scr_EvalLess_ADDR() { return CALL_ADDR(0x0, 0x691760); }
|
||||
void Scr_EvalLess(VariableValue * value1, VariableValue * value2, scriptInstance_t a3, void* call_addr = Scr_EvalLess_ADDR());
|
||||
inline void* Scr_EvalGreaterEqual_ADDR() { return CALL_ADDR(0x0, 0x6917D0); }
|
||||
void Scr_EvalGreaterEqual(scriptInstance_t inst, VariableValue * value1, VariableValue * value2, void* call_addr = Scr_EvalGreaterEqual_ADDR());
|
||||
inline void* Scr_EvalGreater_ADDR() { return CALL_ADDR(0x0, 0x6917F0); }
|
||||
void Scr_EvalGreater(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalGreater_ADDR());
|
||||
inline void* Scr_EvalLessEqual_ADDR() { return CALL_ADDR(0x0, 0x691860); }
|
||||
void Scr_EvalLessEqual(scriptInstance_t inst, VariableValue * value1, VariableValue * value2, void* call_addr = Scr_EvalLessEqual_ADDR());
|
||||
inline void* Scr_EvalShiftLeft_ADDR() { return CALL_ADDR(0x0, 0x691880); }
|
||||
void Scr_EvalShiftLeft(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalShiftLeft_ADDR());
|
||||
inline void* Scr_EvalShiftRight_ADDR() { return CALL_ADDR(0x0, 0x6918B0); }
|
||||
void Scr_EvalShiftRight(VariableValue * value1, VariableValue * value2, scriptInstance_t inst, void* call_addr = Scr_EvalShiftRight_ADDR());
|
||||
inline void* Scr_EvalPlus_ADDR() { return CALL_ADDR(0x0, 0x6918E0); }
|
||||
void Scr_EvalPlus(scriptInstance_t inst, VariableValue* value1, VariableValue* value2, void* call_addr = Scr_EvalPlus_ADDR());
|
||||
inline void* Scr_EvalMinus_ADDR() { return CALL_ADDR(0x0, 0x691B00); }
|
||||
void Scr_EvalMinus(VariableValue * value1, scriptInstance_t inst, VariableValue * value2, void* call_addr = Scr_EvalMinus_ADDR());
|
||||
inline void* Scr_EvalMultiply_ADDR() { return CALL_ADDR(0x0, 0x691C20); }
|
||||
void Scr_EvalMultiply(VariableValue * value1, scriptInstance_t inst, VariableValue * value2, void* call_addr = Scr_EvalMultiply_ADDR());
|
||||
inline void* Scr_EvalDivide_ADDR() { return CALL_ADDR(0x0, 0x691D40); }
|
||||
void Scr_EvalDivide(VariableValue * value1, scriptInstance_t inst, VariableValue * value2, void* call_addr = Scr_EvalDivide_ADDR());
|
||||
inline void* Scr_EvalMod_ADDR() { return CALL_ADDR(0x0, 0x691F00); }
|
||||
void Scr_EvalMod(scriptInstance_t inst, VariableValue * value1, VariableValue * value2, void* call_addr = Scr_EvalMod_ADDR());
|
||||
inline void* Scr_EvalBinaryOperator_ADDR() { return CALL_ADDR(0x0, 0x691F50); }
|
||||
void Scr_EvalBinaryOperator(scriptInstance_t inst, VariableValue * value1, OpcodeVM op, VariableValue * value2, void* call_addr = Scr_EvalBinaryOperator_ADDR());
|
||||
inline void* Scr_FreeEntityNum_ADDR() { return CALL_ADDR(0x0, 0x692090); }
|
||||
void Scr_FreeEntityNum(scriptInstance_t inst, unsigned int result, unsigned int entnum, void* call_addr = Scr_FreeEntityNum_ADDR());
|
||||
inline void* Scr_SetClassMap_ADDR() { return CALL_ADDR(0x0, 0x692260); }
|
||||
void Scr_SetClassMap(scriptInstance_t inst, unsigned int classnum, void* call_addr = Scr_SetClassMap_ADDR());
|
||||
inline void* Scr_RemoveClassMap_ADDR() { return CALL_ADDR(0x0, 0x6922E0); }
|
||||
void Scr_RemoveClassMap(unsigned int classnum, scriptInstance_t inst, void* call_addr = Scr_RemoveClassMap_ADDR());
|
||||
inline void* Scr_AddClassField_ADDR() { return CALL_ADDR(0x0, 0x692350); }
|
||||
void Scr_AddClassField(scriptInstance_t inst, unsigned int classnum, const char * name, unsigned int offset, void* call_addr = Scr_AddClassField_ADDR());
|
||||
inline void* Scr_GetOffset_ADDR() { return CALL_ADDR(0x0, 0x692440); }
|
||||
VariableUnion Scr_GetOffset(const char * name, scriptInstance_t inst, classNum_e classNum, void* call_addr = Scr_GetOffset_ADDR());
|
||||
inline void* FindEntityId_ADDR() { return CALL_ADDR(0x0, 0x6924C0); }
|
||||
unsigned int FindEntityId(unsigned int entClass, int entNum, scriptInstance_t inst, void* call_addr = FindEntityId_ADDR());
|
||||
inline void* Scr_GetEntityId_ADDR() { return CALL_ADDR(0x0, 0x692520); }
|
||||
unsigned int Scr_GetEntityId(int entNum, scriptInstance_t inst, classNum_e classnum, int clientnum, void* call_addr = Scr_GetEntityId_ADDR());
|
||||
inline void* Scr_FindArrayIndex_ADDR() { return CALL_ADDR(0x0, 0x6925B0); }
|
||||
unsigned int Scr_FindArrayIndex(scriptInstance_t inst, VariableValue* index, unsigned int parentId, void* call_addr = Scr_FindArrayIndex_ADDR());
|
||||
inline void* Scr_EvalArray_ADDR() { return CALL_ADDR(0x0, 0x692680); }
|
||||
void Scr_EvalArray(scriptInstance_t inst, VariableValue * index, VariableValue * value, void* call_addr = Scr_EvalArray_ADDR());
|
||||
inline void* Scr_EvalArrayRef_ADDR() { return CALL_ADDR(0x0, 0x692850); }
|
||||
unsigned int Scr_EvalArrayRef(scriptInstance_t inst, unsigned int parentId, void* call_addr = Scr_EvalArrayRef_ADDR());
|
||||
inline void* ClearArray_ADDR() { return CALL_ADDR(0x0, 0x692AF0); }
|
||||
void ClearArray(unsigned int parentId, scriptInstance_t inst, VariableValue * value, void* call_addr = ClearArray_ADDR());
|
||||
inline void* SetEmptyArray_ADDR() { return CALL_ADDR(0x0, 0x692D70); }
|
||||
void SetEmptyArray(scriptInstance_t inst, unsigned int parentId, void* call_addr = SetEmptyArray_ADDR());
|
||||
inline void* Scr_GetEntityIdRef_ADDR() { return CALL_ADDR(0x0, 0x692EC0); }
|
||||
scr_entref_t * Scr_GetEntityIdRef(scr_entref_t * retstr, scriptInstance_t inst, unsigned int entId, void* call_addr = Scr_GetEntityIdRef_ADDR());
|
||||
inline void* CopyEntity_ADDR() { return CALL_ADDR(0x0, 0x692F00); }
|
||||
void CopyEntity(unsigned int parentId, unsigned int newParentId, void* call_addr = CopyEntity_ADDR());
|
||||
inline void* Scr_GetEndonUsage_ADDR() { return CALL_ADDR(0x0, 0x692FC0); }
|
||||
float Scr_GetEndonUsage(unsigned int parentId, scriptInstance_t inst, void* call_addr = Scr_GetEndonUsage_ADDR());
|
||||
inline void* Scr_GetThreadUsage_ADDR() { return CALL_ADDR(0x0, 0x693130); }
|
||||
float Scr_GetThreadUsage(VariableStackBuffer * stackBuf, scriptInstance_t inst, float * endonUsage, void* call_addr = Scr_GetThreadUsage_ADDR());
|
||||
inline void* Scr_FindField_ADDR() { return CALL_ADDR(0x0, 0x693250); }
|
||||
unsigned int Scr_FindField(scriptInstance_t inst, const char * name, int * type, void* call_addr = Scr_FindField_ADDR());
|
||||
inline void* Scr_FreeGameVariable_ADDR() { return CALL_ADDR(0x0, 0x693A10); }
|
||||
void Scr_FreeGameVariable(scriptInstance_t inst, int bComplete, void* call_addr = Scr_FreeGameVariable_ADDR());
|
||||
inline void* Scr_SLHasLowercaseString_ADDR() { return CALL_ADDR(0x0, 0x693A70); }
|
||||
bool Scr_SLHasLowercaseString(unsigned int parentId, const char * str, void* call_addr = Scr_SLHasLowercaseString_ADDR());
|
||||
|
||||
unsigned int FindObject(scriptInstance_t inst, unsigned int id);
|
||||
unsigned int FindFirstSibling(scriptInstance_t inst, unsigned int id);
|
||||
unsigned int FindNextSibling(scriptInstance_t inst, unsigned int id);
|
||||
VariableValue Scr_GetArrayIndexValue(scriptInstance_t inst, unsigned int name);
|
||||
float Scr_GetEntryUsageInternal(scriptInstance_t inst, unsigned int type, VariableUnion u);
|
||||
float Scr_GetEntryUsage(scriptInstance_t inst, VariableValueInternal* entryValue);
|
||||
void AddRefToObject(scriptInstance_t inst, unsigned int id);
|
||||
void RemoveRefToEmptyObject(scriptInstance_t inst, unsigned int id);
|
||||
void Scr_ClearThread(scriptInstance_t inst, unsigned int parentId);
|
||||
unsigned int FindObjectVariable(scriptInstance_t inst, unsigned int parentId, unsigned int id);
|
||||
void RemoveObjectVariable(scriptInstance_t inst, unsigned int parentId, unsigned int id);
|
||||
VariableValueInternal_u* GetVariableValueAddress(scriptInstance_t inst, unsigned int id);
|
||||
void Scr_KillEndonThread(scriptInstance_t inst, unsigned int threadId);
|
||||
BOOL IsValidArrayIndex(scriptInstance_t inst, unsigned int unsignedValue);
|
||||
void RemoveArrayVariable(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
void SafeRemoveArrayVariable(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
void AddRefToVector(scriptInstance_t inst, const float* floatVal);
|
||||
unsigned int FindArrayVariableIndex(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
unsigned int GetVariableIndexInternal(scriptInstance_t inst, unsigned int parentId, unsigned int name);
|
||||
unsigned int GetNewVariableIndexInternal(scriptInstance_t inst, unsigned int parentId, unsigned int name);
|
||||
unsigned int AllocObject(scriptInstance_t inst);
|
||||
VariableType GetValueType(scriptInstance_t inst, unsigned int id);
|
||||
VariableType GetObjectType(scriptInstance_t inst, unsigned int id);
|
||||
float* Scr_AllocVector_(scriptInstance_t inst, const float* v);
|
||||
void Scr_EvalInequality(scriptInstance_t inst, VariableValue* value1, VariableValue* value2);
|
||||
unsigned int Scr_EvalArrayRefInternal(scriptInstance_t inst, VariableValue* varValue, VariableValueInternal* parentValue);
|
||||
unsigned int GetNewArrayVariableIndex(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
unsigned int GetNewArrayVariable(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
unsigned int GetArrayVariable(scriptInstance_t inst, unsigned int parentId, unsigned int unsignedValue);
|
||||
unsigned int AllocThread(scriptInstance_t inst, unsigned int self);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,182 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_VM_Init{ 0x0, 0x693B20 };
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int startLocalId, VariableStackBuffer* stackValue)>VM_UnarchiveStack{ 0x0, 0x697BB0 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst)>VM_ExecuteInternal{ 0x0, 0x693E80 };
|
||||
WEAK symbol<unsigned int(scriptInstance_t inst, unsigned int localId, const char* pos, unsigned int paramcount)>VM_Execute{ 0x0, 0x6992E0 };
|
||||
WEAK symbol<void(scriptInstance_t inst, int bComplete)>Scr_ShutdownSystem{ 0x0, 0x699930 };
|
||||
WEAK symbol<BOOL()>Scr_IsSystemActive{ 0x0, 0x699C30 };
|
||||
WEAK symbol<scr_animtree_t()>Scr_GetAnimTree{ 0x0, 0x699DD0 };
|
||||
WEAK symbol<unsigned int()>Scr_GetFunc{ 0x0, 0x69A2C0 };
|
||||
WEAK symbol<void(VariableUnion value)>Scr_AddAnim{ 0x0, 0x69A6D0 };
|
||||
WEAK symbol<void(scriptInstance_t inst)>Scr_AddArray{ 0x0, 0x69AA50 };
|
||||
|
||||
inline void* Scr_Init_ADDR() { return CALL_ADDR(0x0, 0x693C20); }
|
||||
void Scr_Init(scriptInstance_t inst, void* call_addr = Scr_Init_ADDR());
|
||||
inline void* Scr_Shutdown_ADDR() { return CALL_ADDR(0x0, 0x693C90); }
|
||||
void Scr_Shutdown(scriptInstance_t inst, void* call_addr = Scr_Shutdown_ADDR());
|
||||
inline void* Scr_ErrorInternal_ADDR() { return CALL_ADDR(0x0, 0x693CF0); }
|
||||
void Scr_ErrorInternal(scriptInstance_t inst, void* call_addr = Scr_ErrorInternal_ADDR());
|
||||
inline void* Scr_ClearOutParams_ADDR() { return CALL_ADDR(0x0, 0x693DA0); }
|
||||
void Scr_ClearOutParams(scriptInstance_t inst, void* call_addr = Scr_ClearOutParams_ADDR());
|
||||
inline void* GetDummyObject_ADDR() { return CALL_ADDR(0x0, 0x693DE0); }
|
||||
unsigned int GetDummyObject(scriptInstance_t inst, void* call_addr = GetDummyObject_ADDR());
|
||||
inline void* GetDummyFieldValue_ADDR() { return CALL_ADDR(0x0, 0x693E30); }
|
||||
unsigned int GetDummyFieldValue(scriptInstance_t inst, void* call_addr = GetDummyFieldValue_ADDR());
|
||||
inline void* VM_CancelNotifyInternal_ADDR() { return CALL_ADDR(0x0, 0x6978C0); }
|
||||
void VM_CancelNotifyInternal(scriptInstance_t inst, unsigned int notifyListOwnerId, unsigned int startLocalId, unsigned int notifyListId, unsigned int notifyNameListId, unsigned int stringValue, void* call_addr = VM_CancelNotifyInternal_ADDR());
|
||||
inline void* VM_CancelNotify_ADDR() { return CALL_ADDR(0x0, 0x697950); }
|
||||
void VM_CancelNotify(scriptInstance_t inst, unsigned int a2, unsigned int a3, void* call_addr = VM_CancelNotify_ADDR());
|
||||
inline void* VM_ArchiveStack_ADDR() { return CALL_ADDR(0x0, 0x697A00); }
|
||||
VariableStackBuffer * VM_ArchiveStack(scriptInstance_t inst, void* call_addr = VM_ArchiveStack_ADDR());
|
||||
inline void* Scr_AddLocalVars_ADDR() { return CALL_ADDR(0x0, 0x697B60); }
|
||||
int Scr_AddLocalVars(scriptInstance_t inst, unsigned int a2, void* call_addr = Scr_AddLocalVars_ADDR());
|
||||
inline void* VM_TerminateStack_ADDR() { return CALL_ADDR(0x0, 0x697D80); }
|
||||
void VM_TerminateStack(scriptInstance_t inst, unsigned int endLocalId, unsigned int startLocalId, VariableStackBuffer* name, void* call_addr = VM_TerminateStack_ADDR());
|
||||
inline void* VM_TrimStack_ADDR() { return CALL_ADDR(0x0, 0x697F20); }
|
||||
void VM_TrimStack(scriptInstance_t inst, unsigned int parentId, VariableStackBuffer * a3, int fromEndon, void* call_addr = VM_TrimStack_ADDR());
|
||||
inline void* Scr_TerminateRunningThread_ADDR() { return CALL_ADDR(0x0, 0x698150); }
|
||||
void Scr_TerminateRunningThread(scriptInstance_t inst, unsigned int a2, void* call_addr = Scr_TerminateRunningThread_ADDR());
|
||||
inline void* Scr_TerminateWaitThread_ADDR() { return CALL_ADDR(0x0, 0x698200); }
|
||||
void Scr_TerminateWaitThread(scriptInstance_t inst, unsigned int a2, unsigned int a3, void* call_addr = Scr_TerminateWaitThread_ADDR());
|
||||
inline void* Scr_CancelWaittill_ADDR() { return CALL_ADDR(0x0, 0x698310); }
|
||||
void Scr_CancelWaittill(scriptInstance_t inst, unsigned int startLocalId, void* call_addr = Scr_CancelWaittill_ADDR());
|
||||
inline void* Scr_TerminateWaittillThread_ADDR() { return CALL_ADDR(0x0, 0x698400); }
|
||||
void Scr_TerminateWaittillThread(scriptInstance_t inst, unsigned int a2, unsigned int a3, void* call_addr = Scr_TerminateWaittillThread_ADDR());
|
||||
inline void* Scr_TerminateThread_ADDR() { return CALL_ADDR(0x0, 0x698610); }
|
||||
void Scr_TerminateThread(unsigned int a2, scriptInstance_t inst, void* call_addr = Scr_TerminateThread_ADDR());
|
||||
inline void* VM_Notify_ADDR() { return CALL_ADDR(0x0, 0x698670); }
|
||||
void VM_Notify(scriptInstance_t inst, int notifyListOwnerId, unsigned int stringValue, VariableValue * top, void* call_addr = VM_Notify_ADDR());
|
||||
inline void* Scr_NotifyNum_Internal_ADDR() { return CALL_ADDR(0x0, 0x698CC0); }
|
||||
void Scr_NotifyNum_Internal(scriptInstance_t inst, int entNum, int entClass, unsigned int notifStr, int numParams, void* call_addr = Scr_NotifyNum_Internal_ADDR());
|
||||
inline void* Scr_CancelNotifyList_ADDR() { return CALL_ADDR(0x0, 0x698DE0); }
|
||||
void Scr_CancelNotifyList(unsigned int notifyListOwnerId, scriptInstance_t inst, void* call_addr = Scr_CancelNotifyList_ADDR());
|
||||
inline void* VM_TerminateTime_ADDR() { return CALL_ADDR(0x0, 0x698FE0); }
|
||||
void VM_TerminateTime(scriptInstance_t inst, unsigned int parentId, void* call_addr = VM_TerminateTime_ADDR());
|
||||
inline void* VM_Resume_ADDR() { return CALL_ADDR(0x0, 0x6990E0); }
|
||||
void VM_Resume(scriptInstance_t inst, unsigned int timeId, void* call_addr = VM_Resume_ADDR());
|
||||
inline void* Scr_ExecThread_ADDR() { return CALL_ADDR(0x0, 0x699560); }
|
||||
unsigned short Scr_ExecThread(scriptInstance_t inst, unsigned int handle, unsigned int paramCount, void* call_addr = Scr_ExecThread_ADDR());
|
||||
inline void* Scr_ExecEntThread_ADDR() { return CALL_ADDR(0x0, 0x699640); }
|
||||
unsigned short Scr_ExecEntThreadNum(scriptInstance_t inst, int entNum, unsigned int handle, int numParams, unsigned int clientNum, void* call_addr = Scr_ExecEntThread_ADDR());
|
||||
inline void* Scr_AddExecThread_ADDR() { return CALL_ADDR(0x0, 0x699730); }
|
||||
void Scr_AddExecThread(scriptInstance_t inst, unsigned int handle, void* call_addr = Scr_AddExecThread_ADDR());
|
||||
inline void* VM_SetTime_ADDR() { return CALL_ADDR(0x0, 0x6997E0); }
|
||||
void VM_SetTime(scriptInstance_t inst, void* call_addr = VM_SetTime_ADDR());
|
||||
inline void* Scr_InitSystem_ADDR() { return CALL_ADDR(0x0, 0x699860); }
|
||||
void Scr_InitSystem(scriptInstance_t inst, void* call_addr = Scr_InitSystem_ADDR());
|
||||
inline void* Scr_GetInt_ADDR() { return CALL_ADDR(0x0, 0x699C50); }
|
||||
int Scr_GetInt(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetInt_ADDR());
|
||||
inline void* Scr_GetAnim_ADDR() { return CALL_ADDR(0x0, 0x699CE0); }
|
||||
scr_anim_s Scr_GetAnim(unsigned int index, XAnimTree_s * anims, void* call_addr = Scr_GetAnim_ADDR());
|
||||
inline void* Scr_GetFloat_ADDR() { return CALL_ADDR(0x0, 0x699E90); }
|
||||
float Scr_GetFloat(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetFloat_ADDR());
|
||||
inline void* Scr_GetConstString_ADDR() { return CALL_ADDR(0x0, 0x699F30); }
|
||||
unsigned int Scr_GetConstString(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetConstString_ADDR());
|
||||
inline void* Scr_GetConstLowercaseString_ADDR() { return CALL_ADDR(0x0, 0x699FB0); }
|
||||
unsigned int Scr_GetConstLowercaseString(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetConstLowercaseString_ADDR());
|
||||
inline void* Scr_GetString_ADDR() { return CALL_ADDR(0x0, 0x69A0D0); }
|
||||
const char * Scr_GetString(unsigned int index, scriptInstance_t inst, void* call_addr = Scr_GetString_ADDR());
|
||||
inline void* Scr_GetConstStringIncludeNull_ADDR() { return CALL_ADDR(0x0, 0x69A100); }
|
||||
unsigned int Scr_GetConstStringIncludeNull(scriptInstance_t inst, void* call_addr = Scr_GetConstStringIncludeNull_ADDR());
|
||||
inline void* Scr_GetDebugString_ADDR() { return CALL_ADDR(0x0, 0x69A130); }
|
||||
char * Scr_GetDebugString(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetDebugString_ADDR());
|
||||
inline void* Scr_GetConstIString_ADDR() { return CALL_ADDR(0x0, 0x69A1A0); }
|
||||
unsigned int Scr_GetConstIString(unsigned int index, void* call_addr = Scr_GetConstIString_ADDR());
|
||||
inline void* Scr_GetVector_ADDR() { return CALL_ADDR(0x0, 0x69A220); }
|
||||
void Scr_GetVector(scriptInstance_t inst, float * value, unsigned int index, void* call_addr = Scr_GetVector_ADDR());
|
||||
inline void* Scr_GetEntityRef_ADDR() { return CALL_ADDR(0x0, 0x69A330); }
|
||||
scr_entref_t * Scr_GetEntityRef(scriptInstance_t inst, scr_entref_t * retstr, unsigned int index, void* call_addr = Scr_GetEntityRef_ADDR());
|
||||
inline void* Scr_GetObject_ADDR() { return CALL_ADDR(0x0, 0x69A460); }
|
||||
VariableUnion Scr_GetObject(scriptInstance_t inst, void* call_addr = Scr_GetObject_ADDR());
|
||||
inline void* Scr_GetType_ADDR() { return CALL_ADDR(0x0, 0x69A4E0); }
|
||||
VariableType Scr_GetType(scriptInstance_t inst, unsigned int index, void* call_addr = Scr_GetType_ADDR());
|
||||
inline void* Scr_GetTypeName_ADDR() { return CALL_ADDR(0x0, 0x69A530); }
|
||||
const char * Scr_GetTypeName(scriptInstance_t inst, void* call_addr = Scr_GetTypeName_ADDR());
|
||||
inline void* Scr_GetPointerType_ADDR() { return CALL_ADDR(0x0, 0x69A580); }
|
||||
VariableType Scr_GetPointerType(scriptInstance_t inst, unsigned int a2, void* call_addr = Scr_GetPointerType_ADDR());
|
||||
inline void* Scr_AddInt_ADDR() { return CALL_ADDR(0x0, 0x69A610); }
|
||||
void Scr_AddInt(scriptInstance_t inst, int value, void* call_addr = Scr_AddInt_ADDR());
|
||||
inline void* Scr_AddFloat_ADDR() { return CALL_ADDR(0x0, 0x69A670); }
|
||||
void Scr_AddFloat(scriptInstance_t inst, float value, void* call_addr = Scr_AddFloat_ADDR());
|
||||
inline void* Scr_AddUndefined_ADDR() { return CALL_ADDR(0x0, 0x69A720); }
|
||||
void Scr_AddUndefined(scriptInstance_t inst, void* call_addr = Scr_AddUndefined_ADDR());
|
||||
inline void* Scr_AddObject_ADDR() { return CALL_ADDR(0x0, 0x69A770); }
|
||||
void Scr_AddObject(scriptInstance_t inst, unsigned int entid, void* call_addr = Scr_AddObject_ADDR());
|
||||
inline void* Scr_AddString_ADDR() { return CALL_ADDR(0x0, 0x69A7E0); }
|
||||
void Scr_AddString(scriptInstance_t inst, const char * string, void* call_addr = Scr_AddString_ADDR());
|
||||
inline void* Scr_AddIString_ADDR() { return CALL_ADDR(0x0, 0x69A860); }
|
||||
void Scr_AddIString(char * string, void* call_addr = Scr_AddIString_ADDR());
|
||||
inline void* Scr_AddConstString_ADDR() { return CALL_ADDR(0x0, 0x69A8D0); }
|
||||
void Scr_AddConstString(scriptInstance_t inst, unsigned int id, void* call_addr = Scr_AddConstString_ADDR());
|
||||
inline void* Scr_AddVector_ADDR() { return CALL_ADDR(0x0, 0x69A940); }
|
||||
void Scr_AddVector(scriptInstance_t inst, float * value, void* call_addr = Scr_AddVector_ADDR());
|
||||
inline void* Scr_MakeArray_ADDR() { return CALL_ADDR(0x0, 0x69A9D0); }
|
||||
void Scr_MakeArray(scriptInstance_t inst, void* call_addr = Scr_MakeArray_ADDR());
|
||||
inline void* Scr_AddArrayStringIndexed_ADDR() { return CALL_ADDR(0x0, 0x69AAF0); }
|
||||
void Scr_AddArrayStringIndexed(unsigned int id, scriptInstance_t inst, void* call_addr = Scr_AddArrayStringIndexed_ADDR());
|
||||
inline void* Scr_Error_ADDR() { return CALL_ADDR(0x0, 0x69AB70); }
|
||||
void Scr_Error(const char * err, scriptInstance_t inst, int is_terminal, void* call_addr = Scr_Error_ADDR());
|
||||
inline void* Scr_TerminalError_ADDR() { return CALL_ADDR(0x0, 0x69ABD0); }
|
||||
void Scr_TerminalError(scriptInstance_t inst, const char * Source, void* call_addr = Scr_TerminalError_ADDR());
|
||||
inline void* Scr_ParamError_ADDR() { return CALL_ADDR(0x0, 0x69AC00); }
|
||||
void Scr_ParamError(int a1, scriptInstance_t a2, const char * Source, void* call_addr = Scr_ParamError_ADDR());
|
||||
inline void* Scr_ObjectError_ADDR() { return CALL_ADDR(0x0, 0x69AC30); }
|
||||
void Scr_ObjectError(scriptInstance_t inst, const char * a2, void* call_addr = Scr_ObjectError_ADDR());
|
||||
inline void* SetEntityFieldValue_ADDR() { return CALL_ADDR(0x0, 0x69AC50); }
|
||||
bool SetEntityFieldValue(scriptInstance_t inst, int offset, int entnum, classNum_e classnum, int clientNum, VariableValue * value, void* call_addr = SetEntityFieldValue_ADDR());
|
||||
inline void* GetEntityFieldValue_ADDR() { return CALL_ADDR(0x0, 0x69ACE0); }
|
||||
VariableValue GetEntityFieldValue(int offset, int entnum, scriptInstance_t inst, int classnum, int clientNum, void* call_addr = GetEntityFieldValue_ADDR());
|
||||
inline void* Scr_SetStructField_ADDR() { return CALL_ADDR(0x0, 0x69AD50); }
|
||||
void Scr_SetStructField(unsigned int a1, unsigned int a2, scriptInstance_t inst, void* call_addr = Scr_SetStructField_ADDR());
|
||||
inline void* Scr_IncTime_ADDR() { return CALL_ADDR(0x0, 0x69ADE0); }
|
||||
void Scr_IncTime(scriptInstance_t inst, void* call_addr = Scr_IncTime_ADDR());
|
||||
inline void* Scr_RunCurrentThreads_ADDR() { return CALL_ADDR(0x0, 0x69AE30); }
|
||||
void Scr_RunCurrentThreads(scriptInstance_t inst, void* call_addr = Scr_RunCurrentThreads_ADDR());
|
||||
inline void* Scr_ResetTimeout_ADDR() { return CALL_ADDR(0x0, 0x69AE60); }
|
||||
void Scr_ResetTimeout(scriptInstance_t inst, void* call_addr = Scr_ResetTimeout_ADDR());
|
||||
|
||||
void SetVariableFieldValue(scriptInstance_t inst, unsigned int id, VariableValue* value);
|
||||
void SetNewVariableValue(scriptInstance_t inst, unsigned int id, VariableValue* value);
|
||||
void Scr_ClearErrorMessage(scriptInstance_t inst);
|
||||
void VM_Shutdown(scriptInstance_t inst);
|
||||
void Scr_ShutdownVariables(scriptInstance_t inst);
|
||||
void ClearVariableValue(scriptInstance_t inst, unsigned int id);
|
||||
unsigned int Scr_GetThreadNotifyName(scriptInstance_t inst, unsigned int startLocalId);
|
||||
void Scr_RemoveThreadNotifyName(scriptInstance_t inst, unsigned int startLocalId);
|
||||
unsigned int GetArraySize(scriptInstance_t inst, unsigned int id);
|
||||
void IncInParam(scriptInstance_t inst);
|
||||
unsigned int GetParentLocalId(scriptInstance_t inst, unsigned int threadId);
|
||||
void Scr_ClearWaitTime(scriptInstance_t inst, unsigned int startLocalId);
|
||||
void Scr_SetThreadWaitTime(scriptInstance_t inst, unsigned int startLocalId, unsigned int waitTime);
|
||||
void Scr_SetThreadNotifyName(scriptInstance_t inst, unsigned int startLocalId, unsigned int stringValue);
|
||||
void Scr_DebugTerminateThread(scriptInstance_t inst, int topThread);
|
||||
unsigned int Scr_GetThreadWaitTime(scriptInstance_t inst, unsigned int startLocalId);
|
||||
const char* Scr_GetStackThreadPos(scriptInstance_t inst, unsigned int endLocalId, VariableStackBuffer* stackValue, bool killThread);
|
||||
unsigned int Scr_GetSelf(scriptInstance_t inst, unsigned int threadId);
|
||||
unsigned int GetVariableKeyObject(scriptInstance_t inst, unsigned int id);
|
||||
int MT_Realloc(scriptInstance_t inst, int oldNumBytes, int newNumbytes);
|
||||
void CScr_GetObjectField(classNum_e classnum, int entnum, int clientNum, int offset);
|
||||
int CScr_SetObjectField(classNum_e classnum, int entnum, int clientNum, int offset);
|
||||
void Scr_SetErrorMessage(scriptInstance_t inst, const char* error);
|
||||
bool Scr_IsStackClear(scriptInstance_t inst);
|
||||
void SL_CheckExists(scriptInstance_t inst, unsigned int stringValue);
|
||||
const char* Scr_ReadCodePos(scriptInstance_t inst, const char** pos);
|
||||
unsigned int Scr_ReadUnsignedInt(scriptInstance_t inst, const char** pos);
|
||||
unsigned short Scr_ReadUnsignedShort(scriptInstance_t inst, const char** pos);
|
||||
unsigned char Scr_ReadUnsignedByte(scriptInstance_t inst, const char** pos);
|
||||
float Scr_ReadFloat(scriptInstance_t inst, const char** pos);
|
||||
const float* Scr_ReadVector(scriptInstance_t inst, const char** pos);
|
||||
BOOL IsFieldObject(scriptInstance_t inst, unsigned int id);
|
||||
void RemoveVariableValue(scriptInstance_t inst, unsigned int parentId, unsigned int index);
|
||||
VariableStackBuffer* GetRefVariableStackBuffer(scriptInstance_t inst, int id);
|
||||
unsigned int GetNewObjectVariableReverse(scriptInstance_t inst, unsigned int parentId, unsigned int id);
|
||||
unsigned int GetNewVariableIndexReverseInternal(scriptInstance_t inst, unsigned int parentId, unsigned int name);
|
||||
unsigned int Scr_GetLocalVar(scriptInstance_t inst, int pos);
|
||||
void Scr_EvalBoolNot(scriptInstance_t inst, VariableValue* value);
|
||||
unsigned int GetInternalVariableIndex(scriptInstance_t inst, unsigned int unsignedValue);
|
||||
const char* Scr_ReadData(scriptInstance_t inst, const char** pos, unsigned int count);
|
||||
unsigned int Scr_GetNumParam(game::scriptInstance_t inst);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<int()>yyparse{ 0x0, 0x69AEC0 };
|
||||
WEAK symbol<int()>yylex{ 0x0, 0x69C0D0 };
|
||||
WEAK symbol<int()>yy_get_next_buffer{ 0x0, 0x69D300 };
|
||||
WEAK symbol<int()>yy_get_previous_state{ 0x0, 0x69D450 };
|
||||
WEAK symbol<void()>yyrestart{ 0x0, 0x69D5C0 };
|
||||
WEAK symbol<yy_buffer_state* ()>yy_create_buffer{ 0x0, 0x69D620 };
|
||||
|
||||
inline void* LowerCase_ADDR() { return CALL_ADDR(0x0, 0x69AEA0); }
|
||||
unsigned int LowerCase(unsigned int strVal, void* call_addr = LowerCase_ADDR());
|
||||
inline void* StringValue_ADDR() { return CALL_ADDR(0x0, 0x69BFF0); }
|
||||
int StringValue(int len, const char* str_, void* call_addr = StringValue_ADDR());
|
||||
inline void* yy_try_NUL_trans_ADDR() { return CALL_ADDR(0x0, 0x69D520); }
|
||||
int yy_try_NUL_trans(int yy_current_state, void* call_addr = yy_try_NUL_trans_ADDR());
|
||||
inline void* yy_flush_buffer_ADDR() { return CALL_ADDR(0x0, 0x69D690); }
|
||||
void yy_flush_buffer(yy_buffer_state* result, void* call_addr = yy_flush_buffer_ADDR());
|
||||
inline void* ScriptParse_ADDR() { return CALL_ADDR(0x0, 0x69D710); }
|
||||
void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr = ScriptParse_ADDR());
|
||||
|
||||
FILE* yy_load_buffer_state();
|
||||
void yy_fatal_error(const char* err);
|
||||
void* yy_flex_realloc(void* ptr, unsigned int size);
|
||||
void yy_init_buffer(yy_buffer_state* b, FILE* file);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
namespace game
|
||||
{
|
||||
// unsigned int __usercall LowerCase@<eax>(unsigned int strVal@<ecx>)
|
||||
unsigned int LowerCase(unsigned int strVal, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, strVal;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall StringValue@<eax>(int len@<ecx>, const char *str@<edx>)
|
||||
int StringValue(int len, const char* str_, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, len;
|
||||
mov edx, str_;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall yy_try_NUL_trans@<eax>(int yy_current_state@<eax>)
|
||||
int yy_try_NUL_trans(int yy_current_state, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, yy_current_state;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall yy_flush_buffer(yy_buffer_state *result@<eax>)
|
||||
void yy_flush_buffer(yy_buffer_state* result, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, result;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall ScriptParse(scriptInstance_t a1@<eax>, sval_u *parseData)
|
||||
void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push parseData;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* yy_load_buffer_state()
|
||||
{
|
||||
FILE* result;
|
||||
|
||||
*game::yy_n_chars = (*game::yy_current_buffer)->yy_n_chars;
|
||||
*game::yy_c_buf_p = (*game::yy_current_buffer)->yy_buf_pos;
|
||||
*game::yytext = *game::yy_c_buf_p;
|
||||
result = (*game::yy_current_buffer)->yy_input_file;
|
||||
*game::yyin = (*game::yy_current_buffer)->yy_input_file;
|
||||
*game::yy_hold_char = *(*game::yy_c_buf_p);
|
||||
return result;
|
||||
}
|
||||
|
||||
void yy_fatal_error(const char* err)
|
||||
{
|
||||
game::_fprintf(game::__iob_func() + 2, "%s\n", err);
|
||||
game::_exit(2);
|
||||
}
|
||||
|
||||
void* yy_flex_realloc(void* ptr, unsigned int size)
|
||||
{
|
||||
return game::_realloc(ptr, size);
|
||||
}
|
||||
|
||||
void yy_init_buffer(yy_buffer_state* b, FILE* file)
|
||||
{
|
||||
game::yy_flush_buffer(b);
|
||||
b->yy_input_file = file;
|
||||
b->yy_fill_buffer = 1;
|
||||
b->yy_is_interactive = 0;
|
||||
}
|
||||
}
|
||||
+72
-26
@@ -1288,6 +1288,14 @@ namespace game
|
||||
LOC_SEL_INPUT_CANCEL = 0x5,
|
||||
};
|
||||
|
||||
enum KeyCatcherFlag_t : __int32
|
||||
{
|
||||
KEY_CATCHER_FLAG_CONSOLE = 0x1,
|
||||
KEY_CATCHER_FLAG_LOCATION_SELECTION = 0x8,
|
||||
KEY_CATCHER_FLAG_IN_POPUP = 0x10,
|
||||
KEY_CATCHER_FLAG_CHAT = 0x20,
|
||||
};
|
||||
|
||||
enum GamepadPhysicalAxis
|
||||
{
|
||||
GPAD_PHYSAXIS_RSTICK_X = 0x0,
|
||||
@@ -1878,26 +1886,25 @@ namespace game
|
||||
SPHERE_MAY_HIT_V1 = 0x3,
|
||||
};
|
||||
|
||||
enum GamePadButton : __int32
|
||||
enum GamePadButton
|
||||
{
|
||||
GPAD_NONE = 0x0,
|
||||
GPAD_UP = 0x10000008,
|
||||
GPAD_DOWN = 0x10000004,
|
||||
GPAD_LEFT = 0x10000001,
|
||||
GPAD_RIGHT = 0x10000002,
|
||||
GPAD_UP = 0x10000001,
|
||||
GPAD_DOWN = 0x10000002,
|
||||
GPAD_LEFT = 0x10000004,
|
||||
GPAD_RIGHT = 0x10000008,
|
||||
GPAD_START = 0x10000010,
|
||||
GPAD_BACK = 0x10004800,
|
||||
GPAD_L3 = 0x10005000,
|
||||
GPAD_R3 = 0x10004000,
|
||||
GPAD_A = 0x10000800,
|
||||
GPAD_B = 0x10001000,
|
||||
GPAD_X = 0x10000100,
|
||||
GPAD_Y = 0x10000200,
|
||||
GPAD_L_SHLDR = 0x10006000,
|
||||
GPAD_R_SHLDR = 0x10004400,
|
||||
GPAD_L_TRIG = 0x10002000,
|
||||
GPAD_R_TRIG = 0x10000400,
|
||||
GPAD_HOME = 0x10008000,
|
||||
GPAD_BACK = 0x10000020,
|
||||
GPAD_L3 = 0x10000040,
|
||||
GPAD_R3 = 0x10000080,
|
||||
GPAD_A = 0x10001000,
|
||||
GPAD_B = 0x10002000,
|
||||
GPAD_X = 0x10004000,
|
||||
GPAD_Y = 0x10008000,
|
||||
GPAD_L_SHLDR = 0x10000100,
|
||||
GPAD_R_SHLDR = 0x10000200,
|
||||
GPAD_L_TRIG = 0x20000000,
|
||||
GPAD_R_TRIG = 0x20000001,
|
||||
};
|
||||
|
||||
enum sysEventType_t
|
||||
@@ -3756,6 +3763,9 @@ namespace game
|
||||
CRITSECT_SCRIPT_STRING = 0xB,
|
||||
CRITSECT_MEMORY_TREE = 0xC,
|
||||
CRITSECT_SYS_EVENT_QUEUE = 0xE,
|
||||
CRITSECT_DXDEVICE = 0x11,
|
||||
CRITSECT_DXDEVICE_GLOB = 0x12,
|
||||
CRITSECT_MISSING_ASSET = 0x13,
|
||||
CRITSECT_PHYSICS_UPDATE = 0x15,
|
||||
CRITSECT_CINEMATIC = 0x19,
|
||||
CRITSECT_CINEMATIC_TARGET_CHANGE = 0x1A,
|
||||
@@ -3890,15 +3900,6 @@ namespace game
|
||||
HUDELEM_UPDATE_ARCHIVAL_AND_CURRENT = 0x3,
|
||||
};
|
||||
|
||||
enum sourceType_e
|
||||
{
|
||||
SOURCE_TYPE_BREAKPOINT = 0x1,
|
||||
SOURCE_TYPE_CALL = 0x2,
|
||||
SOURCE_TYPE_THREAD_START = 0x4,
|
||||
SOURCE_TYPE_BUILTIN_CALL = 0x8,
|
||||
SOURCE_TYPE_NOTIFY = 0x10,
|
||||
};
|
||||
|
||||
enum animBodyPart_t
|
||||
{
|
||||
ANIM_BP_UNUSED = 0x0,
|
||||
@@ -3908,6 +3909,51 @@ namespace game
|
||||
NUM_ANIM_BODYPARTS = 0x4,
|
||||
};
|
||||
|
||||
enum zone_flags_e
|
||||
{
|
||||
ZONE_FLAG_none = 0x0,
|
||||
DB_ZONE_COMMON_LOC = 0x1,
|
||||
DB_ZONE_LEVEL_LOC = 0x2,
|
||||
DB_ZONE_CODE = 0x4,
|
||||
DB_ZONE_COMMON = 0x8,
|
||||
DB_ZONE_LEVEL = 0x10,
|
||||
DB_ZONE_LOAD = 0x20,
|
||||
DB_ZONE_MYCHANGES = 0x40,
|
||||
ZONE_FLAG_unk3 = 0x80,
|
||||
DB_ZONE_LEVELOVERLAY = 0x100, // patch, not 'so'
|
||||
DB_ZONE_PATCH = 0x200,
|
||||
ZONE_FLAG_unk5 = 0x400,
|
||||
DB_ZONE_MOD = 0x800,
|
||||
};
|
||||
|
||||
enum xfile_block_type_e
|
||||
{
|
||||
XFILE_BLOCK_TEMP = 0x0,
|
||||
XFILE_BLOCK_RUNTIME = 0x1,
|
||||
XFILE_BLOCK_RUNTIME_BEGIN = 0x1,
|
||||
XFILE_BLOCK_LARGE_RUNTIME = 0x2,
|
||||
XFILE_BLOCK_PHYSICAL_RUNTIME = 0x3,
|
||||
XFILE_BLOCK_VIRTUAL = 0x4,
|
||||
XFILE_BLOCK_RUNTIME_END = 0x4,
|
||||
XFILE_BLOCK_LARGE = 0x5,
|
||||
XFILE_BLOCK_PHYSICAL = 0x6,
|
||||
MAX_XFILE_COUNT = 0x7,
|
||||
};
|
||||
|
||||
enum dm_memory_tyep_e
|
||||
{
|
||||
DM_MEMORY_TEMP = 0x0,
|
||||
DM_MEMORY_VIRTUAL = 0x1,
|
||||
DM_MEMORY_PHYSICAL = 0x2,
|
||||
};
|
||||
|
||||
enum phys_alloc_type_e
|
||||
{
|
||||
PHYS_ALLOC_LOW = 0x0,
|
||||
PHYS_ALLOC_HIGH = 0x1,
|
||||
PHYS_ALLOC_COUNT = 0x2,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,241 @@ namespace game
|
||||
}
|
||||
}
|
||||
|
||||
// HunkUser* __usercall Hunk_UserCreate@<eax>(signed int maxSize@<edi>, char* name, char fixed, char tempMem, char debugMem, int type);
|
||||
HunkUser* Hunk_UserCreate(signed int maxSize, const char* name, int fixed, int tempMem, int debugMem, int typ, void* call_addr)
|
||||
{
|
||||
HunkUser* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push typ;
|
||||
push debugMem;
|
||||
push tempMem;
|
||||
push fixed;
|
||||
push name;
|
||||
mov edi, maxSize;
|
||||
call call_addr;
|
||||
add esp, 0x14;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// unsigned int __usercall Hunk_AllocateTempMemoryHigh@<eax>(int a1@<eax>)
|
||||
unsigned int Hunk_AllocateTempMemoryHigh(int size_, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, size_;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall FS_FCloseFile(int h@<eax>)
|
||||
void FS_FCloseFile(int h, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, h;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void *__usercall Z_TryVirtualAlloc@<eax>(signed int a1@<edi>)
|
||||
void* Z_TryVirtualAlloc(signed int size_, void* call_addr)
|
||||
{
|
||||
void* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edi, size_;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall I_stricmp@<eax>(int a1@<eax>, CHAR *a2@<edx>, const char *a3)
|
||||
int I_stricmp(int len, const char* s0, const char* s1, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push s1;
|
||||
mov eax, len;
|
||||
mov edx, s0;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x4;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
//parseInfo_t* __usercall Com_Parse@<eax>(const char** a1@<esi>)
|
||||
parseInfo_t* Com_Parse(const char** buffer, void* call_addr)
|
||||
{
|
||||
parseInfo_t* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov esi, buffer;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
//int __usercall I_strncmp@<eax>(char *str1@<edx>, char *str2@<ecx>, int len)
|
||||
int I_strncmp(const char* str1, const char* str2, int len, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push len;
|
||||
mov ecx, str2;
|
||||
mov edx, str1;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// const char **__usercall FS_ListFilteredFiles@<eax>(searchpath_s *searchPath@<eax>, const char *path@<edx>, const char *extension, const char *filter, FsListBehavior_e behavior, int *numFiles)
|
||||
const char** FS_ListFilteredFiles(searchpath_s* searchPath, const char* path, const char* extension, const char* filter, FsListBehavior_e behavior, int* numFiles, void* call_addr)
|
||||
{
|
||||
const char** answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push numFiles;
|
||||
push behavior;
|
||||
push filter;
|
||||
push extension;
|
||||
mov eax, searchPath;
|
||||
mov edx, path;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x10;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
dvar_s * Dvar_RegisterBool/*@<eax>*/(unsigned __int8 val/*@<al>*/, const char * name/*@<edi>*/, int flags, const char * desc, void* call_addr)
|
||||
{
|
||||
dvar_s * answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push desc;
|
||||
push flags;
|
||||
mov al, val;
|
||||
mov edi, name;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
const char * XAnimGetAnimDebugName/*@<eax>*/(unsigned int animIndex/*@<ecx>*/, XAnim_s * anims/*@<edx>*/, void* call_addr)
|
||||
{
|
||||
const char * answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, animIndex;
|
||||
mov edx, anims;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// cmd_function_s *__usercall Cmd_FindCommand@<eax>(const char *cmdName@<esi>)
|
||||
cmd_function_s* Cmd_FindCommand(const char* cmdName, void* call_addr)
|
||||
{
|
||||
cmd_function_s* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov esi, cmdName;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// BuiltinMethod __usercall Scr_GetMethod@<eax>(int *type@<edi>, const char **pName@<esi>)
|
||||
BuiltinMethod Scr_GetMethod(int* type_, const char** pName, void* call_addr)
|
||||
{
|
||||
BuiltinMethod answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edi, type_;
|
||||
mov esi, pName;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
void Cmd_AddCommand(const char* name, void (__cdecl *function)())
|
||||
{
|
||||
cmd_function_s* newCmd = utils::memory::allocate<cmd_function_s>();
|
||||
|
||||
*newCmd = {};
|
||||
newCmd->next = *cmd_functions;
|
||||
newCmd->function = function;
|
||||
newCmd->name = utils::memory::duplicate_string(name);
|
||||
|
||||
*cmd_functions = newCmd;
|
||||
}
|
||||
|
||||
// restored
|
||||
const char** FS_ListFiles(const char* path, const char* extension, FsListBehavior_e behavior, int* numfiles)
|
||||
{
|
||||
return FS_ListFilteredFiles(*fs_searchpaths, path, extension, nullptr, behavior, numfiles);
|
||||
}
|
||||
|
||||
// restored
|
||||
void FS_FreeFileList(const char** list)
|
||||
{
|
||||
if ( list )
|
||||
{
|
||||
Hunk_UserDestroy((HunkUser*)*(list - 1));
|
||||
}
|
||||
}
|
||||
|
||||
// restored
|
||||
void Sys_EnterCriticalSection(CriticalSection critSect)
|
||||
{
|
||||
EnterCriticalSection(&s_criticalSection[critSect]);
|
||||
}
|
||||
|
||||
// restored
|
||||
void Sys_LeaveCriticalSection(CriticalSection critSect)
|
||||
{
|
||||
LeaveCriticalSection(&s_criticalSection[critSect]);
|
||||
}
|
||||
|
||||
namespace plutonium
|
||||
{
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define ARRAY_COUNT(arrayn) \
|
||||
((sizeof(arrayn)) / (sizeof(arrayn[0])))
|
||||
|
||||
|
||||
namespace game
|
||||
{
|
||||
enum gamemode
|
||||
|
||||
+219
-117
@@ -62,7 +62,7 @@ namespace game
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#include "clientscript_public.hpp"
|
||||
#include "clientscript/clientscript_public.hpp"
|
||||
|
||||
namespace game
|
||||
{
|
||||
@@ -3604,17 +3604,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(TLSData_t, field_38, 0x38);
|
||||
ASSERT_STRUCT_OFFSET(TLSData_t, field_3C, 0x3C);
|
||||
|
||||
struct XZoneInfo
|
||||
{
|
||||
char * name; //OFS: 0x0 SIZE: 0x4
|
||||
int allocFlags; //OFS: 0x4 SIZE: 0x4
|
||||
int freeFlags; //OFS: 0x8 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(XZoneInfo, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, name, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, allocFlags, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, freeFlags, 0x8);
|
||||
|
||||
union DvarValue
|
||||
{
|
||||
bool enabled; //OFS: 0x0 SIZE: 0x1
|
||||
@@ -6962,25 +6951,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(pointtrace_t, bLocational, 0x38);
|
||||
ASSERT_STRUCT_OFFSET(pointtrace_t, priorityMap, 0x3C);
|
||||
|
||||
struct field_t
|
||||
{
|
||||
int cursor; //OFS: 0x0 SIZE: 0x4
|
||||
int scroll; //OFS: 0x4 SIZE: 0x4
|
||||
int drawWidth; //OFS: 0x8 SIZE: 0x4
|
||||
int widthInPixels; //OFS: 0xC SIZE: 0x4
|
||||
float charHeight; //OFS: 0x10 SIZE: 0x4
|
||||
int fixedSize; //OFS: 0x14 SIZE: 0x4
|
||||
char buffer[256]; //OFS: 0x18 SIZE: 0x100
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(field_t, 0x118);
|
||||
ASSERT_STRUCT_OFFSET(field_t, cursor, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(field_t, scroll, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(field_t, drawWidth, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(field_t, widthInPixels, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(field_t, charHeight, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(field_t, fixedSize, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(field_t, buffer, 0x18);
|
||||
|
||||
struct entityHandler_t
|
||||
{
|
||||
void (__cdecl *think)(gentity_s *); //OFS: 0x0 SIZE: 0x4
|
||||
@@ -7008,31 +6978,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(entityHandler_t, methodOfDeath, 0x24);
|
||||
ASSERT_STRUCT_OFFSET(entityHandler_t, splashMethodOfDeath, 0x28);
|
||||
|
||||
struct yy_buffer_state
|
||||
{
|
||||
_iobuf * yy_input_file; //OFS: 0x0 SIZE: 0x4
|
||||
char * yy_ch_buf; //OFS: 0x4 SIZE: 0x4
|
||||
char * yy_buf_pos; //OFS: 0x8 SIZE: 0x4
|
||||
unsigned int yy_buf_size; //OFS: 0xC SIZE: 0x4
|
||||
int yy_n_chars; //OFS: 0x10 SIZE: 0x4
|
||||
int yy_is_our_buffer; //OFS: 0x14 SIZE: 0x4
|
||||
int yy_is_interactive; //OFS: 0x18 SIZE: 0x4
|
||||
int yy_at_bol; //OFS: 0x1C SIZE: 0x4
|
||||
int yy_fill_buffer; //OFS: 0x20 SIZE: 0x4
|
||||
int yy_buffer_status; //OFS: 0x24 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(yy_buffer_state, 0x28);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_input_file, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_ch_buf, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buf_pos, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buf_size, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_n_chars, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_is_our_buffer, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_is_interactive, 0x18);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_at_bol, 0x1C);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_fill_buffer, 0x20);
|
||||
ASSERT_STRUCT_OFFSET(yy_buffer_state, yy_buffer_status, 0x24);
|
||||
|
||||
struct CmdArgsPrivate
|
||||
{
|
||||
char textPool[8192]; //OFS: 0x0 SIZE: 0x2000
|
||||
@@ -7147,19 +7092,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(CmdText, maxsize, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(CmdText, cmdsize, 0x8);
|
||||
|
||||
struct Console
|
||||
{
|
||||
_BYTE gap_0[66120]; //OFS: 0x0 SIZE: 0x10248
|
||||
char outputVisible; //OFS: 0x10248 SIZE: 0x1
|
||||
_BYTE gap_10249[18563]; //OFS: 0x10249 SIZE: 0x4883
|
||||
int field_14ACC; //OFS: 0x14ACC SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(Console, 0x14AD0);
|
||||
ASSERT_STRUCT_OFFSET(Console, gap_0, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(Console, outputVisible, 0x10248);
|
||||
ASSERT_STRUCT_OFFSET(Console, gap_10249, 0x10249);
|
||||
ASSERT_STRUCT_OFFSET(Console, field_14ACC, 0x14ACC);
|
||||
|
||||
struct vehicle_field_s
|
||||
{
|
||||
const char * name; //OFS: 0x0 SIZE: 0x4
|
||||
@@ -7217,24 +7149,172 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(KeyState, binding, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(KeyState, binding_2, 0xC);
|
||||
|
||||
struct field_t
|
||||
{
|
||||
int cursor; //OFS: 0x0 SIZE: 0x4
|
||||
int scroll; //OFS: 0x4 SIZE: 0x4
|
||||
int drawWidth; //OFS: 0x8 SIZE: 0x4
|
||||
int widthInPixels; //OFS: 0xC SIZE: 0x4
|
||||
float charHeight; //OFS: 0x10 SIZE: 0x4
|
||||
int fixedSize; //OFS: 0x14 SIZE: 0x4
|
||||
char buffer[256]; //OFS: 0x18 SIZE: 0x100
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(field_t, 0x118);
|
||||
ASSERT_STRUCT_OFFSET(field_t, cursor, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(field_t, scroll, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(field_t, drawWidth, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(field_t, widthInPixels, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(field_t, charHeight, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(field_t, fixedSize, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(field_t, buffer, 0x18);
|
||||
|
||||
struct PlayerKeyState
|
||||
{
|
||||
int chat_team; //OFS: 0x0 SIZE: 0x4
|
||||
_BYTE gap_4[4]; //OFS: 0x4 SIZE: 0x4
|
||||
int anyKeyDown; //OFS: 0x8 SIZE: 0x4
|
||||
KeyState keys[256]; //OFS: 0xC SIZE: 0x1000
|
||||
LocSelInputState locSelInputState; //OFS: 0x100C SIZE: 0x4
|
||||
field_t chatField; //OFS: 0x0 SIZE: 0x118
|
||||
int chat_team; //OFS: 0x118 SIZE: 0x4
|
||||
int overstrikeMode; //OFS: 0x11C SIZE: 0x4
|
||||
int anyKeyDown; //OFS: 0x120 SIZE: 0x4
|
||||
KeyState keys[256]; //OFS: 0x124 SIZE: 0x1000
|
||||
LocSelInputState locSelInputState; //OFS: 0x1124 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(PlayerKeyState, 0x1010);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, chat_team, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, gap_4, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, anyKeyDown, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, keys, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, locSelInputState, 0x100C);
|
||||
ASSERT_STRUCT_SIZE(PlayerKeyState, 0x1128);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, chatField, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, chat_team, 0x118);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, overstrikeMode, 0x11C);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, anyKeyDown, 0x120);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, keys, 0x124);
|
||||
ASSERT_STRUCT_OFFSET(PlayerKeyState, locSelInputState, 0x1124);
|
||||
|
||||
struct MessageLine
|
||||
{
|
||||
int messageIndex; //OFS: 0x0 SIZE: 0x4
|
||||
int textBufPos; //OFS: 0x4 SIZE: 0x4
|
||||
int textBufSize; //OFS: 0x8 SIZE: 0x4
|
||||
int typingStartTime; //OFS: 0xC SIZE: 0x4
|
||||
int lastTypingSoundTime; //OFS: 0x10 SIZE: 0x4
|
||||
int flags; //OFS: 0x14 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(MessageLine, 0x18);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, messageIndex, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, textBufPos, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, textBufSize, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, typingStartTime, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, lastTypingSoundTime, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(MessageLine, flags, 0x14);
|
||||
|
||||
struct Message
|
||||
{
|
||||
int startTime; //OFS: 0x0 SIZE: 0x4
|
||||
int endTime; //OFS: 0x4 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(Message, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(Message, startTime, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(Message, endTime, 0x4);
|
||||
|
||||
struct MessageWindow
|
||||
{
|
||||
MessageLine* lines; //OFS: 0x0 SIZE: 0x4
|
||||
Message* messages; //OFS: 0x4 SIZE: 0x4
|
||||
char* circularTextBuffer; //OFS: 0x8 SIZE: 0x4
|
||||
int textBufSize; //OFS: 0xC SIZE: 0x4
|
||||
int lineCount; //OFS: 0x10 SIZE: 0x4
|
||||
int padding; //OFS: 0x14 SIZE: 0x4
|
||||
int scrollTime; //OFS: 0x18 SIZE: 0x4
|
||||
int fadeIn; //OFS: 0x1C SIZE: 0x4
|
||||
int fadeOut; //OFS: 0x20 SIZE: 0x4
|
||||
int textBufPos; //OFS: 0x24 SIZE: 0x4
|
||||
int firstLineIndex; //OFS: 0x28 SIZE: 0x4
|
||||
int activeLineCount; //OFS: 0x2C SIZE: 0x4
|
||||
int messageIndex; //OFS: 0x30 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(MessageWindow, 0x34);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, lines, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, messages, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, circularTextBuffer, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, textBufSize, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, lineCount, 0x10);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, padding, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, scrollTime, 0x18);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, fadeIn, 0x1C);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, fadeOut, 0x20);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, textBufPos, 0x24);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, firstLineIndex, 0x28);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, activeLineCount, 0x2C);
|
||||
ASSERT_STRUCT_OFFSET(MessageWindow, messageIndex, 0x30);
|
||||
|
||||
struct MessageBuffer
|
||||
{
|
||||
char gamemsgText[4][2048]; //OFS: 0x0 SIZE: 0x2000
|
||||
MessageWindow gamemsgWindows[4]; //OFS: 0x2000 SIZE: 0xD0
|
||||
MessageLine gamemsgLines[4][12]; //OFS: 0x20D0 SIZE: 0x480
|
||||
Message gamemsgMessages[4][12]; //OFS: 0x2550 SIZE: 0x180
|
||||
char miniconText[4096]; //OFS: 0x26D0 SIZE: 0x1000
|
||||
MessageWindow miniconWindow; //OFS: 0x36D0 SIZE: 0x34
|
||||
MessageLine miniconLines[100]; //OFS: 0x3704 SIZE: 0x960
|
||||
Message miniconMessages[100]; //OFS: 0x4064 SIZE: 0x320
|
||||
char errorText[1024]; //OFS: 0x4384 SIZE: 0x400
|
||||
MessageWindow errorWindow; //OFS: 0x4784 SIZE: 0x34
|
||||
MessageLine errorLines[5]; //OFS: 0x47B8 SIZE: 0x78
|
||||
Message errorMessages[5]; //OFS: 0x4830 SIZE: 0x28
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(MessageBuffer, 0x4858);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, gamemsgText, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, gamemsgWindows, 0x2000);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, gamemsgLines, 0x20D0);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, gamemsgMessages, 0x2550);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, miniconText, 0x26D0);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, miniconWindow, 0x36D0);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, miniconLines, 0x3704);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, miniconMessages, 0x4064);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, errorText, 0x4384);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, errorWindow, 0x4784);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, errorLines, 0x47B8);
|
||||
ASSERT_STRUCT_OFFSET(MessageBuffer, errorMessages, 0x4830);
|
||||
|
||||
struct Console
|
||||
{
|
||||
dvar_s* outputWindowColor; //OFS: 0x0 SIZE: 0x4
|
||||
int initialized; //OFS: 0x4 SIZE: 0x4
|
||||
MessageWindow consoleWindow; //OFS: 0x8 SIZE: 0x34
|
||||
MessageLine consoleLines[1024]; //OFS: 0x3C SIZE: 0x6000
|
||||
Message consoleMessages[1024]; //OFS: 0x603C SIZE: 0x2000
|
||||
char consoleText[32768]; //OFS: 0x803C SIZE: 0x8000
|
||||
char textTempLine[512]; //OFS: 0x1003C SIZE: 0x200
|
||||
unsigned int lineOffset; //OFS: 0x1023C SIZE: 0x4
|
||||
int displayLineOffset; //OFS: 0x10240 SIZE: 0x4
|
||||
int prevChannel; //OFS: 0x10244 SIZE: 0x4
|
||||
char outputVisible; //OFS: 0x10248 SIZE: 0x1
|
||||
int fontHeight; //OFS: 0x1024C SIZE: 0x4
|
||||
int visibleLineCount; //OFS: 0x10250 SIZE: 0x4
|
||||
int visiblePixelWidth; //OFS: 0x10254 SIZE: 0x4
|
||||
float screenMin[2]; //OFS: 0x10258 SIZE: 0x8
|
||||
float screenMax[2]; //OFS: 0x10260 SIZE: 0x8
|
||||
MessageBuffer messageBuffer[1]; //OFS: 0x10268 SIZE: 0x4858
|
||||
float color[4]; //OFS: 0x14AC0 SIZE: 0x10
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(Console, 0x14AD0);
|
||||
ASSERT_STRUCT_OFFSET(Console, outputWindowColor, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(Console, initialized, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(Console, consoleWindow, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(Console, consoleLines, 0x3C);
|
||||
ASSERT_STRUCT_OFFSET(Console, consoleMessages, 0x603C);
|
||||
ASSERT_STRUCT_OFFSET(Console, consoleText, 0x803C);
|
||||
ASSERT_STRUCT_OFFSET(Console, textTempLine, 0x1003C);
|
||||
ASSERT_STRUCT_OFFSET(Console, lineOffset, 0x1023C);
|
||||
ASSERT_STRUCT_OFFSET(Console, displayLineOffset, 0x10240);
|
||||
ASSERT_STRUCT_OFFSET(Console, prevChannel, 0x10244);
|
||||
ASSERT_STRUCT_OFFSET(Console, outputVisible, 0x10248);
|
||||
ASSERT_STRUCT_OFFSET(Console, fontHeight, 0x1024C);
|
||||
ASSERT_STRUCT_OFFSET(Console, visibleLineCount, 0x10250);
|
||||
ASSERT_STRUCT_OFFSET(Console, visiblePixelWidth, 0x10254);
|
||||
ASSERT_STRUCT_OFFSET(Console, screenMin, 0x10258);
|
||||
ASSERT_STRUCT_OFFSET(Console, screenMax, 0x10260);
|
||||
ASSERT_STRUCT_OFFSET(Console, messageBuffer, 0x10268);
|
||||
ASSERT_STRUCT_OFFSET(Console, color, 0x14AC0);
|
||||
|
||||
union qfile_gus
|
||||
{
|
||||
_iobuf * o; //OFS: 0x0 SIZE: 0x4
|
||||
FILE * o; //OFS: 0x0 SIZE: 0x4
|
||||
char * z; //OFS: 0x1 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(qfile_gus, 0x4);
|
||||
@@ -11255,15 +11335,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(struct_0, var_34, 0x14);
|
||||
ASSERT_STRUCT_OFFSET(struct_0, var_30, 0x18);
|
||||
|
||||
struct stype_t
|
||||
{
|
||||
sval_u val; //OFS: 0x0 SIZE: 0x4
|
||||
unsigned int pos; //OFS: 0x4 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(stype_t, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(stype_t, val, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(stype_t, pos, 0x4);
|
||||
|
||||
struct DObjModel_s
|
||||
{
|
||||
XModel * model; //OFS: 0x0 SIZE: 0x4
|
||||
@@ -11325,17 +11396,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(LargeLocal, startPos, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(LargeLocal, size, 0x4);
|
||||
|
||||
struct XFile
|
||||
{
|
||||
unsigned int size; //OFS: 0x0 SIZE: 0x4
|
||||
unsigned int externalSize; //OFS: 0x4 SIZE: 0x4
|
||||
unsigned int blockSize[8]; //OFS: 0x8 SIZE: 0x20
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(XFile, 0x28);
|
||||
ASSERT_STRUCT_OFFSET(XFile, size, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(XFile, externalSize, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(XFile, blockSize, 0x8);
|
||||
|
||||
union pointtrace_or_moveclip_u
|
||||
{
|
||||
pointtrace_t point; //OFS: 0x0 SIZE: 0x40
|
||||
@@ -12695,21 +12755,6 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(GfxCmdStretchPicRotateXY, color, 0x28);
|
||||
ASSERT_STRUCT_OFFSET(GfxCmdStretchPicRotateXY, rotation, 0x2C);
|
||||
|
||||
struct XZoneMemory
|
||||
{
|
||||
XBlock blocks[9]; //OFS: 0x0 SIZE: 0x48
|
||||
char * lockedVertexData; //OFS: 0x48 SIZE: 0x4
|
||||
char * lockedIndexData; //OFS: 0x4C SIZE: 0x4
|
||||
void * vertexBuffer; //OFS: 0x50 SIZE: 0x4
|
||||
void * indexBuffer; //OFS: 0x54 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(XZoneMemory, 0x58);
|
||||
ASSERT_STRUCT_OFFSET(XZoneMemory, blocks, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(XZoneMemory, lockedVertexData, 0x48);
|
||||
ASSERT_STRUCT_OFFSET(XZoneMemory, lockedIndexData, 0x4C);
|
||||
ASSERT_STRUCT_OFFSET(XZoneMemory, vertexBuffer, 0x50);
|
||||
ASSERT_STRUCT_OFFSET(XZoneMemory, indexBuffer, 0x54);
|
||||
|
||||
struct SaveMemoryGlob
|
||||
{
|
||||
SaveGame * committedGameSave; //OFS: 0x0 SIZE: 0x4
|
||||
@@ -12746,7 +12791,7 @@ namespace game
|
||||
unsigned int pos_local_extrafield; //OFS: 0x48 SIZE: 0x4
|
||||
unsigned int rest_read_compressed; //OFS: 0x4C SIZE: 0x4
|
||||
unsigned int rest_read_uncompressed; //OFS: 0x50 SIZE: 0x4
|
||||
_iobuf * file; //OFS: 0x54 SIZE: 0x4
|
||||
FILE * file; //OFS: 0x54 SIZE: 0x4
|
||||
unsigned int compression_method; //OFS: 0x58 SIZE: 0x4
|
||||
unsigned int byte_before_the_zipfile; //OFS: 0x5C SIZE: 0x4
|
||||
};
|
||||
@@ -13242,7 +13287,64 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(DynEnt_FadeData, id, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(DynEnt_FadeData, startTime, 0x4);
|
||||
|
||||
struct __declspec(align(2)) GfxMetrics
|
||||
{
|
||||
unsigned __int16 cubemapShotRes;
|
||||
unsigned __int16 cubemapShotPixelBorder;
|
||||
bool hasAnisotropicMinFilter;
|
||||
bool hasAnisotropicMagFilter;
|
||||
int maxAnisotropy;
|
||||
int maxClipPlanes;
|
||||
unsigned __int8 shadowmapSamplerState;
|
||||
bool slopeScaleDepthBias;
|
||||
bool canMipCubemaps;
|
||||
};
|
||||
|
||||
// cCurve
|
||||
|
||||
struct CommonFastFileLoad
|
||||
{
|
||||
int code_post_gfx_flags;
|
||||
int patch_flags;
|
||||
int ui_flags;
|
||||
int common_flags;
|
||||
int flags5;
|
||||
int localized_common_flags;
|
||||
const char *code_post_gfx;
|
||||
const char *patch;
|
||||
const char *ui;
|
||||
const char *common;
|
||||
int filename4;
|
||||
const char *localized_common;
|
||||
const char *mod;
|
||||
};
|
||||
|
||||
struct GfxWindowParms
|
||||
{
|
||||
HWND__ *hwnd;
|
||||
int hz;
|
||||
bool fullscreen;
|
||||
int x;
|
||||
int y;
|
||||
int sceneWidth;
|
||||
int sceneHeight;
|
||||
int displayWidth;
|
||||
int displayHeight;
|
||||
int aaSamples;
|
||||
};
|
||||
|
||||
struct stream_source_info_t
|
||||
{
|
||||
char Stream;
|
||||
char Offset;
|
||||
char Type;
|
||||
};
|
||||
|
||||
struct stream_dest_info_t
|
||||
{
|
||||
char Usage;
|
||||
char UsageIndex;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+101
-3
@@ -4,14 +4,112 @@ namespace game
|
||||
{
|
||||
// Functions
|
||||
WEAK symbol<void(con_channel_e channel, const char* fmt, ...)> Com_Printf{ 0x0, 0x59A2C0 };
|
||||
WEAK symbol<void(con_channel_e a1, const char* Source, int a3)>Com_PrintMessage{ 0x0, 0x59A170 };
|
||||
WEAK symbol<void(con_channel_e a1, const char* Format, ...)>Com_PrintWarning{ 0x0, 0x59A440 };
|
||||
WEAK symbol<void(con_channel_e a1, const char* Format, ...)>Com_PrintError{ 0x0, 0x59A380 };
|
||||
WEAK symbol<void(errorParm_t a1, const char* Format, ...)>Com_Error{ 0x0, 0x59AC50 };
|
||||
WEAK symbol<void(const char* Format, ...)>Sys_Error{ 0x0, 0x5FE8C0 };
|
||||
|
||||
WEAK symbol<void(HunkUser *user)>Hunk_UserDestroy{ 0x0, 0x5E4940 };
|
||||
WEAK symbol<void *(HunkUser *user, int size, int alignment)> Hunk_UserAlloc{ 0x0, 0x5E47B0 };
|
||||
WEAK symbol<void()> Hunk_ClearTempMemoryHigh{ 0x0, 0x5E4300 };
|
||||
|
||||
WEAK symbol<int(const char* filename, int* file)>FS_FOpenFileRead{ 0x0, 0x5DBD20 };
|
||||
WEAK symbol<int(char* Buffer, size_t ElementCount, int a3)>FS_Read{ 0x0, 0x5DBDF0 };
|
||||
WEAK symbol<int(const char* filename, int* file, fsMode_t mode)>FS_FOpenFileByMode{ 0x0, 0x5DB630 };
|
||||
|
||||
WEAK symbol<const char*(const char* Format, ...)>va{ 0x0, 0x5F6D80 };
|
||||
|
||||
WEAK symbol<dvar_s*(const char* dvarName)>Dvar_FindVar{ 0x0, 0x5EDE30 };
|
||||
|
||||
WEAK symbol<parseInfo_t* (const char* ArgList)>Com_BeginParseSession{ 0x0, 0x5F5830 };
|
||||
WEAK symbol<void()> Com_EndParseSession{ 0x0, 0x5F5910 };
|
||||
WEAK symbol<int()> Sys_Milliseconds{ 0x0, 0x603D40 };
|
||||
|
||||
WEAK symbol<void(char* Destination, const char* Source, size_t Count)>I_strncpyz{ 0x0, 0x7AA9C0 };
|
||||
|
||||
WEAK symbol<_iobuf* ()>__iob_func{ 0x0, 0x7AE0DE };
|
||||
WEAK symbol<size_t(const void* Buffer, size_t ElementSize, size_t ElementCount, FILE* Stream)>_fwrite{ 0x0, 0x7ACBDA };
|
||||
WEAK symbol<int(const char* const Buffer, const char* const Format, ...)>_sscanf{ 0x0, 0x7AB559 };
|
||||
WEAK symbol<int(FILE* const Stream, const char* const Format, ...)>_fprintf{ 0x0, 0x7AE406 };
|
||||
WEAK symbol<void(int Code)>_exit{ 0x0, 0x7AC431 };
|
||||
WEAK symbol<void* (void* Block, size_t Size)>_realloc{ 0x0, 0x7AECAC };
|
||||
WEAK symbol<void* (size_t Size)>Z_TryMalloc{ 0x0, 0x7AAD36 };
|
||||
|
||||
WEAK symbol<BuiltinFunction(const char** pName)>Sentient_GetFunction{ 0x0, 0x5676F0 };
|
||||
WEAK symbol<BuiltinFunction(const char** pName, int* type_1)>BuiltIn_GetFunction{ 0x0, 0x52F0B0 };
|
||||
WEAK symbol<BuiltinFunction(const char** pName, int* type)>CScr_GetFunction{ 0x0, 0x66EA30 };
|
||||
WEAK symbol<BuiltinMethod(const char** pName, int* type)>CScr_GetMethod{ 0x0, 0x671110 };
|
||||
|
||||
inline void* I_strncmp_ADDR() { return CALL_ADDR(0x0, 0x5F6A40); }
|
||||
int I_strncmp(const char* str1, const char* str2, int len, void* call_addr = I_strncmp_ADDR());
|
||||
|
||||
inline void* Hunk_UserCreate_ADDR() { return CALL_ADDR(0x0, 0x5E46E0); }
|
||||
HunkUser* Hunk_UserCreate(signed int maxSize, const char* name, int fixed, int tempMem, int debugMem, int type, void* call_addr = Hunk_UserCreate_ADDR());
|
||||
inline void* Hunk_AllocateTempMemoryHigh_ADDR() { return CALL_ADDR(0x0, 0x5E4220); }
|
||||
unsigned int Hunk_AllocateTempMemoryHigh(int size_, void* call_addr = Hunk_AllocateTempMemoryHigh_ADDR());
|
||||
|
||||
inline void* FS_FCloseFile_ADDR() { return CALL_ADDR(0x0, 0x5DB060); }
|
||||
void FS_FCloseFile(int h, void* call_addr = FS_FCloseFile_ADDR());
|
||||
inline void* FS_ListFilteredFiles_ADDR() { return CALL_ADDR(0x0, 0x5DC720); }
|
||||
const char** FS_ListFilteredFiles(searchpath_s* searchPath, const char* path, const char* extension, const char* filter, FsListBehavior_e behavior, int* numFiles, void* call_addr = FS_ListFilteredFiles_ADDR());
|
||||
|
||||
inline void* Z_TryVirtualAlloc_ADDR() { return CALL_ADDR(0x0, 0x5E39D0); }
|
||||
void* Z_TryVirtualAlloc(signed int size_, void* call_addr = Z_TryVirtualAlloc_ADDR());
|
||||
inline void* I_stricmp_ADDR() { return CALL_ADDR(0x0, 0x5F69E0); }
|
||||
int I_stricmp(int len, const char* s0, const char* s1, void* call_addr = I_stricmp_ADDR());
|
||||
|
||||
inline void* Com_Parse_ADDR() { return CALL_ADDR(0x0, 0x5F61B0); }
|
||||
parseInfo_t* Com_Parse(const char** buffer, void* call_addr = Com_Parse_ADDR());
|
||||
|
||||
inline void* Dvar_RegisterBool_ADDR() { return CALL_ADDR(0x0, 0x5EEE20); }
|
||||
dvar_s * Dvar_RegisterBool(unsigned __int8 val, const char * name, int flags, const char * desc, void* call_addr = Dvar_RegisterBool_ADDR());
|
||||
|
||||
inline void* XAnimGetAnimDebugName_ADDR() { return CALL_ADDR(0x0, 0x60F850); }
|
||||
const char * XAnimGetAnimDebugName(unsigned int animIndex, XAnim_s * anims, void* call_addr = XAnimGetAnimDebugName_ADDR());
|
||||
|
||||
inline void* Cmd_FindCommand_ADDR() { return CALL_ADDR(0x0, 0x594DB0); }
|
||||
cmd_function_s* Cmd_FindCommand(const char* cmdName, void* call_addr = Cmd_FindCommand_ADDR());
|
||||
void Cmd_AddCommand(const char* name, void(__cdecl* function)());
|
||||
|
||||
inline void* Scr_GetMethod_ADDR() { return CALL_ADDR(0x0, 0x530630); }
|
||||
BuiltinMethod Scr_GetMethod(int* type_, const char** pName, void* call_addr = Scr_GetMethod_ADDR());
|
||||
|
||||
void Sys_EnterCriticalSection(CriticalSection critSect);
|
||||
void Sys_LeaveCriticalSection(CriticalSection critSect);
|
||||
|
||||
const char** FS_ListFiles(const char* path, const char* extension, FsListBehavior_e behavior, int* numfiles);
|
||||
void FS_FreeFileList(const char** list);
|
||||
|
||||
// Variables
|
||||
WEAK symbol<char> tempServerCommandBuf{ 0x0, 0x2FCDC00 };
|
||||
WEAK symbol<CRITICAL_SECTION> s_criticalSection{ 0x0, 0x2298D08 };
|
||||
WEAK symbol<HunkUser*> g_DebugHunkUser{ 0x0, 0x212B2EC };
|
||||
WEAK symbol<dvar_s*> useFastFile{ 0x0, 0x1F552FC };
|
||||
WEAK symbol<fileHandleData_t> fsh{ 0x0, 0x2126E20 };
|
||||
WEAK symbol<dvar_s*> fs_game{ 0x0, 0x2122B00 };
|
||||
WEAK symbol<dvar_s*> com_developer{ 0x0, 0x1F55288 };
|
||||
WEAK symbol<int> statmon_related_bool{ 0x0, 0x2122B04 };
|
||||
WEAK symbol<HunkUser*> g_allocNodeUser{ 0x0, 0x3882B20 };
|
||||
WEAK symbol<struct HunkUser *> g_user{ 0x0, 0x3882B48 };
|
||||
WEAK symbol<searchpath_s*> fs_searchpaths{ 0x0, 0x46E5044 };
|
||||
WEAK symbol<cmd_function_s*> cmd_functions{ 0x0, 0x1F416F4 };
|
||||
|
||||
namespace plutonium
|
||||
{
|
||||
WEAK symbol<int(const char* fmt, ...)> printf{0x0, 0x0};
|
||||
WEAK symbol<void(scriptInstance_t)> load_custom_script_func{0x0, 0x0};
|
||||
WEAK symbol<void(char*, game::scriptInstance_t, sval_u*)> script_preprocess{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t)> vm_execute_update_codepos{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t, game::scriptInstance_t, unsigned int*, unsigned int*)> scr_execthread_update_codepos_func{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t, unsigned int*)> scr_execentthread_update_codepos_func{ 0x0, 0x0 };
|
||||
WEAK symbol<void(game::scriptInstance_t, unsigned int*)> scr_addexecthread_update_codepos_func{ 0x0, 0x0 };
|
||||
|
||||
WEAK symbol<void(game::scriptInstance_t)> load_custom_script_func{0x0, 0x0};
|
||||
WEAK symbol<const char*(game::scriptInstance_t, unsigned int)> at_codepose_va{ 0x0, 0x0 };
|
||||
|
||||
WEAK symbol<game::BuiltinMethod(const char** name, int* type)> scr_get_method_hook{ 0x0, 0x0 };
|
||||
WEAK symbol<game::BuiltinFunction(const char** name, int* type)> scr_get_function_hook{ 0x0, 0x0 };
|
||||
WEAK symbol<game::BuiltinMethod(const char** name, int* type)> cscr_get_method_hook{ 0x0, 0x0 };
|
||||
WEAK symbol<game::BuiltinFunction(const char** name, int* type)> cscr_get_function_hook{ 0x0, 0x0 };
|
||||
|
||||
WEAK symbol<void(int scrInstance, int str_num)> store_func_codepos{ 0x0, 0x0 };
|
||||
}
|
||||
}
|
||||
|
||||
+25
-1
@@ -5318,7 +5318,8 @@ namespace game
|
||||
RawFile* rawfile; //OFS: 0x1A SIZE: 0x4
|
||||
StringTable* stringTable; //OFS: 0x1B SIZE: 0x4
|
||||
PackIndex* packIndex; //OFS: 0x1C SIZE: 0x4
|
||||
void* data; //OFS: 0x1D SIZE: 0x4
|
||||
snd_alias_list_t* sound; //OFS: 0x1D SIZE: 0x4
|
||||
void* data; //OFS: 0x1E SIZE: 0x4
|
||||
};
|
||||
|
||||
struct XAsset
|
||||
@@ -5417,6 +5418,29 @@ namespace game
|
||||
ASSERT_STRUCT_OFFSET(XZone, allocType, 0x8);
|
||||
ASSERT_STRUCT_OFFSET(XZone, blocks, 0xC);
|
||||
|
||||
struct XFile
|
||||
{
|
||||
unsigned int size; //OFS: 0x0 SIZE: 0x4
|
||||
unsigned int externalSize; //OFS: 0x4 SIZE: 0x4
|
||||
unsigned int blockSize[7]; //OFS: 0x8 SIZE: 0x1C
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(XFile, 0x24);
|
||||
ASSERT_STRUCT_OFFSET(XFile, size, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(XFile, externalSize, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(XFile, blockSize, 0x8);
|
||||
|
||||
struct XZoneInfo
|
||||
{
|
||||
char * name; //OFS: 0x0 SIZE: 0x4
|
||||
int allocFlags; //OFS: 0x4 SIZE: 0x4
|
||||
int freeFlags; //OFS: 0x8 SIZE: 0x4
|
||||
};
|
||||
ASSERT_STRUCT_SIZE(XZoneInfo, 0xC);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, name, 0x0);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, allocFlags, 0x4);
|
||||
ASSERT_STRUCT_OFFSET(XZoneInfo, freeFlags, 0x8);
|
||||
|
||||
#ifdef __cplusplus
|
||||
WEAK symbol<XAssetHeader(XAssetType type, const char* name, bool errorIfMissing, int waitTime)>DB_FindXAssetHeader{ 0x0, 0x48DA30 };
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#include <stdinc.hpp>
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
|
||||
namespace plugin
|
||||
{
|
||||
std::uint32_t plugin::plugin_version()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char* plugin::plugin_name()
|
||||
{
|
||||
return "t4sp-server-plugin";
|
||||
}
|
||||
|
||||
bool plugin::is_game_supported(plutonium::sdk::game game)
|
||||
{
|
||||
return game == plutonium::sdk::game::t4;
|
||||
}
|
||||
|
||||
void plugin::on_startup(plutonium::sdk::iinterface* interface_ptr, plutonium::sdk::game game)
|
||||
{
|
||||
this->interface_ = interface_ptr;
|
||||
this->game_ = game;
|
||||
|
||||
if (!game::environment::t4sp())
|
||||
{
|
||||
MessageBoxA(nullptr, "Unsupported game executable. (t4sp is only supported)", "ERROR, BRO!", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
component_loader::post_unpack();
|
||||
}
|
||||
|
||||
void plugin::on_shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
plutonium::sdk::iinterface* plugin::get_interface()
|
||||
{
|
||||
return this->interface_;
|
||||
}
|
||||
|
||||
plutonium::sdk::game plugin::get_game()
|
||||
{
|
||||
return this->game_;
|
||||
}
|
||||
|
||||
plugin* get()
|
||||
{
|
||||
static plugin instance;
|
||||
return &instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <plutonium_sdk.hpp>
|
||||
|
||||
namespace plugin
|
||||
{
|
||||
class plugin : public plutonium::sdk::plugin
|
||||
{
|
||||
public:
|
||||
~plugin() = default;
|
||||
|
||||
std::uint32_t plugin_version() override;
|
||||
const char* plugin_name() override;
|
||||
|
||||
bool is_game_supported(plutonium::sdk::game game) override;
|
||||
|
||||
void on_startup(plutonium::sdk::iinterface* interface_ptr, plutonium::sdk::game game) override;
|
||||
void on_shutdown() override;
|
||||
|
||||
plutonium::sdk::iinterface* get_interface();
|
||||
plutonium::sdk::game get_game();
|
||||
|
||||
private:
|
||||
plutonium::sdk::iinterface* interface_{};
|
||||
plutonium::sdk::game game_{};
|
||||
|
||||
};
|
||||
|
||||
plugin* get();
|
||||
}
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
#pragma warning(disable: 4324)
|
||||
#pragma warning(disable: 4459)
|
||||
#pragma warning(disable: 4611)
|
||||
#pragma warning(disable: 4359)
|
||||
#pragma warning(error: 4409)
|
||||
|
||||
#define DLL_EXPORT extern "C" __declspec(dllexport)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
@@ -33,6 +36,7 @@
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
#include <Psapi.h>
|
||||
#include <timeapi.h>
|
||||
|
||||
#ifdef max
|
||||
#undef max
|
||||
@@ -55,12 +59,24 @@
|
||||
#pragma comment(lib, "urlmon.lib" )
|
||||
#pragma comment(lib, "iphlpapi.lib")
|
||||
#pragma comment(lib, "Crypt32.lib")
|
||||
#pragma comment(lib, "Winmm.lib")
|
||||
|
||||
#include "utils/hexrays_defs.h"
|
||||
#include "utils/io.hpp"
|
||||
|
||||
#undef GetObject
|
||||
|
||||
#include "game/game.hpp"
|
||||
#include "game/enums.hpp"
|
||||
#include "game/structs.hpp"
|
||||
#include "game/symbols.hpp"
|
||||
|
||||
#include "plugin.hpp"
|
||||
|
||||
std::string build_gsc_dump(game::scriptInstance_t inst);
|
||||
void push_opcode_history(game::scriptInstance_t inst, game::OpcodeVM op);
|
||||
void push_builtin_history(game::scriptInstance_t inst, int idx);
|
||||
void push_codepos_history(game::scriptInstance_t inst, const char* pos);
|
||||
void print_ast(game::scriptInstance_t inst, game::sval_u node);
|
||||
|
||||
using namespace std::literals;
|
||||
+10
-4
@@ -1,7 +1,6 @@
|
||||
#include <stdinc.hpp>
|
||||
#include "hook.hpp"
|
||||
#include "string.hpp"
|
||||
// iw6x-client
|
||||
|
||||
namespace utils::hook
|
||||
{
|
||||
@@ -98,8 +97,15 @@ namespace utils::hook
|
||||
MH_DisableHook(this->place_);
|
||||
}
|
||||
|
||||
void detour::create(void* place, void* target)
|
||||
void detour::create(void* place, void* target, bool quick)
|
||||
{
|
||||
// each detour is ~30ms to install, quick is for instances where we will NEVER need to invoke the original
|
||||
if (quick)
|
||||
{
|
||||
jump(reinterpret_cast<std::uintptr_t>(place), target);
|
||||
return;
|
||||
}
|
||||
|
||||
this->clear();
|
||||
this->place_ = place;
|
||||
|
||||
@@ -111,9 +117,9 @@ namespace utils::hook
|
||||
this->enable();
|
||||
}
|
||||
|
||||
void detour::create(const size_t place, void* target)
|
||||
void detour::create(const size_t place, void* target, bool quick)
|
||||
{
|
||||
this->create(reinterpret_cast<void*>(place), target);
|
||||
this->create(reinterpret_cast<void*>(place), target, quick);
|
||||
}
|
||||
|
||||
void detour::clear()
|
||||
|
||||
+71
-5
@@ -86,8 +86,8 @@ namespace utils::hook
|
||||
void enable() const;
|
||||
void disable() const;
|
||||
|
||||
void create(void* place, void* target);
|
||||
void create(size_t place, void* target);
|
||||
void create(void* place, void* target, bool quick = false);
|
||||
void create(size_t place, void* target, bool quick = false);
|
||||
void clear();
|
||||
|
||||
template <typename T>
|
||||
@@ -99,7 +99,25 @@ namespace utils::hook
|
||||
template <typename T, typename... Args>
|
||||
T invoke(Args... args)
|
||||
{
|
||||
return static_cast<T(*)(Args ...)>(this->get_original())(args...);
|
||||
return static_cast<T(__cdecl*)(Args ...)>(this->get_original())(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T invoke_pascal(Args... args)
|
||||
{
|
||||
return static_cast<T(__stdcall*)(Args ...)>(this->get_original())(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T invoke_this(Args... args)
|
||||
{
|
||||
return static_cast<T(__thiscall*)(Args ...)>(this->get_original())(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T invoke_fast(Args... args)
|
||||
{
|
||||
return static_cast<T(__fastcall*)(Args ...)>(this->get_original())(args...);
|
||||
}
|
||||
|
||||
[[nodiscard]] void* get_original() const;
|
||||
@@ -153,15 +171,63 @@ namespace utils::hook
|
||||
return set<T>(reinterpret_cast<void*>(place), value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static T get(void* place)
|
||||
{
|
||||
return *static_cast<T*>(place);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static T get(const size_t place)
|
||||
{
|
||||
return get<T>(reinterpret_cast<void*>(place));
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke(size_t func, Args... args)
|
||||
{
|
||||
return reinterpret_cast<T(*)(Args ...)>(func)(args...);
|
||||
return reinterpret_cast<T(__cdecl*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke(void* func, Args... args)
|
||||
{
|
||||
return static_cast<T(*)(Args ...)>(func)(args...);
|
||||
return static_cast<T(__cdecl*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_pascal(size_t func, Args... args)
|
||||
{
|
||||
return reinterpret_cast<T(__stdcall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_pascal(void* func, Args... args)
|
||||
{
|
||||
return static_cast<T(__stdcall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_this(size_t func, Args... args)
|
||||
{
|
||||
return reinterpret_cast<T(__thiscall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_this(void* func, Args... args)
|
||||
{
|
||||
return static_cast<T(__thiscall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_fast(size_t func, Args... args)
|
||||
{
|
||||
return reinterpret_cast<T(__fastcall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
static T invoke_fast(void* func, Args... args)
|
||||
{
|
||||
return static_cast<T(__fastcall*)(Args ...)>(func)(args...);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user