]>
git.saurik.com Git - ldid.git/blob - arid.cpp
3 #include "minimal/mapping.h"
16 int main(int argc
, char *argv
[]) {
19 uint8_t *data
= reinterpret_cast<uint8_t *>(map(argv
[1], 0, _not(size_t), &size
, false));
21 uint8_t *end
= data
+ size
;
22 while (end
- data
>= sizeof(struct ar_hdr
)) {
23 struct ar_hdr
*head
= reinterpret_cast<struct ar_hdr
*>(data
);
24 memset(head
->ar_date
+ 1, ' ', sizeof(head
->ar_date
) - 1);
25 head
->ar_date
[0] = '0';
26 size_t length
= strtoul(head
->ar_size
, NULL
, 10);
27 data
+= length
+ sizeof(struct ar_hdr
);