OptionalHeader.SizeOfCode

The size of the code (text) section, or the sum of all code sections if there are multiple sections.

struct OptionalHeader
uint SizeOfCode;

Meta