Fix some patching issues - Factorization, failing to lookup primitive types in SRG obfuscation.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>