Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Without life, Biology itself would be impossible.


devel / comp.os.ms-windows.programmer.win32 / strange wsock32

SubjectAuthor
* strange wsock32Paul Edwards
`* strange wsock32JJ
 `* strange wsock32R.Wieser
  `* strange wsock32JJ
   `- strange wsock32R.Wieser

1
strange wsock32

<3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=598&group=comp.os.ms-windows.programmer.win32#598

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:ac8:7d54:0:b0:403:ac56:944 with SMTP id h20-20020ac87d54000000b00403ac560944mr16189qtb.13.1690069906292;
Sat, 22 Jul 2023 16:51:46 -0700 (PDT)
X-Received: by 2002:a05:6808:10c3:b0:3a4:14c1:20f5 with SMTP id
s3-20020a05680810c300b003a414c120f5mr10982299ois.6.1690069905972; Sat, 22 Jul
2023 16:51:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Sat, 22 Jul 2023 16:51:45 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=136.158.103.115; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 136.158.103.115
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com>
Subject: strange wsock32
From: mutazilah@gmail.com (Paul Edwards)
Injection-Date: Sat, 22 Jul 2023 23:51:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3285
 by: Paul Edwards - Sat, 22 Jul 2023 23:51 UTC

When I do:

C:\winpath>odwin -x cvs.exe | more

I get:

....
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved

There is an import table in .rdata at 0x471b98

The Import Tables (interpreted .rdata section contents)
vma: Hint Time Forward DLL First
Table Stamp Chain Name Thunk
00071b98 00071d3c 00000000 00000000 00071d88 0006e154

DLL Name: WSOCK32.dll
vma: Hint/Ord Member-Name Bound-To
80000074 116 <none>
80000073 115 <none>
80000008 8 <none>
80000002 2 <none>
80000003 3 <none>
8000000a 10 <none>
80000039 57 <none>
80000009 9 <none>
80000034 52 <none>
80000017 23 <none>
8000000b 11 <none>
....

00071bac 00071bf0 00000000 00000000 00071ea6 0006e008

DLL Name: KERNEL32.dll
vma: Hint/Ord Member-Name Bound-To
7235e 45 CreateDirectoryA
7234e 260 GetDriveTypeA
7233a 551 RemoveDirectoryA
7232c 87 DeleteFileA
72312 458 LocalFileTimeToFileTime
72304 620 SetFileTime
722ee 616 SetFileAttributesA
722de 505 PeekNamedPipe
722c0 273 GetFileInformationByHandle
722a8 605 SetCurrentDirectoryA
72290 245 GetCurrentDirectoryA
72280 609 SetEndOfFile
72266 610 SetEnvironmentVariableA
72254 34 CompareStringW
....

I have never seen those "wsock32.dll" empty functions before.

I've only ever seen the latter - ie kernel32.dll etc.

This cvs executable almost certainly only uses wsock32.dll
if there is network access, which in this case, there won't be.

So I just need a dummy wsock32.dll to satisfy the load.

I tried just copying an existing msvcrt.dll (of my own) to
wsock32.dll, but that caused HX to crash.

Any idea how to dummy up something here?

And what those blank function names actually are?

Thanks. Paul.

Re: strange wsock32

<1cmrcyotw7zpb.1wvrbnxxowsko$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=599&group=comp.os.ms-windows.programmer.win32#599

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: strange wsock32
Date: Mon, 24 Jul 2023 05:32:02 +0700
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <1cmrcyotw7zpb.1wvrbnxxowsko$.dlg@40tude.net>
References: <3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="a0be46d888cf01dfc973f6526a32ac7d";
logging-data="401076"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+smOFSq65k8PCIrWzKZMftGXawy5E36yc="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:/PhabwMPLrM1Z/L7uPHsrw/41zY=
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Sun, 23 Jul 2023 22:32 UTC

