flat assembler
Message board for the users of flat assembler.

Index > Main > new prerelease

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng 04 Nov 2003, 02:04
Hi,Privalov:
Sorry, I found that the 1.49.4 version can't build correct wdm sys format.
The complier fill the DllCharacteristics is 0 but it should be 2000h on the wdm sys format.
I checked the source and found must added the code, the result file is OK.
Code:
mov        dword [edx+14h],0E0h    ; size of optional header
   mov     dword [edx+16h],10B818Eh; flags and magic value
     mov     dword [edx+38h],1000h   ; section alignment
 mov     dword [edx+3Ch],200h    ; file alignment
    mov     word [edx+40h],1        ; OS version
        mov     eax,[image_base]
    mov     dword [edx+34h],eax
 mov     eax,[subsystem_version]
     mov     [edx+48h],eax
       mov     ax,[subsystem]
      mov     [edx+5Ch],ax
        cmp     ax,1
        jne     pe_alignment_ok
     mov     eax,20h
     mov     dword [edx+38h],eax
 mov     dword [edx+3Ch],eax
 mov     word [edx+5Eh],2000h            ;Kevin Zheng [110403]--WDM SYS Format
      pe_alignment_ok:
 mov     word [edx+1Ah],VERSION_MAJOR + VERSION_MINOR shl 8
  mov     dword [edx+60h],1000h   ; stack reserve
     mov     dword [edx+64h],1000h   ; stack commit
      mov     dword [edx+68h],10000h  ; heap reserve
      mov     dword [edx+6Ch],0       ; heap commit
       mov     dword [edx+74h],16      ; number of directories
     bsf     ecx,[edx+3Ch]
       imul    ebx,[number_of_sections],28h
        add     ebx,ebp
     dec     ebx
 shr     ebx,cl
      inc     ebx
 shl     ebx,cl
      sub     ebx,ebp
     mov     ecx,ebx
     mov     eax,[display_buffer]
        sub     eax,ecx
     cmp     edi,eax
     jae     out_of_memory
       shr     ecx,2
       xor     eax,eax
     rep     stos dword [edi]
    mov     eax,edi
     sub     eax,[code_start]
    add     eax,[stub_size]
     mov     [edx+54h],eax           ; size of headers
   bsf     ecx,[edx+38h]
       dec     eax
 shr     eax,cl
      inc     eax
 shl     eax,cl
      mov     [edx+28h],eax           ; entry point rva
   mov     [code_type],32
      or      [reloc_labels],-1
   mov     [number_of_sections],0
      lea     ebx,[edx+18h+0E0h]
  mov     [current_section],ebx
       mov     dword [ebx],'.fla'
        mov     dword [ebx+4],'t'
 mov     [ebx+14h],edi
       mov     [ebx+0Ch],eax
       mov     dword [ebx+24h],0E0000060h
  neg     eax
 add     eax,edi
     sub     eax,[edx+34h]
       mov     [org_origin],eax
    mov     [org_registers],0
   mov     [org_start],edi
     bt      [format_flags],8
    jnc     instruction_assembled
       or      dword [edx+16h],2000h
       cmp     word [edx+5Ch],1
    jne     instruction_assembled
       or      word [edx+5Eh],2000h
        jmp     instruction_assembled
      fp_to_version:
    

In the program flow, the 802 lines code should be executing. But I found that it doesn't work. why? I don't known the reason.
Thanks.
Post 04 Nov 2003, 02:04
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 04 Nov 2003, 06:51
You probably forgot to specify the DLL flag with "PE native" format.
Post 04 Nov 2003, 06:51
View user's profile Send private message Visit poster's website Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng 04 Nov 2003, 08:12
Oh,yeah. The reason is I forgot to specify the DLL flag with "PE native" format. Now it is OK.
Thanks.
And anothers, The syntax define is invalid:
Code:
FORMAT          PE NATIVE 4.0 DLL AT 10000H ON 'STUB.EXE'    


But the define is OK:

Code:
FORMAT          PE NATIVE  DLL AT 10000H ON 'STUB.EXE'    
Post 04 Nov 2003, 08:12
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 04 Nov 2003, 12:16
WFM
Post 04 Nov 2003, 12:16
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.