/* Load the multi arch offsets */ void load_mapdef_dat() { FILE *stream; int i, ii, x, y, d[32]; char line[256]; if (!(stream = fopen_wrapper(ARCHDEF_FILE, "r"))) { LOG(llevBug, "Can't find file %s\n", ARCHDEF_FILE); return; } for (i = 0; i < 16; i++) { if (!fgets(line, 255, stream)) { break; } sscanf(line, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", &x, &y, &d[0],&d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9], &d[10], &d[11], &d[12], &d[13], &d[14], &d[15], &d[16], &d[17], &d[18], &d[19], &d[20], &d[21], &d[22], &d[23], &d[24], &d[25], &d[26], &d[27], &d[28], &d[29], &d[30], &d[31]); MultiArchs[i].xlen = x; MultiArchs[i].ylen = y; for (ii = 0; ii < 16; ii++) { MultiArchs[i].part[ii].xoff = d[ii * 2]; MultiArchs[i].part[ii].yoff = d[ii * 2 + 1]; } } fclose(stream); }
/// Interposes over the fopen64() function. /// @param[in] call the name of the interposed function in string form /// @param[in] next a pointer to the interposed function /// @param[in] path same as the wrapped function /// @param[in] mode same as the wrapped function /// @return same as the wrapped function /*static*/ FILE * fopen64_wrapper(const char *call, FILE *(*next)(const char *, const char *), const char *path, const char *mode) { WRAPPER_DEBUG("ENTERING fopen64_wrapper() => %p [%s ...]\n", next, path); return fopen_wrapper(call, next, path, mode); }