| 119 | } |
| 120 | |
| 121 | void descriptorScanFile(descriptor_s* d, const char* path) |
| 122 | { |
| 123 | executableMetadata_s* em = &d->executableMetadata; |
| 124 | |
| 125 | // Retrieve section sizes from the executable and, if autodetection is enabled, |
| 126 | // scan it for service names (default, not ideal but whatchagonnado) |
| 127 | scannerScan(em, path, d->autodetectServices); |
| 128 | |
| 129 | if (!d->autodetectServices) |
| 130 | { |
| 131 | // Populate the metadata structure with section sizes and requested services from descriptor |
| 132 | int i, j; |
| 133 | for(i=0; i<d->numRequestedServices; i++) |
| 134 | { |
| 135 | for(j=0; j<NUM_SERVICESTHATMATTER; j++) |
| 136 | { |
| 137 | if(!strcmp(d->requestedServices[i].name, servicesThatMatter[j])) |
| 138 | { |
| 139 | em->servicesThatMatter[j] = d->requestedServices[i].priority; |
| 140 | break; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | em->scanned = true; |
| 145 | } |
| 146 | } |
no test coverage detected