diff --git a/src/pe/tls.rs b/src/pe/tls.rs index ad24c50a..bd116ded 100644 --- a/src/pe/tls.rs +++ b/src/pe/tls.rs @@ -227,6 +227,11 @@ impl<'a> TlsData<'a> { } else { bytes.pread_with::(offset + i * 4, scroll::LE)? as u64 }; + + if callback == 0 { + break; + } + // Each callback is an VA so convert it to RVA let callback_rva = callback as usize - image_base; // Check if the callback is in the image @@ -236,9 +241,6 @@ impl<'a> TlsData<'a> { callback ))); } - if callback == 0 { - break; - } callbacks.push(callback); i += 1; }