On Sat, 22 Jul 2023 16:51:45 -0700 (PDT), Paul Edwards wrote:
> When I do:
>
> C:\winpath>odwin -x cvs.exe | more
>
> I get:
>
> ...
> Entry e 00000000 00000000 Reserved
> Entry f 00000000 00000000 Reserved
>
> There is an import table in .rdata at 0x471b98
>
> The Import Tables (interpreted .rdata section contents)
> vma: Hint Time Forward DLL First
> Table Stamp Chain Name Thunk
> 00071b98 00071d3c 00000000 00000000 00071d88 0006e154
>
> DLL Name: WSOCK32.dll
> vma: Hint/Ord Member-Name Bound-To
> 80000074 116 <none>
> 80000073 115 <none>
> 80000008 8 <none>
> 80000002 2 <none>
> 80000003 3 <none>
> 8000000a 10 <none>
> 80000039 57 <none>
> 80000009 9 <none>
> 80000034 52 <none>
> 80000017 23 <none>
> 8000000b 11 <none>
> ...
>
> 00071bac 00071bf0 00000000 00000000 00071ea6 0006e008
>
> DLL Name: KERNEL32.dll
> vma: Hint/Ord Member-Name Bound-To
> 7235e 45 CreateDirectoryA
> 7234e 260 GetDriveTypeA
> 7233a 551 RemoveDirectoryA
> 7232c 87 DeleteFileA
> 72312 458 LocalFileTimeToFileTime
> 72304 620 SetFileTime
> 722ee 616 SetFileAttributesA
> 722de 505 PeekNamedPipe
> 722c0 273 GetFileInformationByHandle
> 722a8 605 SetCurrentDirectoryA
> 72290 245 GetCurrentDirectoryA
> 72280 609 SetEndOfFile
> 72266 610 SetEnvironmentVariableA
> 72254 34 CompareStringW
> ...
>
> I have never seen those "wsock32.dll" empty functions before.
>
> I've only ever seen the latter - ie kernel32.dll etc.
>
> This cvs executable almost certainly only uses wsock32.dll
> if there is network access, which in this case, there won't be.
>
> So I just need a dummy wsock32.dll to satisfy the load.
>
> I tried just copying an existing msvcrt.dll (of my own) to
> wsock32.dll, but that caused HX to crash.
>
> Any idea how to dummy up something here?
>
> And what those blank function names actually are?
>
> Thanks. Paul.

It's just a list of function import by ordinal. Function imports don't have
to be by name. Function ordinal is an exported function ID number, and it
doesn't have to start at zero. IOTW, it's not a function index.

Function imports can also be bound by address, but it's no longer used,
since it's highly depend on specific imported DLL build. Imported DLL build
checking is done by checking the DLL file timestamp. It's why each DLL
import entry record in PE's import directory table has a timestamp. IIRC, it
was used in Win9x and pre NT4 era. This kind of import is much faster since
it doesn't need any lookup, but it broke easily on mismatched imported DLL
build.

Re: strange wsock32

<u9l6i7$ip27$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=600&group=comp.os.ms-windows.programmer.win32#600

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: strange wsock32
Date: Mon, 24 Jul 2023 08:43:09 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <u9l6i7$ip27$1@dont-email.me>
References: <3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com> <1cmrcyotw7zpb.1wvrbnxxowsko$.dlg@40tude.net>
Injection-Date: Mon, 24 Jul 2023 06:43:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cd6c861ebd34b34b60d36786c663a77f";
logging-data="615495"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yUtcRsVWIiaB78qNkRrFAMVW/BJ8PRKheIfMZtL4Rtw=="
Cancel-Lock: sha1:JSddgO9mTPYjAklg/b+pGe+WDqM=
X-Priority: 3
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Mon, 24 Jul 2023 06:43 UTC

JJ,

> Function imports can also be bound by address, but it's no longer used,
> since it's highly depend on specific imported DLL build. Imported DLL
> build checking is done by checking the DLL file timestamp.

Do you have a code example of how that binding works ?

> It's why each DLL import entry record in PE's import directory table
> has a timestamp.
....
> This kind of import is much faster since it doesn't need any lookup,

If no (initial, resolving) lookup is needed than how are those "directory
table timestamp"s found ? And if a lookup (of any kind) is needed for
timestamp checking than don't you also have (access to) the functions
address ?

