Lines Matching refs:img
257 u_int8_t *img;
619 if (!(img = malloc(bpb.bpbBytesPerSec)))
645 if ((n = read(fd1, img, bpb.bpbBytesPerSec)) == -1)
650 memset(img, 0, bpb.bpbBytesPerSec);
655 bsbpb = (struct bsbpb *)(img + x1);
670 bsxbpb = (struct bsxbpb *)(img + x1);
679 bsx = (struct bsx *)(img + x1);
697 bs = (struct bs *)img;
703 memcpy(img + x1, bootcode, sizeof(bootcode));
704 mk2(img + MINBPS - 2, DOSMAGIC);
710 mk4(img, 0x41615252);
711 mk4(img + MINBPS - 28, 0x61417272);
712 mk4(img + MINBPS - 24, 0xffffffff);
713 mk4(img + MINBPS - 20, bpb.bpbRootClust);
714 mk2(img + MINBPS - 2, DOSMAGIC);
719 mk1(img[0], bpb.bpbMedia);
721 mk1(img[x], fat == 32 && x % 4 == 3 ? 0x0f : 0xff);
723 de = (struct de *)img;
735 if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1)