News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

DateTime.dll

Started by deeR44, July 21, 2022, 07:14:39 AM

Previous topic - Next topic

NoCforMe

dumppe.exe works as well, and it's right there in masm32\bin.
Assembly language programming should be fun. That's why I do it.

deeR44

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?

NoCforMe

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. In your case you might want to look at the Time Functions. (Another way to find functions by name is Functions in Alphabetical Order.)

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

Assembly language programming should be fun. That's why I do it.

hutch--

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.

NoCforMe

So where does one get a copy of this file?
Assembly language programming should be fun. That's why I do it.

Vortex

Hi NoCforMe,

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


TimoVJL

May the source be with you

NoCforMe

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!
Assembly language programming should be fun. That's why I do it.

jj2007

For those who code a lot, there is xHelp: it searches the Win32 API, the Windows SDK *.h files and all the Masm32 SDK help files for a given string.

TimoVJL

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

May the source be with you

jj2007

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, 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(d, now:TimeSF("24.12.2022")))

Output: Christmas is 153 days from now

Similar with JodaTime:
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

P.S.: Try googling "IsWorkingDay" "datetime". Over 5,000 results, from a plethora of libraries and languages including C#, Java and others.

Vortex

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

TimoVJL

#27
OP wanted DateTime.dll

Everyone can make own functions with Win32 API.

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

May the source be with you

NoCforMe

Or just use the exiting Win32 functions, which cover most of the ground anybody would need ...
Assembly language programming should be fun. That's why I do it.

vitsoft

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 could highlight how to find .edata section in PE optional header (both 32bit and 64bit), how to collect exported names and print them.