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