Comments (5)
(comment copied from GitLab, dates are incorrect)
There are still a whole bunch of issues, but (for now), I've lost the desire to fix them.
- ASLR fucks things up. You can bypass this by tweaking with the DllCharacteristics flags in CFF explorer.
- GetString handler segfaults. Debugger shows that the parameter is garbage. Inserting a second string shows the correct data. IDA decompiler things there are two arguments. There should be only one, but I guess the compiler is fucking things up? Either way, this makes the outlook on one-plugin-two-platforms look very grim. We should consider just having "Windows" and "Linux" folders under Plugins, and enforcing that only the core require cross-platform. Calling the original function also breaks, complaining about mis-matched stack, so I'm guessing the Windows compiler optimized this function to pass in the string length and string on the stack, rather than a pointer, or something weird like that.
- Services::ThreadLocalTimeScope asserts when iterating over the thread local string stack. Because of the difference in how DLLs are handled on Windows this wouldn't even work cross-platform anyway, but I don't understand whyyyy it's breaking.
Even if we get past those issues in a reasonable way:
- Windows symbols have no type info.
- This means we have to borrow Linux type info, which, right now, is all manner of fucked up, with ((aligned)) and ((packed) all over the place. This also means that, even if we get real awesome Linux info that isn't IDA exported, we still can't guarantee that the structs will line up correctly.
All-in-all, it's looking like Windows is shaping up to very much be the "wild west" in terms of API. The core works fine and is completely cross-platform, but interfacing with the Windows server is proving difficult.
from unified.
(comment copied from GitLab, dates are incorrect)
Going to do a little more work on this. Not windows support directly, but:
- Exclusive hooks go to an exclusive hook handler first. This hook will be automatically decorated with the correct calling convention style for the platform. YES, this is slightly slower (one extra stack frame constructed and dropped), but this is very, very, very minimal.
- Hooks will be requested like this: RequestExclusiveHook<address, convention, ret, params>(fn)
- If convention isn't present, it will default to thiscall.
- Shared handlers will be updated to work with this system also.
This removes the need for the weird macros scattered throughout the code. All you need to do is, RequestExclusiveHook<address, CallingConvention::ThisCall>, and magic happens automatically.
from unified.
(comment copied from GitLab, dates are incorrect)
I've done this now, so now all the ugly cross-platform hook landing macros are contained within HooksImpl.hpp.
I'm going to drop this task as being assigned to me for now. I'm still going to code with both platforms in mind but I'm not going to actively develop for Windows until all of the high priority stuff is out of the way (plugins, Arelith-specific stuff, etc).
from unified.
Aaand ... we're back in present time. Windows support depends on four things:
- DWARF parsing for Linux. (@Liareth)
- PDB parsing for Windows. (@mtijanic)
- API generator that takes info from both of these and produces a new API. (@Liareth)
- Fixes to NWNX core to make it work on Windows. (@mtijanic)
See https://github.com/nwnxee/unified-apigen for progress on 1, 2, and 3.
from unified.
Closing this as WNF. We'll support running on Windows via docker or via WSL/WSL2. We won't support the nwserver.exe binary though.
(building on windows is also a possibility, but a separate issue altogether)
from unified.
Related Issues (20)
- NWNX_TWEAKS_* issue on .35 server HOT 13
- Segmentation fault related to AI / Henchman
- NWNXLib::API::Constants::SavingThrowType is missing a a value for "Paralysis" (=20) HOT 3
- NWNX_Events: ON_COMBAT_EXIT does not hook (Must sub to ON_COMBAT_ENTER) HOT 1
- Event on encumbered
- Event for excessive pathfinding instructions
- NWNX_Creature_SetSavingThrowModifier feature request
- Feature request: DM Chooser and Creator windows/data added to nwnx_events
- DAMAGE_TYPE_BASE_WEAPON doesn't propogate if added in ResolveDeathAttackHook HOT 2
- Add 'NWNX_Player_SetBicFileName' HOT 3
- nwnx func quastion HOT 1
- NWNX_Weapon hooks CNWSCreatureStats::GetWeaponFinesse and replaces it, so it ignores baseitem.2da values.
- 'development' folder not working with newest NWNX files? HOT 2
- FEATURE REQUEST: Text Label for NWNX_PLAYER_TIMING_BAR_CUSTOM()
- Core: _ZN7NWNXLib8Platform13GetStackTraceB5cxx11Eh
- NWNX 8193.36-9 (b12b114856) has crashed. Fatal error: Segmentation fault (11). HOT 18
- nwnx_signal_handler should print the nwscript context too
- NWNX_ON_DETECT_ENTER_* Events Get Signaled on Both Enter and Exit
- NWNX_Creature_GetSpecialAbilityCount doesn't count removed abilities (with id = -1) HOT 2
- Feature Request: Add a way to return Number of Inventory Pages a Store/Creature/Container Has
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unified.