flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 03 May 2007, 22:46
section structure seems to have only 20h bytes, so there is no offset 24h.
Code: mov ebx,[free_additional_memory] lea eax,[ebx+20h] cmp eax,[structures_buffer] jae out_of_memory mov [free_additional_memory],eax mov [current_section],ebx [edit]some bullshit i wrote deleted, i have mistaken 24 with 24h Last edited by vid on 03 May 2007, 23:08; edited 1 time in total |
|||
![]() |
|
rhyde 03 May 2007, 22:55
vid wrote: section structure seems to have only 20h bytes, so there is no offset 24h. Oh, clearly the structure pointed at by current_section does not match the COFF section header, I'm just wondering which fields in whatever current_section points at correspond to the fields in the COFF header structure. Cheers, Randy Hyde |
|||
![]() |
|
vid 03 May 2007, 23:10
just because i am bored, i tried to make it out of source:
Code: ;00 = low order byte is 0 to denote this is section (not relocation) ;04 = pointer to name of section (in FASM string token format) ;08 = address in generated output ;0C = size of section ;10 = alignment ;14 = bits 0:7 = format flags ; bits 8:19 = ??? may be also flags, depends on "format_flags" bit 0 ; bits 20:31 = alignment (0 to 13) ;rest seems unused |
|||
![]() |
|
rhyde 04 May 2007, 16:39
vid wrote: just because i am bored, i tried to make it out of source: Hmmm... My reading of the source code led me to believe the following: 08 = COFF optional SizeOfInitializedData field 0C = COFF optional header SizeOfUninitializedData field 14 = COFF section header Characteristics field I'm looking at the close_coff code section, in particular. Of course, I've also noticed that current_section points at what appears to be different data types depending on the output format. Cheers, Randy Hyde |
|||
![]() |
|
vid 04 May 2007, 21:32
Quote: Hmmm... yeah, that is most possibly right too, except 08: Code: coff_section: ;... mov [ebx+8], edi ;where edi is current code pointer Code: close_coff_section: mov ebx,[current_section] mov eax,edi mov edx,[ebx+8] sub eax,edx mov [ebx+0Ch],eax also check code around "find_section", where actual COFF headers are filled. Quote: Of course, I've also noticed that current_section points at what appears to be different data types depending on the output format. yeah, that is true too. It's just using of same variable for 2 different purposes, when they cannot collide. |
|||
![]() |
|
rhyde 04 May 2007, 23:53
vid wrote:
Yeah, that makes more sense. Quote:
Yeah, that code sequence helps a lot. Thanks, Randy Hyde |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.