(val, section_alignment, file_alignment)
| 73 | |
| 74 | @lru_cache(maxsize=2048) |
| 75 | def cache_adjust_SectionAlignment(val, section_alignment, file_alignment): |
| 76 | if section_alignment < 0x1000: # page size |
| 77 | section_alignment = file_alignment |
| 78 | |
| 79 | # 0x200 is the minimum valid FileAlignment according to the documentation |
| 80 | # although ntoskrnl.exe has an alignment of 0x80 in some Windows versions |
| 81 | # |
| 82 | # elif section_alignment < 0x80: |
| 83 | # section_alignment = 0x80 |
| 84 | |
| 85 | if section_alignment and val % section_alignment: |
| 86 | return section_alignment * (int(val / section_alignment)) |
| 87 | return val |
| 88 | |
| 89 | |
| 90 | def count_zeroes(data): |
no outgoing calls
no test coverage detected