Jump to content

Recommended Posts

Posted

Problem being:  I used bash on windows to 'cat ntuser.pol' and pipe the output to a txt file on the desktop.  This file is chock full of EOF characters, so none of the file* nor _file* commands get past the first few characters.  Notepad.exe does not care, and as a bonus feature converts all those EOFs to squares when you save, but opening it, sending ctrl-s, and closing it, is clunky and am hoping there is a better alternative.

  Reveal hidden contents

Posted

What does 'FileRead("filename", count)' return where count is the real size of the file?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

a couple of characters (it also returns them as asian, when they are clearly not in the file), and they are not the entirety of the line.  Same characters are printed with -1 as are with 1-50ish.

read to array also returns the same.  1 line, only the few bytes up to the EOF.

Edited by iamtheky

  Reveal hidden contents

Posted

Read the file verbatim (i.e. in binary mode).

  Reveal hidden contents

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Posted

Nope, same.  The fileread function will not make it past the first EOF in any mode.  I will try and generate a file that doesnt have pii so you can play along, but I cant edit one because any save operation in notepad fixes it.

  Reveal hidden contents

Posted
  On 6/2/2016 at 11:47 AM, iamtheky said:

 The fileread function will not make it past the first EOF in any mode.

Expand  

I sincerely doubt that. Binary mode will hopefully read anything. First use FileOpen in binary mode and use the handle returned to FileRead it. The binary result is the actual content of the file, verbatim.

  Reveal hidden contents

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Posted (edited)

I cannot post the screenshots, because apparently you can not delete attachments from the attachment menu (and i have reached my limit).

However, opening as bin is fine.  Fileread as Bin is also fine, that was incorrect.  BinaryToString or any attempts at converting that back to text (including stringreplace so far), result in the same 3 characters and the EOF.  

Edited by iamtheky

  Reveal hidden contents

Posted
  On 6/2/2016 at 11:47 AM, iamtheky said:

but I cant edit one because any save operation in notepad fixes it.

Expand  

Use a Hex Editor (like HxD), Hex Editors don't mess up and only save the changes you made, no extra changes like Notepad or Notepad++ :D.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

I need the changes, so normal string ops work :)

once my attachments are freed up i will post all the goods.

  Reveal hidden contents

Posted
  On 6/2/2016 at 1:38 PM, iamtheky said:

I cannot post the screenshots, because apparently you can not delete attachments from the attachment menu (and i have reached my limit).

Expand  

Use an external image host like PIXHOSTER

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

  Reveal hidden contents

Posted

 

You can always gen your own while I am waiting, though i think i may be the only forum member who has added the linux subsystem to Win10.,,

  Reveal hidden contents

Posted

The Windows Substystem for Linux only comes for Windows 10.
https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

nope, you have to download the Win10 insider build, and then add the linux subsystem feature.  I dont know that you can even get to Ntuser.Pol from a session, nor if there is a utility like CAT that would pipe the contents to a txt.

But I am sure there are similar files to test with, maybe someone smart will offer suggestions for a reproducer

Edited by iamtheky

  Reveal hidden contents

Posted

I wonder what you're trying to do.

ntuser.pol is a binary file with a ASCII header("PREG") then a sequence of a UNIT dword folowed by a series of UTF16-LE strings. You can check by yourself by using a hex editor. So this is a mixed content file which you can't easily and reliably modify with a text editor.

  Reveal hidden contents

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...