The MASM Forum

General => The Campus => Topic started by: deeR44 on July 21, 2022, 07:14:39 AM

Title: DateTime.dll
Post by: deeR44 on July 21, 2022, 07:14:39 AM
 Where would I find this DLL file?

ty
Title: Re: DateTime.dll
Post by: NoCforMe on July 21, 2022, 08:17:07 AM
I have two versions of this DLL (or at least one called "datetime.dll"):

I could zip these up and post here if you like. It would be a strictly use-at-your-own-risk proposition. I have no idea what's in those. Pretty sure they're legit and not virus carriers.
Title: Re: DateTime.dll
Post by: jj2007 on July 21, 2022, 09:35:18 AM
I have three Python installations, none has a datetime.dll
You will probably find one in CygWin.

Attention, "datetime" is a very common way to name a DLL that cares for date and time. What do you want from this DLL?

The Windows API has numerous date + time functions, some are being used in the MasmBasic macros (https://www.jj2007.eu/MasmBasicQuickReference.htm):
Touch
GfDate$
Age
Date$, wDate$
Time$, wTime$
IsoWeek
TimeSF
TimeDiff
NanoTimer
Title: Re: DateTime.dll
Post by: NoCforMe on July 21, 2022, 09:44:33 AM
JJ, any easy way to list what's inside a DLL? Sounds like another useful tool to have.

I see the dumppe.exe program does what I want to do. No source provided for this. Also couldn't find anything published on the format of PE files, though I know that info exists out there somewhere. Might be a fun project.

OK, found that info on the PE file format (https://0xrick.github.io/win-internals/pe3/). Phew; that shit's complicated ...
Title: Re: DateTime.dll
Post by: deeR44 on July 21, 2022, 11:29:34 AM
Quote
QuoteThe Windows API has numerous date + time functions, some are being used in the MasmBasic macros:

Thanks Jochen, but I'm not familiar with MasmBasic.
Title: Re: DateTime.dll
Post by: deeR44 on July 21, 2022, 11:36:07 AM
QuoteI have two versions of this DLL (or at least one called "datetime.dll"):

Thanks NoCforMe, but it's too big and too old.
Title: Re: DateTime.dll
Post by: NoCforMe on July 21, 2022, 12:12:30 PM
So what export functions do you need specifically?
Title: Re: DateTime.dll
Post by: hutch-- on July 21, 2022, 12:37:10 PM
deeR44,

Have a poke around the Windows API functions, you can do it all that way.
Title: Re: DateTime.dll
Post by: jj2007 on July 21, 2022, 12:38:57 PM
Quote from: NoCforMe on July 21, 2022, 09:44:33 AM
JJ, any easy way to list what's inside a DLL? Sounds like another useful tool to have.

See TLPEView (http://masm32.com/board/index.php?topic=6498.0), an excellent tool developed by Timo.
Title: Re: DateTime.dll
Post by: NoCforMe on July 21, 2022, 12:44:23 PM
Thanks, but I meant how to do it myself. I like challenges like this. I'm going to try to read and absorb that entire series (5-6 web pages) that I posted a link to. If others can write a program to show what's inside a PE, I can too. (And no Win32 API calls are needed other than reading a file; it's all a matter of parsing it. Not even really parsing, but just identifying parts and displaying them.)
Title: Re: DateTime.dll
Post by: TimoVJL on July 21, 2022, 05:41:42 PM
Search MS PECOFF.DOCX or pdf from net

MS site:
PE Format (https://docs.microsoft.com/en-us/windows/win32/debug/pe-format)

Title: Re: DateTime.dll
Post by: C3 on July 21, 2022, 10:14:14 PM
Who want's to open "random" docx-files from net? MS isn't sharing anything on docx-format?
Title: Re: DateTime.dll
Post by: TimoVJL on July 21, 2022, 10:34:06 PM
MS share many documents in .docx-format and it's safer than old .doc-format.

QuoteMicrosoft Portable Executable and
Common Object File Format
Specification
is official document from MS.

Old version 8.3
https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/pecoff_v83.docx
Title: Re: DateTime.dll
Post by: NoCforMe on July 22, 2022, 03:30:03 AM
Hey, thanks for that doc. I was actually able to open it with my old Word 2000 and save it in the old .doc format. (I actually prefer the older version of Word to the "new" sucky interface.)
Title: Re: DateTime.dll
Post by: Vortex on July 22, 2022, 04:04:17 AM
Hi NoCforMe,

You can use Pelles Podump and MS' dump to list the exported functions :

\PellesC\bin\podump.exe /EXPORTS DateTime.dll > exports.txt

\masm32\bin\dumpbin.exe /EXPORTS DateTime.dll > exports2.txt
Title: Re: DateTime.dll
Post by: NoCforMe on July 22, 2022, 04:58:28 AM
dumppe.exe works as well, and it's right there in masm32\bin.
Title: Re: DateTime.dll
Post by: deeR44 on July 23, 2022, 02:40:29 PM
QuoteHave a poke around the Windows API functions, you can do it all that way.

Where would I find what's in the Windows API?
Title: Re: DateTime.dll
Post by: NoCforMe on July 23, 2022, 03:11:15 PM
Quote from: deeR44 on July 23, 2022, 02:40:29 PM
Where would I find what's in the Windows API?

You are familiar with MSDN, aren't you? Or maybe not. Microsoft Developer's Network is the place.

Here's one entry point: Functions by Category (https://docs.microsoft.com/en-us/previous-versions//aa383686(v=vs.85)?redirectedfrom=MSDN). In your case you might want to look at the Time Functions (https://docs.microsoft.com/en-us/windows/win32/sysinfo/time-functions?redirectedfrom=MSDN). (Another way to find functions by name is Functions in Alphabetical Order (https://docs.microsoft.com/en-us/previous-versions//aa383688(v=vs.85)?redirectedfrom=MSDN).)

It's all there. You just have to root around and you'll find it.

Title: Re: DateTime.dll
Post by: hutch-- on July 23, 2022, 04:19:28 PM
For most of the older stuff, get yourself a copy of WIN32.HLP. Learn how to find your way around it and you will be able to access most things. For much later data, the suggestion to read around MSDN is the right one.
Title: Re: DateTime.dll
Post by: NoCforMe on July 23, 2022, 04:32:51 PM
So where does one get a copy of this file?
Title: Re: DateTime.dll
Post by: Vortex on July 23, 2022, 05:51:37 PM
Hi NoCforMe,

https://github.com/trietptm/OllyDbg-Archive/blob/master/HLP-Files/win32.hlp

Title: Re: DateTime.dll
Post by: TimoVJL on July 23, 2022, 06:13:48 PM
chm works too:
Microsoft's Old API Help File Reborn (http://laurencejackson.com/win32/)
Title: Re: DateTime.dll
Post by: NoCforMe on July 23, 2022, 06:48:09 PM
Quote from: Vortex on July 23, 2022, 05:51:37 PM
Hi NoCforMe,

https://github.com/trietptm/OllyDbg-Archive/blob/master/HLP-Files/win32.hlp

Thanks!
Title: Re: DateTime.dll
Post by: jj2007 on July 23, 2022, 07:26:26 PM
For those who code a lot, there is xHelp (http://masm32.com/board/index.php?topic=531.0): it searches the Win32 API, the Windows SDK *.h files and all the Masm32 SDK help files for a given string.
Title: Re: DateTime.dll
Post by: TimoVJL on July 24, 2022, 07:02:35 PM
A that list show, who use that datetime.dll
https://www.pconlife.com/viewfileinfo/datetime-dll/


https://www.softspecialists.com/utilities/smallutilities
exports:
pFile Data Description Value
0000B3E8 00003ADC Function RVA 0001 Date10To8
0000B3EC 00003613 Function RVA 0002 Date8To10
0000B3F0 00002363 Function RVA 0003 DateToSeconds
0000B3F4 000041AC Function RVA 0004 DaysFromBOY
0000B3F8 00003FF0 Function RVA 0005 DaysToEOY
0000B3FC 0000640B Function RVA 0006 DaysToSeconds
0000B400 00003438 Function RVA 0007 FormatDate
0000B404 00003384 Function RVA 0008 FormatTime
0000B408 00003F07 Function RVA 0009 GetDate
0000B40C 00003D74 Function RVA 000A GetDateSeparator
0000B410 00003131 Function RVA 000B GetDay
0000B414 000046F9 Function RVA 000C GetDayOfWeek
0000B418 00004869 Function RVA 000D GetDayOfWeekName
0000B41C 00002EBA Function RVA 000E GetHours
0000B420 000064A7 Function RVA 000F GetLanguageID
0000B424 00002F59 Function RVA 0010 GetMinutes
0000B428 00003092 Function RVA 0011 GetMonth
0000B42C 000052E1 Function RVA 0012 GetMonthName
0000B430 00002FF8 Function RVA 0013 GetSeconds
0000B434 00003E1E Function RVA 0014 GetTime
0000B438 00003BCC Function RVA 0015 GetTimeBaseLine
0000B43C 00003DC3 Function RVA 0016 GetTimeSeparator
0000B440 00003854 Function RVA 0017 GetTimeStamp
0000B444 0000372B Function RVA 0018 GetTimeStampNow
0000B448 0000436C Function RVA 0019 GetWeekNumber
0000B44C 000031D0 Function RVA 001A GetYear
0000B450 00006459 Function RVA 001B HoursToSeconds
0000B454 00002D4F Function RVA 001C IsLeapYear
0000B458 0000296A Function RVA 001D IsValidDate
0000B45C 00002726 Function RVA 001E IsValidTime
0000B460 000065FC Function RVA 001F IsWorkingDay
0000B464 0000222E Function RVA 0020 SecondsFromMidnight
0000B468 000024E5 Function RVA 0021 SecondsToDate
0000B46C 00006363 Function RVA 0022 SecondsToDays
0000B470 000063B7 Function RVA 0023 SecondsToHours
0000B474 00003266 Function RVA 0024 SetDateSeparator
0000B478 000064E9 Function RVA 0025 SetLanguageID
0000B47C 00003C76 Function RVA 0026 SetTimeBaseLine
0000B480 000032F5 Function RVA 0027 SetTimeSeparator
0000B484 000034FF Function RVA 0028 Time6To8
0000B488 000039E8 Function RVA 0029 Time8To6
0000B48C 000020A7 Function RVA 002A TimeFromMidnight
example what it use:pFile Data Description Value
0000AEE4 0000D528 Hint/Name RVA 0000 FileTimeToSystemTime
0000AEEC 0000D55E Hint/Name RVA 0000 GetSystemTime
0000AEF0 0000D56E Hint/Name RVA 0000 SystemTimeToFileTime

Title: Re: DateTime.dll
Post by: jj2007 on July 24, 2022, 07:32:47 PM
Quote from: TimoVJL on July 24, 2022, 07:02:35 PM
https://www.softspecialists.com/utilities/smallutilities
exports:
pFile Data Description Value
0000B3E8 00003ADC Function RVA 0001 Date10To8
0000B3EC 00003613 Function RVA 0002 Date8To10
0000B3F0 00002363 Function RVA 0003 DateToSeconds
0000B3F4 000041AC Function RVA 0004 DaysFromBOY
0000B3F8 00003FF0 Function RVA 0005 DaysToEOY

Interesting stuff, but where is the documentation? I found this (http://www.netfort.cz/docs/pslhelp/PSLHelp_v30/pslhelp.htm#topics/psl_date_class.htm), but I doubt it's the right one:
daysToEOY Returns the number of days to the end of the year of this Date.

Besides, many of these very specialised functions can be obtained with other means:

Print Str$("Christmas is %i days from now", -TimeDiff (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1450)(d, now:TimeSF (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1328)("24.12.2022")))

Output: Christmas is 153 days from now

Similar with JodaTime (https://www.joda.org/joda-time/):
public Days daysToNewYear(LocalDate fromDate) {
  LocalDate newYear = fromDate.plusYears(1).withDayOfYear(1);
  return Days.daysBetween(fromDate, newYear);
}


See also Elapsed time without considering weekends and bank holidays in Java (https://stackoverflow.com/questions/92475/elapsed-time-without-considering-weekends-and-bank-holidays-in-java)

P.S.: Try googling "IsWorkingDay" "datetime". Over 5,000 results, from a plethora of libraries and languages including C#, Java and others.
Title: Re: DateTime.dll
Post by: Vortex on July 24, 2022, 07:56:16 PM
Hello,

Without documentation and import library, it would be very difficult to use any version of datetime.dll

Why not to try Greg Lyon's DateTime library?

Quote\masm32\help\DateTime.chm
Title: Re: DateTime.dll
Post by: TimoVJL on July 24, 2022, 08:38:34 PM
OP wanted DateTime.dll

Everyone can make own functions with Win32 API.

EDIT:
With C code.
https://zetcode.com/gui/winapi/datetime/

Title: Re: DateTime.dll
Post by: NoCforMe on July 25, 2022, 03:12:30 AM
Or just use the exiting Win32 functions, which cover most of the ground anybody would need ...
Title: Re: DateTime.dll
Post by: vitsoft on July 26, 2022, 05:48:37 AM
Quote from: NoCforMe on July 21, 2022, 12:44:23 PM
Thanks, but I meant how to do it myself. I like challenges like this.

So do I. If you want to parse a DLL in assembly by yourself, this commented source (https://euroassembler.eu/prowin32/dll2ansi.htm) could highlight how to find .edata section in PE optional header (both 32bit and 64bit), how to collect exported names and print them.
Title: Re: DateTime.dll
Post by: NoCforMe on July 26, 2022, 06:38:53 AM
Thanks! Great stuff. Especially love commented source. That's what I'm talkin' about!