Rob-- / memoryjs

Read and write process memory in Node.js (Windows API functions exposed via Node bindings)
MIT License
632 stars 86 forks source link

Little Endian Support #91

Closed ThomasJRyan closed 2 years ago

ThomasJRyan commented 2 years ago

I'm not sure if this is even possible given the underlying architecture, but I was wondering if there is any chance of support for little endian reading and writing of memory? I feel like for it to be feasible there would need to be an extra layer written on top to convert the existing big endian memory into little endian

Rob-- commented 2 years ago

e13970fc2c31bc7b97133607c525cd5fe1fec86b adds support for reading/writing big-endian.

Added the following data types:

When one of these types is specified, the library will do one of the following:

For memoryjs.INT64_BE and memoryjs.UINT64_BE types, a BigInt needs to be passed or an error will be thrown. At some point I will also require the little endian types (memoryjs.INT64, memoryjs.UINT64) to be of type BigInt too.

This change probably won't be published to NPM for a while (need to add/overhaul testing), so I'll leave the issue open for a bit and close it if there are no further comments.

ThomasJRyan commented 2 years ago

Holy. Did not expect this to actually get addressed. Huge thanks Rob!

Rob-- commented 2 years ago

No problem @ThomasJRyan , thanks for the feature request!