diff --git a/pwnlib/context/__init__.py b/pwnlib/context/__init__.py index 0f5ca157c..cad7c1f00 100644 --- a/pwnlib/context/__init__.py +++ b/pwnlib/context/__init__.py @@ -1359,9 +1359,14 @@ def update_context_defaults(section): if key not in ContextType.defaults: log.warn("Unknown configuration option %r in section %r" % (key, 'context')) continue - if isinstance(ContextType.defaults[key], (str, unicode, tuple)): + + default = ContextType.defaults[key] + + if isinstance(default, (str, unicode, tuple, int, long, list, dict)): value = safeeval.expr(value) + else: + log.warn("Unsupported configuration option %r in section %r" % (key, 'context')) - ContextType.defaults[key] = value + ContextType.defaults[key] = type(default)(value) register_config('context', update_context_defaults)