Ah. Might be a question better suited for the hacking thread so I can post a more detailed answer there if you want. But the gist of it, for the refill randomizer at least, is you read every MREA file, jump to where object data, and start parsing every object in the room. Anything marked as a pickup for health, PBs, or missiles is checked to make sure it's not an expansion, then the pickup type is randomized.
Your Mainbar: