用户登录
|忘记密码

新用户注册

登录

其他登陆



SKSE插件的地址库

作者:meh321
发布:LUOHUISHU98
发布日期:2020-02-08 13:59:18
更新时间:2020-02-08 13:59:18
头像
985
397 人收藏
1993 次下载
7457 次浏览
1.0
上古卷轴5:重置版
本地下载 高速下载 需要优先下载下载器,50%提速

描述


注意!这是DLL插件作者的重要资源!除非已明确告知您需要它,否则所有这些对您都将毫无用处!不要认可或考虑这个mod。


对于普通的mod用户:您可以从“文件”部分下载特定版本的偏移数据库。选择与您使用的游戏版本相匹配的版本。该文件应该在这样的路径中:

数据/ SKSE /插件/db-*-*-*-*.bin

您无需阅读其余所有内容。


对于SKSE DLL插件作者:

这是一个modder资源(头文件)。您可以加载一个存储偏移量的数据库,以便您的DLL插件可以独立于版本而无需重新编译。



如何使用


最快的方法:

剧透:表演


现在您想知道那里的“ 123”值是多少。这是地址的ID。不同版本的数据库的地址具有相同的ID,但它可能指向不同的值。要获取特定版本的所有ID和值对的列表,请执行以下操作:


剧透:表演


而不是1、5、62、0会放入您要反转和熟悉的版本。您必须首先在/ Data / SKSE / Plugins目录中具有相应的数据库文件。


调用此名称后,您应在Skyrim主目录中拥有一个名为“ offsets-1.5.62.0.txt”的新文件,或输入为文件名的任何文件。它将采用以下格式:

十进制ID <tab>十六进制偏移量<newline>


例如,如果您要使版本独立于1.5.62.0中的地址142F4DEF8(玩家角色静态指针),则可以这样做:

1.在偏移文件中查找2F4DEF8。因为这是没有基数的偏移量140000000

2.确认ID为517014(十进制!)

3.如果要在运行时在DLL中使用此地址,请执行以下操作:



void * addressOf142F4DEF8 = db.FindAddressById(517014);



那里有。


VersionDb结构具有以下功能:

剧透:表演


您应该了解并牢记的事项:


1.您可以在插件中包含任何(或所有)数据库文件,但可能会大大增加文件大小(大约2.5 mb)。我建议仅包括最新版本(在撰写本文时为1.5.97.0),如果用户需要旧版本,则可以将其指向此处,并让他们自己下载特定版本的数据库。虽然我没有问题,但是您是否决定将所有数据库版本都包含在插件中,甚至可以将它们上传到其他站点。


2.您应该始终在启动时仅加载一次数据库,初始化/缓存所需的地址,然后将其卸载。卸载只是意味着VersionDb结构被删除或丢失(如果在堆栈上分配)。这样可以确保您在游戏运行时不会浪费不必要的内存。无需在游戏过程中保持数据库加载。


3.数据库包含函数,全局变量,RTTI,vtables以及可能引用它的任何其他内容的地址。它不包含位于函数中间或全局变量中间的地址。如果在函数中间需要一个地址,则应查找函数基地址并自己添加额外的偏移量。


4.您应始终检查结果,以确保数据库已成功加载(bool Load返回true),并且所查询的地址实际上返回了有效结果(非NULL)。如果确实无法加载,则表示文件很可能丢失。如果查询失败,则意味着在该版本中找不到该地址。这可能意味着游戏代码已更改得足够多,以致该地址对该版本不再有效,或者数据库本身未能检测到正确的地址。如果发生上述任何一种情况,都应该使插件初始化失败,以使SKSE知道您未正确加载。或手动显示错误消息。


5.最好在发布DLL插件之前检查并确保地址在所有版本的游戏中都存在。为此,加载数据库文件的每个版本,并在每个版本中查询相同的地址ID以确保其存在:

剧透:表演


这样,您可以确保DLL mod可以在所有版本中使用,或者如果它在某些版本中不可用,则可以在mod页面上编写该文件。


6.有时您需要根据运行的游戏版本执行其他操作。您可以使用以下代码段进行操作:

剧透:表演


7.请记住:如果以调试方式编译SKSE DLL,则数据库的加载时间可能约为14秒!在释放模式下,此时间约为0.2秒。



权限


