fix memset, add query APIs, use shadow memory block to support pointer-shifting