It depends a bit on what you would like to manipulate.
If you want to change the underlying computation (multiplication of kernel and patch + bias), you would most likely have to write your own convolution (called e.g. in Convolution.cpp 3).
If you want to run some experiments first and make sure your method works correctly, I would recommend to use .unfold to create patches of your input activation, and apply your custom operations in a similar manner as your conv layer would do.
This approach would be slower than the optimized conv code, but might be good enough for your experiments.