Let me take a general example to demonstrate my dilemma.
Say I am making a web-based project (which I am). Now I want to use some code that is used some other place already. Say I want to incorporate some flash game on my page; now the basic rules of the games will be the same, but someone must have implemented it first. Now if I want to use that game on my webpage, do I need to buy the license from somewhere, or can I do it without any issues?
Because all it will take me is to copy paste that particular code into my current project.
What to do.. and whom to contact. (Because I will never be able to find the original person who thought of the rules. :P )
This sounds as if you want to implement someone else's Flash game into your own website, and to top it off, one you wouldn't even be hosting on your own resources...
It depends on the country, but unless the game comes with a license allowing you to do this, you are likely violating copyright laws. Maybe an IP lawyer can step in and provide more detail here, but just because you can't properly contact the rights holder doesn't mean you can go ahead and use their work without permission.
In reality, given the prevalence of cheap 'disposable' Flash games, you can likely use it without any repercussion... but you would still be breaking the law (and in my book, that'd make you a d-bag).
This is simple to resolve - Ask the owner of the site first.
If they say yes, go for it. If not - don't do it.
If you really can't figure that out on your own then something is wrong. And you don't need a lawyer to tell you this either...
You can also look at it another way - a way that generally clarifies any scenario
If someone were to do what you were thinking to you - what would you think of it? Do you want someone else taking your work and passing it off/using it without payment or credit?
If you answered "sure that is ok" then most likely you would state it on your website/in your work product and it would be clear that you give license to use it. (that's what is commonly done)