Controlling the BMP color table in GIMP
I'm making graphics for a game. The tool that imports the graphics into the game is very particular about the exact color table (bytes 54-309 of the BMP file): if the colors are in the wrong order, the tool will butcher the image.
How can I modify an image to have a particular color table?
It sounds like what you are calling a "color table" is called indexed mode in GIMP.
Indexed color mode is a mode for encoding colors in an image where each pixel in the image is assigned an 8-bit color number. The color which corresponds to this number is then put in a table (the palette). Changing a color in the palette changes all the pixels which refer to this palette color.
Converting the image the indexed mode and then setting up your palette should achieve what you are trying to do. Convert to index mode by clicking Image > Mode > Indexed. Use the custom palette option.
To open the colormap, click Windows > Dockable Dialogs > Colormap. You'll have to add each color manually, but you can save the palette on the Palette Dialog (Windows > Dockable Dialogs > Colormap) so it can be re-used for other images in the future.