做你想做的。您可以根据需要在数据库中包含数据库文件,因此无需将其标记为依赖项。您可以将包括数据库文件在内的mod上载到其他站点。无需信用。

————————————————————————————————

Description

ATTENTION! This is a modder resource for DLL plugin authors! Unless you've been specifically told you need it, then all of this will be useless to you! Don't endorse or think about this mod.

For regular mod users: you can download a specific version of the offset database from the files section. Pick the one that matches the game version you are using. The file should go in a path like this:
Data/SKSE/Plugins/db-*-*-*-*.bin
There is no need for you to read the rest of any of this.

For SKSE DLL plugin authors:
This is a modder resource (a header file). You can load a database that stores offsets so your DLL plugin can be version independent without requiring to be recompiled.


How to use

The quickest way:

Spoiler:  

Show



Now you're wondering what is that "123" value there. This is the ID of an address. Different version databases will have the same ID for an address but it may point to different values. To get a list of all ID and value pair for a specific version do this:

Spoiler:  

Show



Instead of 1, 5, 62, 0 put the version you are reversing and familiar with. You must have the corresponding database file in /Data/SKSE/Plugins directory first.

After you call this you should have a new file in the main Skyrim directory called "offsets-1.5.62.0.txt" or whatever you put as the file name. It will be in the format where each line is:
Decimal ID<tab>Hex Offset<newline>

For example if you have an address 142F4DEF8 (player character static pointer) in 1.5.62.0 that you want to make version independent you would do this:
1. Look up 2F4DEF8 in the offsets file. Because this is the offset without the base 140000000
2. See that the ID is 517014 (decimal!)
3. If you want this address in your DLL at runtime do this:


void* addressOf142F4DEF8 = db.FindAddressById(517014);


And there you have it.

The VersionDb struct has the following functions:

Spoiler:  

Show



Things you should know and keep in mind:

1. You can include any (or all) of the database files with your plugin but it may increase the file size considerably (by around 2.5 mb). I would recommend to include only the latest version (which was 1.5.97.0 at the time of writing this), and if users need older version you can point them here and let them download a specific version database themself. Although I have no issues if you do decide to include all database versions with your plugin or even upload them to other sites.

2. You should ALWAYS only load database once at startup, initialize/cache the addresses you need and let it unload. Unloading just means the VersionDb struct gets deleted or lost (if you allocated on stack). This will make sure you don't use unnecessary amount of memory during game runtime. There's no need to keep the database loaded during gameplay.

3. The database contains addresses of functions, global variables, RTTI, vtables, and anything else that may have a reference to it. It does not contain addresses that are in the middle of functions or middle of globals. If you need an address in the middle of the function you should look up the function base address and add the extra offset yourself.

4. You should always check the result to make sure the database loaded successfully (bool Load returned true) and that the addresses queried actually returned a valid result (not NULL). If it does fail to load it means the file was missing most likely. If the query fails it means the address could not be found in that version. This could mean either the game code changed enough that the address is no longer at all valid for that version OR the database itself failed to detect the correct address. If either of those things happen you should fail the plugin initialization to let SKSE know you did not load correctly. Or manually show an error message.

5. It would also be best if you checked to make sure the address exists in all versions of the game before publishing your DLL plugin. To do that load each version of the database file and query the same address ID in each of them to make sure it exists:

Spoiler:  

Show



This way you can be sure your DLL mod will work in all versions, or if it does not work in some versions you can write that on your mod page.

6. Sometimes you'll need to do something different based on running game version. You can do that with this code snippet:

Spoiler:  

Show



7. Please keep in mind: if you compile your SKSE DLL in debug mode the load time of database can be around 14 seconds! In release mode this is around 0.2 seconds.


Permissions

Do whatever you want. You can include the database files with your mod if you wish so you don't need to mark this as a dependency. You can upload your mod including the database files to other sites. No credit is necessary.


原贴地址
1.版本号: 1.0   更新时间: 2020-02-08 14:03:52

选择快速回复类型:
  • 感谢
  • 支持
  • 疑问
  • 卖萌
  • 关心
  • 傲娇
评论


    作者精品
    logo

    SKSE插件的地址库


    Mod大小:2.11KB
    上传时间:2020-02-08 13:59:18

    Mod简介:

    暂无更多介绍

    本地下载
    选择快速回复类型:
    • 感谢
    • 支持
    • 疑问
    • 卖萌
    • 关心
    • 傲娇
    回复

    closeAD