Displaying raw binary data on SDL screen from memory

Hi to all,
I’ve been lately busy writing an emulator for the past few months and currently implementing video support.
Like most implementations mine uses the concept of a buffer where the program can write to. The contents of this
buffer would be displayed on the screen.
Now the problem here is, that the buffer contains raw binary data, which carries no specific format else I could’ve easily used SDL_RWFromMem. Tried it already IMG_LOAD_RW returns with NULL, with an unrecognisable format message. Think of it as a DOS program writing to video memory, and I’m supposed to display it on a SDL_Surface