0

I want to view lastlog file I got from a linux machine.
I couldn't find anything on the net.
Is there any program that will help me do it on windows?

4

2 回答 2

1

这里有一篇关于 lastlog 文件格式的文章

于 2013-09-13T18:35:31.017 回答
1

Linux 中的 lastlog 文件是一个二进制文件,其中包含struct lastlog每个已登录的 uid 的记录。该文件是一个稀疏文件,每个 lastlog 记录存储在由 uid 确定的偏移量处。

lastlog 命令的 C 源代码非常简单,在 Windows 下编译应该不会太难。不幸的是,我不知道任何这样的现成二进制文件。

lastlog 手册页实际上很​​好地描述了文件格式:

http://www.manpagez.com/man/5/lastlog/

虽然这有点过时了。Linux 使用以下定义:

#define UT_LINESIZE     32
#define UT_NAMESIZE     32
#define UT_HOSTSIZE     256


/* The structure describing an entry in the database of
   previous logins.  */
struct lastlog
  {
#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
    int32_t ll_time;
#else
    __time_t ll_time;
#endif
    char ll_line[UT_LINESIZE];
    char ll_host[UT_HOSTSIZE];
  };
于 2013-09-13T18:39:15.740 回答