Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crash with 64bit #2

Open
vfbler opened this issue Nov 24, 2018 · 3 comments
Open

Application crash with 64bit #2

vfbler opened this issue Nov 24, 2018 · 3 comments

Comments

@vfbler
Copy link

vfbler commented Nov 24, 2018

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.

@Fr0sT-Brutal
Copy link
Owner

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

@vfbler
Copy link
Author

vfbler commented Nov 29, 2018

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!

@Fr0sT-Brutal
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants