Hi there, I apologise if this is in the wrong place.

I am looking for a way to declare variables at run time which being a static language shouldn't happen. I will explain my situation.

I am upgrading a legacy program that modifies executables (non malicious). I am trying to add 64bit support.

It is a huge project and I understand the majority of it but my issues with how it handles the input data.

it has a struct that certain parameters of the input file is loaded into:

typedef struct DATA {
DWORD                         Size;
IMAGE_NT_HEADERS32    Headers;
etc, etc its a huge list.

My problem lies in the fact that I need to change IMAGE_NT_HEADERS_32 to IMAGE_NT_HEADERS64 at runtime.

That DATA struct gets called at least 110 times during runtime.

Does anybody have any ideas how I might tackle this?

Having a conditional statement repeated that many times seems ridiculous.

Thanks in advance