LiteLDev / LegacyScriptEngine

A plugin engine for running LLSE plugins on LeviLamina
GNU General Public License v3.0
49 stars 8 forks source link

[Bug]: Native Api中使用hook会导致服务器崩溃(补上了崩溃日志) #63

Closed heyhey123-git closed 3 months ago

heyhey123-git commented 8 months ago

Describe the bug

使用native api里NativeFunction原生函数的hook方法后,当原函数被调用,服务端就会崩溃

To Reproduce

如下例,当玩家与村民等实体交互时,即原函数被调用时,服务端崩溃

let func = NativeFunction.fromSymbol("?interact@Player@@QEAA_NAEAVActor@@AEBVVec3@@@Z");
func.hook((pl, act, pos) => {
    let res = func.call(pl, act, pos);
    return res;
});

Expected behavior

不崩溃

Screenshots

No response

Platform

win10

BDS Version

1.20.62

LeviLamina Version

0.9.2

LegacyScriptEngine Version

0.4.3

Additional context

minidump_2024-03-10_11-08-04.dmp

trace_2024-03-10_11-08-04.log

WuHuiZhang6902 commented 3 months ago

据我所知ll3下的LSE没有native api了吧😂