twain / twain-dsm

TWAIN Data Source Manager
140 stars 55 forks source link

Randomized base address and DEP disabled in VS project file #8

Open mikekaganski opened 6 years ago

mikekaganski commented 6 years ago

Visual Studio 2015 project file has RandomizedBaseAddress set to false (for all configurations), and DataExecutionPrevention set to false (for 32-bit). Can those features be enabled?

polesapart commented 4 years ago

Never tested in 32-bit, but in 64 there's some odd compatibility issues, for instance the DSM Call with DAT_IMAGENATIVEXFER returns an invalid handle. It seems to cheat on using 32-bit integers and having the high-order word fixed, which doesn't apply when ASLR & friends are in place. As for DEP, didn't test it.

zaneduffield commented 1 year ago

I ran into this issue in an application with ASLR enabled as well. Does anyone have any idea on how to fix it?

I had a go at debugging the DSM code, but as far as I could tell, the invalid handle was being assigned from within the Data Source (which I wasn't able to debug). It seems unlikely that 3 distinct sets of 64-bit scanner drivers have the same exact problem with 64-bit pointers for the DAT_IMAGENATIVEXFER operation, but I just can't see what might be wrong in the DSM code.