Tuesday, November 18, 2025

Windows 10 - Upgrading to latest version of Curl for Developers



Windows  10 comes with it's own curl but seems to be behind on the curl updates. So I wanted manually update curl to latest version which is curl 8.17.0 at time of writing. 




 Get latest curl for Windows



Firstly, delete curl.exe at C:\windows\system32 and C:\Windows\SysWOW64, these were stuck at version 7.52.0. You'll need take ownership of the file, with your username.

Then find what default curl.exe is being used in the command line cmd.exe. 

Execute  where curl.exe














So, we see chocalatey is now the source of curl.exe command, it's 1st on the resultant list.

Upgrading chocalety, using following command
   
choco upgrade chocolatey
choco upgrade curl

Upgrade completed with proper shims. 

If you don't have chocalety, then you can manually copy files from curl 8.17.0 zip folder /bin copy these files: 

curl-ca-bundle.crt
curl.exe
libcurl-x64.def
libcurl-x64.dll
trurl.exe

to next directory in the list.

 And now curl is upgraded in cmd.exe when you launch it.

   
C:\Users\Markus>curl -V
curl 8.17.0 (x86_64-w64-mingw32) libcurl/8.17.0 LibreSSL/4.2.1 zlib/1.3.1.zlib-ng brotli/1.2.0 zstd/1.5.7 WinIDN libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.68.0 ngtcp2/1.17.0 nghttp3/1.12.0
Release-Date: 2025-11-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli CAcert HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSLS-EXPORT SSPI threadsafe UnixSockets zstd


Sunday, November 16, 2025

How to read/view a damage/corrupt PDF file


Sometimes PDF files can get scrambled and you are stuck not being able to open a PDF file. Most PDF software cannot open the test file below. Adobe Acrobat Reader issues the pop-up screen could not open because it's not a supported file type or the file has been damaged.




Solution: 



Get XpdfReader PDF software which can open a malformed PDF files!


For more information about internal structure of PDFs


Test 1:

In the following sample file, the file starts with malformed PDF file signature 


%P!F- which is incorrect and should be %PDF-, as seen in FRHED editor. 

XpdfReader is the only app I came across that could open this file with this first malformed change.

Test 2: 
 
Then I remove leading angle bracket < where there should be two for <<Lineralired, and it opened! 

Source

The original unadulterated file header is

%PDF-1.5%<bh:e2><bh:e3><bh:cf><bh:d3>10 0 obj\<</Linearized 1/L 105981/O 12/E 101484/N 1/T 105677/H [ 502 173]>>endobj

Opened Malformed File
























































For more information about internal structure of PDFs

Example of absolute minimal PDF file contents "Hello World", copy and pasted into FHRED.

%PDF-1.1
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 200 200] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
endobj
4 0 obj
<< /Length 44 >>
stream
BT
/F1 12 Tf
72 100 Td
(Hello World) Tj
ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
xref
0 6
0000000000 65535 f 
0000000009 00000 n 
0000000056 00000 n 
0000000107 00000 n 
0000000212 00000 n 
0000000310 00000 n 
trailer
<< /Size 6 /Root 1 0 R >>
startxref
380
%%EOF


Here's Hello World.pdf opened in XpdfReader 4.06


Friday, November 14, 2025

Trouble reading PDF file? Solution to reading malformed damaged PDF files


Sometimes PDF files can get scrambled and you are stuck not being able to open a PDF file. Most PDF software cannot open the test file below. Adobe Acrobat Reader issues the pop-up screen could not open because it's not a supported file type or the file has been damaged.




Solution: 



Get XpdfReader PDF software which can open a malformed PDF files!


For more information about internal structure of PDFs


Test 1:

In the following sample file, the file starts with malformed PDF file signature 


%P!F- which is incorrect and should be %PDF-, as seen in FRHED editor. 

XpdfReader is the only app I came across that could open this file with this first malformed change.

Test 2: 
 
Then I remove leading angle bracket < where there should be two for <<Lineralired, and it opened! 

Source

The original unadulterated file header is

%PDF-1.5%<bh:e2><bh:e3><bh:cf><bh:d3>10 0 obj\<</Linearized 1/L 105981/O 12/E 101484/N 1/T 105677/H [ 502 173]>>endobj

Opened Malformed File
























































For more information about internal structure of PDFs

Example of absolute minimal PDF file contents "Hello World", copy and pasted into FHRED.

%PDF-1.1
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 200 200] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
endobj
4 0 obj
<< /Length 44 >>
stream
BT
/F1 12 Tf
72 100 Td
(Hello World) Tj
ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
xref
0 6
0000000000 65535 f 
0000000009 00000 n 
0000000056 00000 n 
0000000107 00000 n 
0000000212 00000 n 
0000000310 00000 n 
trailer
<< /Size 6 /Root 1 0 R >>
startxref
380
%%EOF


Here's Hello World.pdf opened in XpdfReader 4.06