The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for January, 2020

Mad With PowerShell: FileInfo and DirectoryInfo objects are not populated upon creation in PowerShell

Posted by jpluimers on 2020/01/16

[WayBack] Mad With PowerShell: FileInfo and DirectoryInfo objects are not populated upon creation in PowerShell.

TL;DR:

  • Apart from the FullName property, the other poprerties of FileInfo and DirectoryInfo are populated later than their instance creation
  • A call to their Refresh method populates or re-populates them
  • That method is implicitly called when you request other properties than FullName

Example: see the [Archive.is]fileinfo.cs: Length property

–jeroen

Posted in .NET, C#, CommandLine, Development, F#, PowerShell, Software Development, VB.NET | Leave a Comment »

ρσℓα¢ķ͌͌͌͌͌͌͌͌͌͌͌͌͌͌ on Twitter : “The PowerShell console history file isn’t just useful for DFIR peeps, red team-ers should check it too! 4096 entries by default, here’s the path…”

Posted by jpluimers on 2020/01/15

Not sure why, but I checked a few of my systems and no  file at %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt

Heck: no ConsoleHost_history.txt files on those systems anywhere.

[WayBack] ρσℓα¢ķ͌͌͌͌͌͌͌͌͌͌͌͌͌͌ on Twitter : “The PowerShell console history file isn’t just useful for DFIR peeps, red team-ers should check it too! 4096 entries by default, here’s the path: %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt”

–jeroen

Read the rest of this entry »

Posted in CommandLine, Power User, PowerShell, PowerShell | Leave a Comment »

Drawbacks for separating TDS/TD32 symbol information in separate file for your Delphi applications? What about Visual Studio?

Posted by jpluimers on 2020/01/15

A while ago this interesting question came by: [WayBack] Delphi XE2 has got the Linking option “Place debug information in separate TDS file” … Does this have any adverse effects for Win32 Delphi executables? – Thomas Mueller (dummzeuch) – Google+

The answer is “no”.

By about mid 2018, the same holds for Visual Studio and PDB symbol information.

Delphi

Since long ago (I think about Delphi 2), the Delphi debugger understands TDS (historically also known as TD32) Turbo Debugger Symbol Information which can be either in the .EXE or in a separate .TDS file with the same name and directory as the .EXE.

Many other tools also know how to get the symbols from either place, see for instance TD32-TDS-SYMBOL-INFORMATION.

The advantage of keeping it in the EXE is that it is easier to ship to clients. Unless you do not want the clients to have it. Then it is easier to separate it in a file.

David Heffernan raises an important point though, as many people confuse these two topics:

  • the presence of Debug Symbols
  • the code generation of extra run-time checks and debug-assistance (like stack frames)

This is caused by both of the above usually being enabled in DEBUG mode and disabled in RELEASE mode.

However, nothing prevents you from generating the Debug Symbols in RELEASE mode, and they can highly help track down customer problems.

This is David’s comment:

There’s a common myth that “debug builds” perform worse than “release builds”.

Whether or not debug information is generated is completely independent from the performance of the code.

Visual Studio

For a long time, EXE files generated by Microsoft Tools could only include .DBG symbol information, but no .PDB symbol information.

[WayBack] executable – Embed .pdb debug symbol information into an .exe file in Visual Studio – Stack Overflow. Especially read the comments about:

–jeroen

Posted in Debugging, Delphi, Development, MAP Symbol Information, Software Development, TD32/TDS Symbol information | Leave a Comment »

How Douglas Engelbart Invented the Future | Innovation | Smithsonian

Posted by jpluimers on 2020/01/15

Two decades before the personal computer, a shy engineer unveiled the tools that would drive the tech revolution

