I'm attempting to reverse some shellcode created by metasploit to increase my understanding of shellcode. I understand the overall point of the code is attempting to locate kernel32.dll in the list of loaded modules.
seg000:00000006 60 pusha
seg000:00000007 89 E5 mov ebp, esp
seg000:00000009 31 D2 xor edx, edx
seg000:0000000B 64 8B 52 30 mov edx, fs:[edx+30h] ; Accessing PEB
seg000:0000000F 8B 52 0C mov edx, [edx+0Ch] ; Access 0x0C PEB offset which is _PEB_LDR_DATA
seg000:00000012 8B 52 14 mov edx, [edx+14h] ; Accesses _PEB_LDR_DATA->InMemoryOrderModuleList
seg000:00000015
seg000:00000015 loc_15: ; CODE XREF: sub_6+87j
seg000:00000015 8B 72 28 mov esi, [edx+28h]
seg000:00000018 0F B7 4A 26 movzx ecx, word ptr [edx+26h]
seg000:0000001C 31 FF xor edi, edi
I'm having some trouble understanding the instructions below. I understand that edx will point to _PEB_LDR_DATA->InMemoryOrderModuleList but why reference edx+28h and then a word of edx+26h? esi and ecx are overwritten in subsequent assembly instructions so I'm not sure what the point is of populating them here.
seg000:00000015 8B 72 28 mov esi, [edx+28h]
seg000:00000018 0F B7 4A 26 movzx ecx, word ptr [edx+26h]