Skip to content

Commit cc4fc1a

Browse files
committed
use GetFileAttributesW and CreateFileW
1 parent 8cefe63 commit cc4fc1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/post/windows/gather/file_in_raw_ntfs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run
3838

3939
file_path = datastore['FILE_PATH']
4040

41-
r = client.railgun.kernel32.GetFileAttributesA(file_path)
41+
r = client.railgun.kernel32.GetFileAttributesW(file_path)
4242

4343
if r['GetLastError'] != 0
4444
fail_with(
@@ -49,7 +49,7 @@ def run
4949

5050
drive = file_path[0, 2]
5151

52-
r = client.railgun.kernel32.CreateFileA("\\\\.\\#{drive}",
52+
r = client.railgun.kernel32.CreateFileW("\\\\.\\#{drive}",
5353
'GENERIC_READ',
5454
'FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE',
5555
nil,

0 commit comments

Comments
 (0)