Don’t read this as a historic piece, but as the potential we are still going to experience what was not just sketched by a true visionary in 1968, but also demonstrated back then: [Archive.isHow Douglas Engelbart Invented the Future | Innovation | Smithsonian.

I am including one of the pictures below by Christie Hemm Klok that shows how far Engelbart was ahead of his time: not his initial invention of an input device (the mouse) “chord” kind.

After that, read about his 1968 presentation: The Mother of All Demos – Wikipedia

Finally, watch the video below, well worth watching the more than one and a half hours.

–jeroen

Via:

Read the rest of this entry »

Posted in Development, Future, Hardware, History, Network-and-equipment, Power User, Software Development | Leave a Comment »

Debugging a stackexchange memory leak while transitioning to .NET Core: by @Nick_Craver

Posted by jpluimers on 2020/01/14

Cool thread with steps (windbg) tooling and graphs: this is how you approach problem solving.

Easiest to read: [WayBack] Thread by @Nick_Craver: “Well hello there memory leak…let’s see what you are. It’s times when I type !dumpheap without an argument that cals. Alrighty, let’s see what these little guys are: Quite a bit of repetition in here – let’s root some of the […]”

Twitter thread below the fold.

[WayBackNick Craver on Twitter: “So let’s form our dictionary in batches EF Core will load, like this. We can lower our SQL roundtrips to n / 1000 + relevant changes. It’s more SQL trips than our original 1, but we aren’t needlessly loading a million users into memory. We load about 0.3% of that instead.… https://t.co/wgHpWgCoJH”

Tooling:

Related: Some notes/links on Windows Debugging CLR applications

A good WinDbg introduction is [WayBack] Getting Started with WinDbg (User-Mode) | Microsoft Docs.

Note that temp tables in SQL Server might look nice, but actually do not scale well: [WayBack] Lucas Trzesniewski on Twitter: “I’ve found out the following massively improves performance over queries with an IN clause with lots of parameters: – Open a transaction – Create a temp table – Bulk insert your IDs into the temp table – Inner join your query on the temp table And you only make a single query.… https://t.co/anwGSrxRqh”

–jeroen

Read the rest of this entry »

Posted in .NET, .NET Core, .NET Core, .NET Standard, Development, Software Development | Leave a Comment »

Delphi Datasnap: How to know the name of the methods called by client in delphi datasnap server?

Posted by jpluimers on 2020/01/14

A great tip from [WayBack] Hi, need help regarding Datasnap. How to know the name of the methods called by client in delphi datasnap server? – sujansiddhi – Google+ that I needed a few months ago:

Walter Prins:

Inside TDSAuthenticationManager.OnUserAuthorize, inspect the EventObject.MethodAlias property. (Obviously once the method is actually called you implicitly know the methodname.)

This was introduced in Delphi XE:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

I’m harvesting credit card numbers and passwords from your site. Here’s how.

Posted by jpluimers on 2020/01/14

Below is one of the reasons I try to stay on the back-end side of things. Those are complex enough to focus on for me.

[WayBackI’m harvesting credit card numbers and passwords from your site. Here’s how.

It basically comes down to:

  • anything in the same page has access to anything happening on that page.
  • be careful when using npm and ad networks.
  • perform security operations in a light-weight iframe that is scrutinized.

The source of any npm package might be different from the source you find in a the underlying repository. This recursively holds for all the other npmit pulls in.

–jeroen

via: [WayBackJeroen Wiert Pluimers – Google+

Posted in Development, Power User, Security, Software Development, Web Development | Leave a Comment »

CSL Bearware 302658 DCF clock manual

Posted by jpluimers on 2020/01/13

The manual for the CSL Bearware 302658 clock that uses the DCF77 signal is at [WayBack] Bearware_Manual-302658-20161220FZ004.pdf.

I like the relatively large 3.3 inch display and the blue background.

You can get the clock here:

More on the signal, transmitter and encoding: DCF77 – Wikipedia.

–jeroen

Read the rest of this entry »

Posted in DCF77, DCF77, Development, Encoding, Hardware, LifeHacker, Power User, Software Development | Leave a Comment »

New-Age Bullshit Generator and other “sources” of New Age

Posted by jpluimers on 2020/01/13

We are in the midst of a cosmic flowering of synchronicity that will remove the barriers to the dreamscape itself.

If you want/need/hate some of this New-Age stuff, then use either of these sources:

To quote the first:

So, what is this for? Put it on your website as placeholder text. Print it out as a speech for your yoga class and see if anyone can guess a computer wrote it. Use it to write the hottest new bestseller in the self-help section, or give false hope to depressed friends and family members.

–jeroen

Via: [WayBack] Tumblr of the Day is the New Age Bullshit generator. H/t +Harald Wagener​ – Kristian Köhntopp – Google+

Posted in LifeHacker, Power User | Leave a Comment »

a perf cheat sheet from @brendangregg’s fantastic web page;  you can print it as PDF

Posted by jpluimers on 2020/01/13

From a while back: [WayBack⚡Julia Evans⚡ on Twitter : made a perf cheat sheet from @brendangregg’s fantastic brendangregg.com/perf.html you can print it at …

References:

The latter has a lot of examples and even more explanation all around the below picture.

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, Development, Linux, Power User, Profiling-Performance-Measurement | Leave a Comment »