Search found 148 matches

by pthien
Fri Jun 20, 2025 11:58 pm
Forum: Tricks 'n' Tips
Topic: Crypt String with Xor
Replies: 7
Views: 3296

Re: Crypt String with Xor

Oh thank you Taz!

I completely forgot about unicode again.
by pthien
Fri Jun 20, 2025 9:11 pm
Forum: Tricks 'n' Tips
Topic: Crypt String with Xor
Replies: 7
Views: 3296

Re: Crypt String with Xor

The self-encrypting code doesn't seem to work, my debug output is:

Wooo! Hooo! This is self encrypting
瑴ᬛ瑴ᬛ㨺ᨚ剒㴽剒㴽ᰜ㰼桨桨ā牲剒;s self encrypting
瑗᭯瑯᭯㨡ᨠ剈㵯副㵯ᰡ㰠桔桨ũ牳删is self encrypting

I'm using 6.04LTS Windows x86, if that is important.

Any ideas?

If I'm reading the code correctly, this seems to encrypt ...
by pthien
Tue Jun 11, 2024 2:58 pm
Forum: Coding Questions
Topic: Get/Set Sound volume level programmatically
Replies: 32
Views: 19705

Re: Get/Set Sound volume level programmatically


All replies are much appreciated. The code from ts-soft works well but misses a couple of procedures, namely MediaGetMute() and MediaSetMute(), which if were included would make it perfect for my needs. I really don't need to support XP and earlier anyway and it would be a fair amount of work to ...
by pthien
Wed Jul 19, 2023 5:01 pm
Forum: Tricks 'n' Tips
Topic: Format string with some values like sprintf (C)
Replies: 62
Views: 39628

Re: Format string with some values like sprintf (C) - Update

AZJIO wrote: Wed Jul 19, 2023 4:49 pm

Code: Select all

Define d.d = 123.5e-20
Debug Format("%d", @d)
Returns 0.
Looks like you're gonna have to dig in.

Are the earlier examples in this thread working properly with doubles? It should be easy to change the padding character if so.
by pthien
Wed Jul 19, 2023 2:40 pm
Forum: Tricks 'n' Tips
Topic: Format string with some values like sprintf (C)
Replies: 62
Views: 39628

Re: Format string with some values like sprintf (C) - Update

I added leading zeros by defining "pad" as a space (default), and then changing pad to "0" should the width parameter be preceded by a zero.

My code is probably terrible I lifted this from this very thread and modified it, but here it is:


Macro __Format__(text, max, pad)
If max
If max < 0
max ...
by pthien
Mon Dec 03, 2018 4:32 pm
Forum: Coding Questions
Topic: Accessing event logs other than System/Applicant/etc.
Replies: 3
Views: 1945

Re: Accessing event logs other than System/Applicant/etc.

As it turns out, I was going about this incorrectly.

I think I need to open those additional event logs with OpenBackupEventLog_.

For example, Microsoft-Windows-Backup.evtx, which exists in \Windows\System32\winevt\Logs, if I copy that to a temporary file like "test.evtx," I can then open the ...
by pthien
Tue Nov 06, 2018 2:40 am
Forum: Coding Questions
Topic: Wrong times on E-Mails?
Replies: 4
Views: 1308

Re: Wrong times on E-Mails?

I think that is nearly what I've got.

From this:
https://www.lifewire.com/how-to-understand-date-and-time-in-email-headers-1170524

I found this example:
Sat, 24 Nov 2035 11:45:15 −0500

And I've looked through a bunch of E-Mail I've received and I see some of the senders are just using UTC, I ...
by pthien
Mon Nov 05, 2018 10:54 pm
Forum: Coding Questions
Topic: Wrong times on E-Mails?
Replies: 4
Views: 1308

Re: Wrong times on E-Mails?

Thank you.

So it seems I have to set the #PB_Mail_Date attribute to UTC +0000

Pretty much copied that code, but looking at the E-Mail format of stuff that was sent, I discovered I needed the name of the month too. Not sure if it is needed, but that seems to be what clients are sending.

SO... I ...
by pthien
Mon Nov 05, 2018 4:55 pm
Forum: Coding Questions
Topic: Wrong times on E-Mails?
Replies: 4
Views: 1308

Wrong times on E-Mails?

I'm using the 32-bit 5.46 LTS version.

I wrote a Windows monitoring app (watches event viewer events and backup jobs) which sends an E-Mail every day at approx. 9am. It was working fine until the DST shift yesterday.

Now in Thunderbird, the E-Mails are showing as 8am. Looking at the mail header, I ...
by pthien
Sat Nov 03, 2018 3:04 pm
Forum: Coding Questions
Topic: Has anyone written an SMTP relay?
Replies: 2
Views: 1123

Has anyone written an SMTP relay?

I'm interested in deploying an SMTP relay. So a little app that accepts E-Mail from machines at certain IP addresses, and forwards this through another SMTP server.

The reason I'd like this is, I have some utilities that cannot send via a server that requires authentication.

I've used PureBasic to ...
by pthien
Thu Aug 30, 2018 8:40 pm
Forum: Coding Questions
Topic: Encrypting a password using Windows standard key?
Replies: 3
Views: 2138

Re: Encrypting a password using Windows standard key?

Thank you so much for the help, I'll give this a shot.
by pthien
Thu Aug 30, 2018 5:56 pm
Forum: Coding Questions
Topic: Encrypting a password using Windows standard key?
Replies: 3
Views: 2138

Encrypting a password using Windows standard key?

Hi.

I've written a little app that monitors the Windows event logs and log files for changes, and forwards those to me via E-Mail. I've called it jptnotify so far (JPT being my initials).

I'd like to make a version available to the public, but would have to allow users to enter their own E-Mail ...
by pthien
Sun Aug 05, 2018 3:58 am
Forum: Coding Questions
Topic: Accessing event logs other than System/Applicant/etc.
Replies: 3
Views: 1945

Re: Accessing event logs other than System/Applicant/etc.

Maybe someone could point me in the right direction on using functions such that these:

https://docs.microsoft.com/en-us/windows/desktop/api/WinEvt/nf-winevt-evtopenlog

When I attempt to use EvtOpenLog by appending a "_" to the function, PureBasic tells me EvtOpenLog_ is not a function...

I ...
by pthien
Sat Aug 04, 2018 3:13 pm
Forum: Coding Questions
Topic: Accessing event logs other than System/Applicant/etc.
Replies: 3
Views: 1945

Accessing event logs other than System/Applicant/etc.

I've got some code found here for accessing the event logs.

It relies on the Windows API call OpenEventLog.

I use it to monitor event logs on a few servers and alert me via E-Mail to anything screwy going on.

It seems like OpenEventLog can only work with the basic event files (System, Application ...
by pthien
Thu Jul 19, 2018 3:08 pm
Forum: Tricks 'n' Tips
Topic: Format string with some values like sprintf (C)
Replies: 62
Views: 39628

Re: Format string with some values like sprintf (C) - Update

But why even specifying float instead of integer in the prototype doesn't work ?
From what I've read online when it comes to C, float arguments to variadic function are promoted to double. So for a function like sprintf / swprintf, you always need to use a double when importing the function or ...