IOW, I'm not quite understanding what that "bound by address" method
entrails (compile and runtime wise), and could use a bit of explanation. :-)

(I'm not thinking of using it, but would like to know how it works.)

Regards,
Rudy Wieser

Re: strange wsock32

<pl3tpxtgx3by.1483u4bawlgcj.dlg@40tude.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=601&group=comp.os.ms-windows.programmer.win32#601

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj4public@outlook.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: strange wsock32
Date: Tue, 25 Jul 2023 17:37:27 +0700
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <pl3tpxtgx3by.1483u4bawlgcj.dlg@40tude.net>
References: <3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com> <1cmrcyotw7zpb.1wvrbnxxowsko$.dlg@40tude.net> <u9l6i7$ip27$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="54554dc43ff7ba679099c592eb8f6538";
logging-data="1163089"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mvcPWHJWmPPP25DfqnGXKl1JLIuXVTak="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:OSEH6rkvrIlmxjypgfhEn4trQTs=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Tue, 25 Jul 2023 10:37 UTC

On Mon, 24 Jul 2023 08:43:09 +0200, R.Wieser wrote:
> JJ,
>
>> Function imports can also be bound by address, but it's no longer used,
>> since it's highly depend on specific imported DLL build. Imported DLL
>> build checking is done by checking the DLL file timestamp.
>
> Do you have a code example of how that binding works ?

IIRC, it has to be done using the BIND tool from WinSDK, if not from a
linker switch. It's not done via C source code.

>> It's why each DLL import entry record in PE's import directory table
>> has a timestamp.
> ...
>> This kind of import is much faster since it doesn't need any lookup,
>
> If no (initial, resolving) lookup is needed than how are those "directory
> table timestamp"s found ? And if a lookup (of any kind) is needed for
> timestamp checking than don't you also have (access to) the functions
> address ?
>
> IOW, I'm not quite understanding what that "bound by address" method
> entrails (compile and runtime wise), and could use a bit of explanation. :-)
>
> (I'm not thinking of using it, but would like to know how it works.)

See below. It may not explain everything though.

https://devblogs.microsoft.com/oldnewthing/20100318-00/?p=14563

Either way, it's an old way of using DLL. It's quite disadvantageous.

Re: strange wsock32

<u9t5rd$1qq8o$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=602&group=comp.os.ms-windows.programmer.win32#602

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: address@is.invalid (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: strange wsock32
Date: Thu, 27 Jul 2023 09:07:28 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <u9t5rd$1qq8o$1@dont-email.me>
References: <3fae48dc-d0a7-46df-9e20-287ccfe92cd2n@googlegroups.com> <1cmrcyotw7zpb.1wvrbnxxowsko$.dlg@40tude.net> <u9l6i7$ip27$1@dont-email.me> <pl3tpxtgx3by.1483u4bawlgcj.dlg@40tude.net>
Injection-Date: Thu, 27 Jul 2023 07:20:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f06ebab5c2891bb62cbb4ddcf834c225";
logging-data="1927448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5kvDiwgI+n3NOCJDaGznKPJOiwdh06RE25AnFOU6KBQ=="
Cancel-Lock: sha1:A6TWlrRiJ8X8xxzJCPHwlfUNjao=
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Thu, 27 Jul 2023 07:07 UTC

JJ,

>> Do you have a code example of how that binding works ?
>
> IIRC, it has to be done using the BIND tool from WinSDK, if not
> from a linker switch. It's not done via C source code.

I already got the "not done by normal means" feeling. :-)

> See below. It may not explain everything though.
>
> https://devblogs.microsoft.com/oldnewthing/20100318-00/?p=14563

Thanks.

Hmmm... I see I misread your "each DLL import entry record in PE's import
directory table has a timestamp". Its not about each named/ordinal entry
having a timestamp, but just the DLL entry header those named/ordinal
entries part of.

> Either way, it's an old way of using DLL. It's quite disadvantageous.

As you said, it needs very specific versions of DLLs to be present. In a
world where those can be updated at any moment that alone is quite a
drawback (same goes for "by ordinal" import as far as I'm concerned - even
though its slightly better).

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor