When interacting with a Solana program you essentially just send it a set of bytes and a list of Solana account addresses marked as either read-only or read-write. So if you wanted to interact with an undocumented program you would have to have examples of what accounts you would need to send it and what kind of data to send it.
Because the data sent to the program is just raw bytes, it could be rather difficult to know exactly what bytes to send and what all of the bytes mean.
In my own little Solana demo app, I use the Web3.js API ( see the code here ) to create transactions, passing the required accounts, signers, and raw binary data to the program to do what I want it to do. If if were somebody else’s program, the process would be the same, you would just have to figure out what bytes, signers and accounts are needed by that program to do what it needs to do.
You would look for transactions already on the chain that do what you want to do with that program, and then try and imitate how it uses the accounts and binary data to do whatever it’s doing.