machine-language

What would happen if a system executes a part of the file that is zero-padded?

為{幸葍}努か 提交于 2019-11-28 06:11:49
问题 I've seen in some posts/videos/files that they are zero-padded to look bigger than they are, or match "same file size" criteria some file system utilities have for moving files, mostly they are either prank programs, or malware. But I often wondered, what would happen if the file corrupted, and would "load" the next set of "instructions" that are in the big zero-padded space at the end of the file? Would anything happen? What's the instruction set for 0x0 ? 回答1: The decoding of 0 bytes

zero out top 32 bits of 64-bit register

痞子三分冷 提交于 2019-11-28 01:03:13
问题 Using amd64 assembly, whats the best way to zero out the top 32 bits of a 64-bit register, e.g. zero out the bits of rax that are not covered by eax? It appears that I cannot and the whole register against a 64-bit constant. 回答1: movl %eax, %eax or mov eax, eax , depending on the assembler in use. see: Intel® 64 and IA-32 Architectures - Software Developer’s Manual, Volume 1, 3.4.1.1 : General-Purpose Registers in 64-Bit Mode. 32-bit operands generate a 32-bit result, zero-extended to a 64