Skip to content

Commit 8ac82b8

Browse files
author
jvazquez-r7
committed
Beautify timezone_key_values function
1 parent bc593aa commit 8ac82b8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/post/windows/gather/enum_prefetch.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ def print_prefetch_key_value()
4444
end
4545
end
4646

47-
def timezone_key_values(key_value)
47+
def print_timezone_key_values(key_value)
4848
# Looks for timezone from registry
4949
timezone = registry_getvaldata("HKLM\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", key_value)
5050
tz_bias = registry_getvaldata("HKLM\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", "Bias")
5151
if timezone.nil? or tz_bias.nil?
5252
print_line("Couldn't find key/value for timezone from registry.")
5353
else
54-
print_good("Remote: Timezone is %s." % timezone)
55-
if tz_bias < 0xfff
56-
print_good("Remote: Localtime bias to UTC: -%s minutes." % tz_bias)
57-
else
58-
offset = 0xffffffff
59-
bias = offset - tz_bias
60-
print_good("Remote: Localtime bias to UTC: +%s minutes." % bias)
61-
end
54+
print_good("Remote: Timezone is %s." % timezone)
55+
if tz_bias < 0xfff
56+
print_good("Remote: Localtime bias to UTC: -%s minutes." % tz_bias)
57+
else
58+
offset = 0xffffffff
59+
bias = offset - tz_bias
60+
print_good("Remote: Localtime bias to UTC: +%s minutes." % bias)
6261
end
6362
end
63+
end
6464

6565
def gather_pf_info(name_offset, hash_offset, runcount_offset, filename, table)
6666
# We'll load the file and parse information from the offsets
@@ -146,7 +146,7 @@ def run
146146
"Filename"
147147
])
148148
print_prefetch_key_value
149-
timezone_key_values(key_value)
149+
print_timezone_key_values(key_value)
150150
print_good("Current UTC Time: %s" % Time.now.utc)
151151
sys_root = expand_path("%SYSTEMROOT%")
152152
full_path = sys_root + "\\Prefetch\\"

0 commit comments

Comments
 (0)