Monday, March 18, 2024 | Toby Opferman
 

Source Code - C



The software provided on this page is without warranty and provided "as is" for personal use. The user should use caution and run this software at their own risk. Resale or commerical use of these products is not permitted. The software on this page was written as practice and is provided here only as sample programs for those who may find them useful. While I will accept comments, bug reports and suggestions the software is considered legacy and is not under any on going development or support.

Virus - The Game - Fix
Year 2014
Language C
Operating System Windows
The source and binary to play the 1997 Virus game. The recommendation is to use the busy loop and do 15ms in order for the game to be playable. Need to copy this EXE to the directory of the game. This will launch the game and fix it in memory each time, it does not modify the original game on disk.


Sudoku Solver
Year 2013
Language C
Operating System Windows
Uses multi-threading to solve Sudoku puzzles. Has been able to solve what was stated as the hardest Sudoku puzzle. It also displays the time it took to solve the puzzle, depending on the difficulty it may or may not help for it to spawn multiple threads. This does not use brute force method; it uses data and a state machine to determine the columns. It only resorts to brute force as a last resort.


Raycast Engine
Year 2006
Language C
Operating System Windows
This is an unfinished ray casting game.


Amelia's Game Source
Year 2006
Language C
Operating System Windows
This is the source to the unfinished 2D scroller game. It includes the tile engine, audio, gif decoder and GDI library as well as level editor.


VMWare DUal Monitors
Year 2005
Language C
Operating System Windows XP
I wrote an article on how to support dual monitors in a VMWare guest by allocating guest physical memory and sharing it between the display driver and a host application that would display it as a second monitor. Since Dr. Dobbs Journal is no more, they have kept the article up but removed the source.


Simple OpenGL Example
Year 2004
Language C
Operating System Windows
This is a simple OpenGL graphics example. The code was written just as an experiment to get a little bit familiar with OpenGL.


Network API
Year 2004
Language C
Operating System windows
This API was implemented to enumerate network connections in relation to processes.


Sockets API
Year 2004
Language C
Operating System Windows
This is a generic sockets API that I had written for a project that I didn't finish. I do not know if this library actually works because I do not remember if I ever tested it. Here it is anyway for you to play around with.


D3D Cube
Year 2004
Language C
Operating System Windows
This is a demo that uses Direct3D to draw a cube and will display an image on the side of the cube using D3D's texturemapping APIs. The file just needs to be named image.bmp and be in the same directory as the executable. This demo was written based on another example tutorial that was on the web.


2D Tile Engine
Year 2003
Language C
Operating System Windows
Though this source code has been written for Windows it could easily be ported to other Operating Systems. This is a generic IRC API that allows you to specify a tile map and it will allow you to move in the specified map. The library is written so that it doesn't do the drawing, instead it will call your supplied callback and it will tell you which tile to draw and where to draw it. It will also calculate if clipping should occur on the tile.


GDI Library
Year 2003
Language C
Operating System Windows
This is a generic library that allows you to easily use and create double buffers for GDI applications. There are some small weird behaviors such as implementation use of critical sections in the paints that probably aren't necessary but this is old code.


Direct X Wrapper
Year 2003
Language C
Operating System Windows
This is a simple API wrapper around Direct Draw with essentially the same interface as the GDI Library above. The goal would be to have an application be written to use either or API sets with little or no change.


Test Demo
Year 2003
Language C
Operating System Windows
This is a demo that performs various effects such as plasma, waving an image like a flag, lens effect (my own algorithm and attempt), rotating and cutting the image into pieces and finally flying the image around the screen in 3D space. This is provided here as example source code. There is also a sound library using the standard wave* APIs that can play sound in the background. There are various versions of the sources in there along with commented out code that does different effects. The images and sound can be replaced but they are included in the ZIP. If the demo is slow then there may be some changes that need to revert the speed back to a faster demo.


Cubix
Year 2002
Language C
Operating System Windows
This is a direct draw demo that draws a cube on the screen. There is nothing special about this demo except it could be used as an example since it's very simple.


API Replace
Year 2001
Language C
Operating System Windows
Simple demonstration library of replacing a function. This is a simple method, and assumes that the API is at least 6 bytes (For the Jump). This implementation does not support calling back into the original API, this is a complete replace, not exactly a hook. Any function can be replaced, Windows APIs or functions in your own program. For true hooking, you would need to have a disassembler so you never cut an instruction boundary. This way you could call the original function using a jump after you execute the instructions you replaced.


IRC v2.0 API
Year 2001
Language C
Operating System Windows
Though this source code has been written for Windows it could easily be ported to other Operating Systems. This is a generic IRC API with the basic set of commands supported. This API could be extended to implement more commands quite easily. The intent of this API was to create a simple abstraction so that a bot or IRC client could easily be written. There is an example shell for a Client or Bot also supplied. The IRC library itself actually uses another abstraction for network called "DTL Sockets". Underneath is uses the very basic sockets implementation however any network interface could be implemented including extending DTL to use more efficient APIs than the basic blocking sockets.


Simple Compiler
Year 2000
Language C
Operating System DOS
Simple Computer Language Compiler. I wrote this for a class. It's a simple language compiler. Recursive descent compiler. TEST.IN is a demo of what code for this language looks like. There is 1 thing missing, it's there is no way to assign a character literal, everything is string literals so if you make a character you won't be able to assign. This is just something I forgot and I don't feel like fixing it, this source is considered obsolete by me supporting anything in it. Also, there is a problem if you don't enter an input file and it prompts for one, the prompt is messed up that if you go to the end of the line and past, you can't backspace anymore. There's also some dead keyboard code that is not used. The download is big because it requires DOS4GW.EXE and the SCL exe included.


Chat Program
Year 1998
Language C
Operating System Windows
My first sockets program. This is a win32 console app. There are two files. One is the client and one is the server. This is basically a chat program. One person sets up the server and other people connect to it and they can chat. It's pretty crude, but it's my first sockets program.


Assembly Guide
Year 1998
Language C
Operating System Windows
A GUI guide that is unfinished, it was originally to load various text files for viewing and showing information about x86 assembly. Some text files are available but most are not as this was never finished. The code is useful (although ugly) as how to load a text file and use MDI to display multiple documents to scroll.


 
About Toby Opferman

Professional software engineer with over 15 years...

Learn more »
Codeproject Articles

Programming related articles...

Articles »
Resume

Resume »
Contact

Email: codeproject(at)opferman(dot)com