Exemple #1
0
uint8_t do_aquire(uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,cuid;
	(void)ts;
	EAT(ptr,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,lv,',');
	GETU32(cuid,ptr);
	EAT(ptr,lv,')');
	return fs_aquire(inode,cuid);
}
Exemple #2
0
ulong read_file(const char * fn, uchar ** buf)
{
    ulong bl, sz;
    handle_t h;

    h = fs_aquire(fn, 0, 1);
    if (h == 0) return 0;

    sz = fs_get_size(h);
    bl = sz / 0x1000;
    if (sz % 0x1000) bl++;

    *buf = malloc(bl * 0x1000 + 1);
    fs_read(h, *buf, bl, 0);

    fs_release(h);

    return sz;
}