import java.io.FileInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class LsZip {
public static void main(String[] args) throws Exception {
byte[] zipBytes = ...;
ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(zipBytes));
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
// здесь делайте то, что вам требуется с entry.getName()
}
}
}
$ cat kernel.lds
SECTIONS {
.text 0x7e00:
{
*(.text)
}
/DISCARD/ :
{
*(*)
}
}
$ ld -e kmain -T kernel.lds test.o --oformat=binary -o kernel-lds.bin
$ hexdump -Cv kernel-lds.bin
00000000 55 48 89 e5 b8 01 00 00 00 5d c3 |UH.......].|
0000000b