Delphi_MemoryModule icon indicating copy to clipboard operation
Delphi_MemoryModule copied to clipboard

Application crash with 64bit

Open vfbler opened this issue 7 years ago • 3 comments

I have a valid DLL as 32bit version and 64bit version (LoadLibrary works). Your code works perfect with the 32bit DLL, but when I try to load the 64bit DLL, my application completely crashes when executing

successfull := DllEntry(HINST(code), DLL_PROCESS_ATTACH, nil);

Tested with XE2 and 10.2.

vfbler avatar Nov 24 '18 23:11 vfbler

Hi! Could you please try with version from dev branch?

Fr0sT-Brutal avatar Nov 29 '18 14:11 Fr0sT-Brutal

Thank you for your response. I've tried dev, unfortunately the same error occured. But when I deactivate the code lines after "if Module.IsDLL then ..." (which is "true" for my 64bit-DLL) and directly execute

@Module.ExeEntry := Pointer(PByte(Code) + Module.Headers.OptionalHeader.AddressOfEntryPoint)

it works!

vfbler avatar Nov 29 '18 14:11 vfbler

Probably this is your issue. You don't have to execute the ExeEntry line just comment out DllEntry(...) one. But keep in mind that your DLL could have something important in DLL_PROCESS_ATTACH section so you could face troubles sooner or later.

Fr0sT-Brutal avatar Nov 29 '18 16:11 Fr0sT-Brutal