UINT WINAPI PrivateExtractIcons(
_In_ LPCTSTR lpszFile,
_In_ int nIconIndex,
_In_ int cxIcon,
_In_ int cyIcon,
_Out_opt_ HICON *phicon,
_Out_opt_ UINT *piconid,
_In_ UINT nIcons,
_In_ UINT flags
);
764B0D13 u> 8BFF mov edi, edi ; user32.PrivateExtractIconsW
764B0D15 55 push ebp
764B0D16 8BEC mov ebp, esp
764B0D18 81EC 5C040000 sub esp, 45C
764B0D1E A1 08915076 mov eax, dword ptr ds:[76509108]
764B0D23 33C5 xor eax, ebp
764B0D25 8945 FC mov dword ptr ss:[ebp-4], eax
764B0D28 8B45 08 mov eax, dword ptr ss:[ebp+8]
764B0D2B 838D D8FBFFFF F>or dword ptr ss:[ebp-428], FFFFFFFF
764B0D32 53 push ebx
764B0D33 56 push esi
764B0D34 8B75 18 mov esi, dword ptr ss:[ebp+18]
764B0D37 33DB xor ebx, ebx
764B0D39 57 push edi
764B0D3A 8B7D 1C mov edi, dword ptr ss:[ebp+1C]
764B0D3D 8985 D0FBFFFF mov dword ptr ss:[ebp-430], eax
764B0D43 89B5 D4FBFFFF mov dword ptr ss:[ebp-42C], esi
764B0D49 899D DCFBFFFF mov dword ptr ss:[ebp-424], ebx
764B0D4F 3BF3 cmp esi, ebx
764B0D51 0F84 AFE60000 je user32.764BF406
764B0D57 8B55 20 mov edx, dword ptr ss:[ebp+20]
764B0D5A 3BD3 cmp edx, ebx
764B0D5C 76 1B jbe short user32.764B0D79
764B0D5E 8BCE mov ecx, esi
764B0D60 8BC7 mov eax, edi
764B0D62 2BCF sub ecx, edi
764B0D64 3BF3 cmp esi, ebx
764B0D66 74 03 je short user32.764B0D6B
764B0D68 891C01 mov dword ptr ds:[ecx+eax], ebx
764B0D6B 3BFB cmp edi, ebx
764B0D6D 0F85 58090300 jnz user32.764E16CB
764B0D73 83C0 04 add eax, 4
764B0D76 4A dec edx
764B0D77 ^ 75 EB jnz short user32.764B0D64
764B0D79 FFB5 D0FBFFFF push dword ptr ss:[ebp-430]
764B0D7F E8 B2010000 call user32.764B0F36
764B0D84 3D 2E636D64 cmp eax, 646D632E
764B0D89 0F84 1F010000 je user32.764B0EAE
764B0D8F 3D 2E706966 cmp eax, 6669702E
764B0D94 0F84 14010000 je user32.764B0EAE
764B0D9A 3D 2E6C6E6B cmp eax, 6B6E6C2E
764B0D9F 0F84 09010000 je user32.764B0EAE
764B0DA5 3D 2E636F6D cmp eax, 6D6F632E
764B0DAA 0F84 FE000000 je user32.764B0EAE
764B0DB0 3D 2E626174 cmp eax, 7461622E
764B0DB5 0F84 F3000000 je user32.764B0EAE
764B0DBB 68 04010000 push 104
764B0DC0 8D85 E0FBFFFF lea eax, dword ptr ss:[ebp-420]
764B0DC6 50 push eax
764B0DC7 FFB5 D0FBFFFF push dword ptr ss:[ebp-430]
764B0DCD FF15 94134A76 call near dword ptr ds:[<&KERNEL32.Expan>; kernel32.ExpandEnvironmentStringsW
764B0DD3 33C0 xor eax, eax
764B0DD5 66:8985 E6FDFFF>mov word ptr ss:[ebp-21A], ax
764B0DDC 8D85 E0FBFFFF lea eax, dword ptr ss:[ebp-420]
764B0DE2 50 push eax
764B0DE3 E8 E2000000 call user32.764B0ECA
764B0DE8 85C0 test eax, eax
764B0DEA 0F85 E3080300 jnz user32.764E16D3
764B0DF0 53 push ebx
764B0DF1 8D85 E8FDFFFF lea eax, dword ptr ss:[ebp-218]
764B0DF7 50 push eax
764B0DF8 68 04010000 push 104
764B0DFD 53 push ebx
764B0DFE 8D85 E0FBFFFF lea eax, dword ptr ss:[ebp-420]
764B0E04 50 push eax
764B0E05 53 push ebx
764B0E06 FF15 90134A76 call near dword ptr ds:[<&KERNEL32.Searc>; kernel32.SearchPathW
764B0E0C 85C0 test eax, eax
764B0E0E ^ 0F84 0040FFFF je user32.764A4E14
764B0E14 6A 22 push 22
764B0E16 53 push ebx
764B0E17 8D85 E8FDFFFF lea eax, dword ptr ss:[ebp-218]
764B0E1D 50 push eax
764B0E1E FF15 98134A76 call near dword ptr ds:[<&KERNEL32.LoadL>; kernel32.LoadLibraryExW
764B0E24 8985 D0FBFFFF mov dword ptr ss:[ebp-430], eax
764B0E2A 53 push ebx
764B0E2B 3BC3 cmp eax, ebx
764B0E2D 0F84 082F0200 je user32.764D3D3B
764B0E33 8B4D 0C mov ecx, dword ptr ss:[ebp+C]
764B0E36 898D A4FBFFFF mov dword ptr ss:[ebp-45C], ecx
764B0E3C 8B4D 10 mov ecx, dword ptr ss:[ebp+10]
764B0E3F 898D A8FBFFFF mov dword ptr ss:[ebp-458], ecx
764B0E45 8B4D 14 mov ecx, dword ptr ss:[ebp+14]
764B0E48 898D ACFBFFFF mov dword ptr ss:[ebp-454], ecx
764B0E4E 8B4D 20 mov ecx, dword ptr ss:[ebp+20]
764B0E51 898D B8FBFFFF mov dword ptr ss:[ebp-448], ecx
764B0E57 8B4D 24 mov ecx, dword ptr ss:[ebp+24]
764B0E5A 53 push ebx
764B0E5B 898D BCFBFFFF mov dword ptr ss:[ebp-444], ecx
764B0E61 8D8D A4FBFFFF lea ecx, dword ptr ss:[ebp-45C]
764B0E67 51 push ecx
764B0E68 68 9D114B76 push user32.764B119D
764B0E6D 6A 0E push 0E
764B0E6F 50 push eax
764B0E70 89B5 B0FBFFFF mov dword ptr ss:[ebp-450], esi
764B0E76 89BD B4FBFFFF mov dword ptr ss:[ebp-44C], edi
764B0E7C 899D C0FBFFFF mov dword ptr ss:[ebp-440], ebx
764B0E82 899D C4FBFFFF mov dword ptr ss:[ebp-43C], ebx
764B0E88 FF15 E0134A76 call near dword ptr ds:[<&KERNEL32.EnumR>; kernel32.EnumResourceNamesExW
764B0E8E FFB5 D0FBFFFF push dword ptr ss:[ebp-430]
764B0E94 FF15 DC144A76 call near dword ptr ds:[<&KERNEL32.FreeL>; kernel32.FreeLibrary
764B0E9A 3BF3 cmp esi, ebx
764B0E9C 0F84 4E080300 je user32.764E16F0 ; EnumResourceNameExW
764B0EA2 8B85 C4FBFFFF mov eax, dword ptr ss:[ebp-43C] ; EnumResourceNamesExW
764B0EA8 8985 DCFBFFFF mov dword ptr ss:[ebp-424], eax
764B0EAE 8B4D FC mov ecx, dword ptr ss:[ebp-4]
764B0EB1 8B85 DCFBFFFF mov eax, dword ptr ss:[ebp-424]
764B0EB7 5F pop edi
764B0EB8 5E pop esi
764B0EB9 33CD xor ecx, ebp
764B0EBB 5B pop ebx
764B0EBC E8 2EC10000 call user32.764BCFEF
764B0EC1 C9 leave
764B0EC2 C2 2000 retn 20
BOOL EnumResourceNames(
HMODULE hModule, // module handle
LPCTSTR lpszType, // resource type
ENUMRESNAMEPROC lpEnumFunc, // callback function
LONG_PTR lParam // application-defined parameter
);
76404425 k> 8BFF mov edi, edi ; kernel32.EnumResourceNamesExW
76404427 55 push ebp
76404428 8BEC mov ebp, esp
7640442A 6A 00 push 0
7640442C FF75 1C push dword ptr ss:[ebp+1C]
7640442F FF75 18 push dword ptr ss:[ebp+18]
76404432 FF75 14 push dword ptr ss:[ebp+14]
76404435 FF75 10 push dword ptr ss:[ebp+10]
76404438 FF75 0C push dword ptr ss:[ebp+C]
7640443B FF75 08 push dword ptr ss:[ebp+8]
7640443E E8 6EFCFFFF call kernel32.764040B1 // 这里我们跟进去.
76404443 5D pop ebp
76404444 C2 1800 retn 18
7640443e 跟进去来到下面.
764040B1 68 88000000 push 88
764040B6 68 F8434076 push kernel32.764043F8
764040BB E8 B07C0000 call kernel32.7640BD70
764040C0 33FF xor edi, edi
764040C2 897D C0 mov dword ptr ss:[ebp-40], edi
764040C5 897D BC mov dword ptr ss:[ebp-44], edi
764040C8 897D D0 mov dword ptr ss:[ebp-30], edi
764040CB 897D E0 mov dword ptr ss:[ebp-20], edi
764040CE 897D A0 mov dword ptr ss:[ebp-60], edi
764040D1 897D 8C mov dword ptr ss:[ebp-74], edi
764040D4 897D 88 mov dword ptr ss:[ebp-78], edi
764040D7 897D B8 mov dword ptr ss:[ebp-48], edi
764040DA 89BD 78FFFFFF mov dword ptr ss:[ebp-88], edi
764040E0 897D 98 mov dword ptr ss:[ebp-68], edi
764040E3 89BD 6CFFFFFF mov dword ptr ss:[ebp-94], edi
764040E9 897D B4 mov dword ptr ss:[ebp-4C], edi
764040EC 8B45 18 mov eax, dword ptr ss:[ebp+18]
764040EF 8BC8 mov ecx, eax
764040F1 C1E9 03 shr ecx, 3
764040F4 83E1 01 and ecx, 1
764040F7 894D DC mov dword ptr ss:[ebp-24], ecx
764040FA 897D 94 mov dword ptr ss:[ebp-6C], edi
764040FD 897D 90 mov dword ptr ss:[ebp-70], edi
76404100 C1E8 04 shr eax, 4
76404103 F7D0 not eax
76404105 83E0 01 and eax, 1
76404108 8BF0 mov esi, eax
7640410A 57 push edi
7640410B 8D45 18 lea eax, dword ptr ss:[ebp+18]
7640410E 50 push eax
7640410F E8 38030000 call kernel32.7640444C
76404114 85C0 test eax, eax
76404116 0F84 00180200 je kernel32.7642591C
7640411C FF75 0C push dword ptr ss:[ebp+C]
7640411F E8 9C060000 call <jmp.&KERNELBASE.BaseDllMapResource>
76404124 8945 9C mov dword ptr ss:[ebp-64], eax
76404127 83F8 FF cmp eax, -1
7640412A 0F84 EC170200 je kernel32.7642591C
76404130 6A 01 push 1
76404132 FF75 08 push dword ptr ss:[ebp+8]
76404135 E8 B05D0000 call kernel32.BasepMapModuleHandle
7640413A 8945 CC mov dword ptr ss:[ebp-34], eax
7640413D 3BF7 cmp esi, edi
7640413F 74 2A je short kernel32.7640416B
76404141 8D4D 94 lea ecx, dword ptr ss:[ebp-6C]
76404144 51 push ecx
76404145 FF75 DC push dword ptr ss:[ebp-24]
76404148 50 push eax
76404149 E8 46030000 call kernel32.76404494
7640414E 3BC7 cmp eax, edi
76404150 7C 19 jl short kernel32.7640416B
76404152 8D45 90 lea eax, dword ptr ss:[ebp-70]
76404155 50 push eax
76404156 57 push edi
76404157 FF75 9C push dword ptr ss:[ebp-64]
7640415A FF75 94 push dword ptr ss:[ebp-6C]
7640415D FF15 F0123C76 call near dword ptr ds:[<&ntdll.LdrRscIs>; ntdll.LdrRscIsTypeExist
76404163 3BC7 cmp eax, edi
76404165 0F8C FA3A0200 jl kernel32.76427C65
7640416B 8B5D 18 mov ebx, dword ptr ss:[ebp+18]
7640416E 895D 18 mov dword ptr ss:[ebp+18], ebx
76404171 8365 18 02 and dword ptr ss:[ebp+18], 2
76404175 0F84 87000000 je kernel32.76404202
7640417B 8B45 94 mov eax, dword ptr ss:[ebp-6C]
7640417E 33F6 xor esi, esi
76404180 3BC6 cmp eax, esi
76404182 0F84 923C0200 je kernel32.76427E1A
76404188 F640 10 01 test byte ptr ds:[eax+10], 1
7640418C 0F84 883C0200 je kernel32.76427E1A
76404192 F745 90 0000020>test dword ptr ss:[ebp-70], 20000
76404199 0F85 B43A0200 jnz kernel32.76427C53
7640419F 68 80000000 push 80
764041A4 8D45 C8 lea eax, dword ptr ss:[ebp-38]
764041A7 56 push esi
764041A8 50 push eax
764041A9 66:3975 1C cmp word ptr ss:[ebp+1C], si
764041AD 0F85 DAA90200 jnz kernel32.7642EB8D
764041B3 FF75 CC push dword ptr ss:[ebp-34]
764041B6 FF15 E8123C76 call near dword ptr ds:[<&ntdll.LdrLoadA>; ntdll.LdrLoadAlternateResourceModule
764041BC 3BC6 cmp eax, esi
764041BE 0F8C 563C0200 jl kernel32.76427E1A
764041C4 3975 DC cmp dword ptr ss:[ebp-24], esi
764041C7 0F85 D1A90200 jnz kernel32.7642EB9E
764041CD 8D45 80 lea eax, dword ptr ss:[ebp-80]
764041D0 50 push eax
764041D1 8D45 D8 lea eax, dword ptr ss:[ebp-28]
764041D4 50 push eax
764041D5 53 push ebx
764041D6 FF75 B0 push dword ptr ss:[ebp-50]
764041D9 FF75 C8 push dword ptr ss:[ebp-38]
764041DC E8 09030000 call kernel32.764044EA
764041E1 8BF8 mov edi, eax
764041E3 3BFE cmp edi, esi
764041E5 7C 1B jl short kernel32.76404202
764041E7 8D45 BC lea eax, dword ptr ss:[ebp-44]
764041EA 50 push eax
764041EB 8BC3 mov eax, ebx
764041ED 0D 00020000 or eax, 200
764041F2 50 push eax
764041F3 56 push esi
764041F4 56 push esi
764041F5 FF75 9C push dword ptr ss:[ebp-64]
764041F8 FF75 C8 push dword ptr ss:[ebp-38]
764041FB E8 3B030000 call kernel32.7640453B
76404200 8BF8 mov edi, eax
76404202 8BF3 mov esi, ebx
76404204 83E6 01 and esi, 1
76404207 74 53 je short kernel32.7640425C
76404209 F745 90 0000040>test dword ptr ss:[ebp-70], 40000
76404210 0F85 5C3A0200 jnz kernel32.76427C72
76404216 837D DC 00 cmp dword ptr ss:[ebp-24], 0
7640421A 0F85 A2A90200 jnz kernel32.7642EBC2
76404220 8D85 7CFFFFFF lea eax, dword ptr ss:[ebp-84]
76404226 50 push eax
76404227 8D45 D8 lea eax, dword ptr ss:[ebp-28]
7640422A 50 push eax
7640422B 53 push ebx
7640422C FF75 AC push dword ptr ss:[ebp-54]
7640422F FF75 CC push dword ptr ss:[ebp-34]
76404232 E8 B3020000 call kernel32.764044EA ; // 这里再跟进去.
76404237 8945 B4 mov dword ptr ss:[ebp-4C], eax
7640423A 85C0 test eax, eax
7640423C 7C 1E jl short kernel32.7640425C
...
/*
* @implemented
*/
PVOID
NTAPI
RtlImageDirectoryEntryToData(
PVOID BaseAddress,
BOOLEAN MappedAsImage,
USHORT Directory,
PULONG Size)
{
PIMAGE_NT_HEADERS NtHeader;
ULONG Va;
/* Magic flag for non-mapped images. */
if ((ULONG_PTR)BaseAddress & 1)
{
BaseAddress = (PVOID)((ULONG_PTR)BaseAddress & ~1);
MappedAsImage = FALSE;
}
NtHeader = RtlImageNtHeader(BaseAddress);
if (NtHeader == NULL)
return NULL;
if (Directory >= SWAPD(NtHeader->OptionalHeader.NumberOfRvaAndSizes))
return NULL;
Va = SWAPD(NtHeader->OptionalHeader.DataDirectory[Directory].VirtualAddress);
if (Va == 0)
return NULL;
*Size = SWAPD(NtHeader->OptionalHeader.DataDirectory[Directory].Size);
if (MappedAsImage || Va < SWAPD(NtHeader->OptionalHeader.SizeOfHeaders))
return (PVOID)((ULONG_PTR)BaseAddress + Va);
/* image mapped as ordinary file, we must find raw pointer */
return RtlImageRvaToVa(NtHeader, BaseAddress, Va, NULL);
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课