flat assembler
Message board for the users of flat assembler.
Index
> Windows > A very simple 64-bit driver |
Author |
|
EasyCode 19 Aug 2015, 19:28
This is a very simple FASM 64-bit driver example and it is NOT DIGITALLY
SIGNED. After unzipping the attached file, please carefully read the "Readme.txt" file. WARNING: The driver DOES NOT WORK on Windows 10. I already reported that to Tomasz so that he can fix the problem.
|
|||||||||||
19 Aug 2015, 19:28 |
|
Foxxy 20 Aug 2015, 02:53
Could you edit your post/readme to reflect exactly what the driver is supposed to do? Thank you.
|
|||
20 Aug 2015, 02:53 |
|
Feryno 24 Aug 2015, 07:08
Win 10 x64 refused to load my drivers. Removing relocs helped. Luckily they contain address independent code and use RIP-relative addressing everywhere so relocs are not necessary.
|
|||
24 Aug 2015, 07:08 |
|
EasyCode 24 Aug 2015, 12:42
Hi Feryno,
Could you please tell me what you exactly mean? Maybe with a few lines of code. Thanks. Regards. |
|||
24 Aug 2015, 12:42 |
|
Feryno 25 Aug 2015, 08:01
delete or comment out this line in your asm file:
section '.reloc' fixups data readable discardable That helped me at w10 x64. I also have modified version of fasm to compile drivers, which change 1 or 2 bits in PE32+ header. If removing relocs does not help you let me know, you will need to modify then something else in driver header. |
|||
25 Aug 2015, 08:01 |
|
EasyCode 25 Aug 2015, 12:03
Hi Feryno,
Thank you very much for your help! No, removing "section '.reloc' fixups data readable discardable" does not solve the problem. The attached simple driver does not work in WIN10, while the same driver compiled with other assemblers (GOASM, MASM, POASM, etc.) works perfectly well. So I think the FASM assembler should be revised. Regards. |
|||
25 Aug 2015, 12:03 |
|
catafest 26 Aug 2015, 08:24
Can you tell me why you need to used this? :
native 5.02 at 10000H |
|||
26 Aug 2015, 08:24 |
|
EasyCode 26 Aug 2015, 10:51
Well, I don't know exactly, I saw it in some examples and I thought it was the right way to build a 64-bit driver.
I'm new to FASM. |
|||
26 Aug 2015, 10:51 |
|
Tomasz Grysztar 26 Aug 2015, 18:04
EasyCode wrote: No, removing "section '.reloc' fixups data readable discardable" does not solve the problem. The attached simple driver does not work in WIN10, while the same driver compiled with other assemblers (GOASM, MASM, POASM, etc.) works perfectly well. So I think the FASM assembler should be revised. And perhaps you may find out that there is some flag or attribute that fasm does not include as an option to set - but then you can report such problem to me and I may add some new keywords, like I did with WDM. If you don't want or need to control everything manually, then the better option for you is to use "format MS COFF" and then use a linker of your choice to generate PE file (probably the best choice would be the linker from DDK). Feryno wrote: I also have modified version of fasm to compile drivers, which change 1 or 2 bits in PE32+ header. |
|||
26 Aug 2015, 18:04 |
|
EasyCode 26 Aug 2015, 18:34
Hi Tomasz,
Thanks for you reply! I will do what you suggest and let you know the results. Just for your information, the simple driver I attached in this post only fails in the new Windows 10. It works fine on WIN7/8. Regards! |
|||
26 Aug 2015, 18:34 |
|
Feryno 27 Aug 2015, 12:31
Tomasz Grysztar wrote: Perhaps those 1 or 2 bits should become additional options for fasm's "format PE"? What are they? formats.inc Code: orignal: mov dword [edx+16h],20B002Fh ; flags and magic value modified: mov dword [edx+16h],20B002Eh ; flags and magic value orignal: mov byte [edx+5Eh+1],1 modified: mov byte [edx+5Eh+1],0 under win 10 x64 even such driver failed to load, but removing relocs section helped and then loaded OK |
|||
27 Aug 2015, 12:31 |
|
l_inc 27 Aug 2015, 12:54
Feryno
Omg, relocations again. You guys aren't fans of simple solutions. Is it just more fun to modify the compiler than to use the standard means that the compiler already provides? All you need to do is this: Code: section '.reloc' data readable discardable data fixups end data rb 4 or this: Code: section '.reloc' fixups data readable discardable if $=$$ dd 0,8 ; if there are no fixups, generate dummy entry end if The latter one is even included in the fasm examples. _________________ Faith is a superposition of knowledge and fallacy |
|||
27 Aug 2015, 12:54 |
|
EasyCode 27 Aug 2015, 17:50
Hi l_inc,
Well, the driver finally WORKS PERFECTLY WELL on WIN7, WIN8 and WIN10, just by adding the code you suggested: Code: section '.reloc' fixups data readable discardable if $=$$ dd 0,8 ; if there are no fixups, generate dummy entry end if Thank you very much for your help. Also thank you very much everybody. Please forgive my ignorance about this known issue and its solution. I attach the modified version working fine on all 64-bit Windows. Regards!
|
|||||||||||
27 Aug 2015, 17:50 |
|
Feryno 28 Aug 2015, 07:46
l_inc thank for different solution !
|
|||
28 Aug 2015, 07:46 |
|
Kevin_Zheng 02 Sep 2015, 23:20
I feel interesting for this question: why WIN10 needs one dll to add one empty relocation entry in the relocation section? WIN10 maybe change this behavior in the future?
Thanks. Kenneth Zheng _________________ Pure Assembly Language Funs |
|||
02 Sep 2015, 23:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.