GithubHelp home page GithubHelp logo

Windows support about unified HOT 5 CLOSED

nwnxee avatar nwnxee commented on August 20, 2024
Windows support

from unified.

Comments (5)

Liareth avatar Liareth commented on August 20, 2024

(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.

Liareth avatar Liareth commented on August 20, 2024

(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.

Liareth avatar Liareth commented on August 20, 2024

(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.

Liareth avatar Liareth commented on August 20, 2024

Aaand ... we're back in present time. Windows support depends on four things:

  1. DWARF parsing for Linux. (@Liareth)
  2. PDB parsing for Windows. (@mtijanic)
  3. API generator that takes info from both of these and produces a new API. (@Liareth)
  4. 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.

mtijanic avatar mtijanic commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.