Hello,
Still on my quest to create a pure assembled PE file, I've come to the resource section. Looking through every article I could find yields little insight (most either skip the resource section or poorly document it). I know it's a binary linked list but I think something's missing in my code. I'm just trying to include a simple 16x16 icon (which it further reclassified under an icon group) and I can't seem to figure out why it's not being found by api functions etc. Also I'm not sure exactly of the format of an input icon/group icon's raw data?
Thanks, for any insight you can provide (this is what I've gotten so far):
Rsrc: ;===================.rsrc===================
TypeList: ;type resource directory table
dd 0x00
dd 0x00
dw 0x00
dw 0x00
dw 0x00
dw 0x02 ;number of resource types (2, icon/group)
.icon:
dd 0x03 ;type ID 3 = icon resource
dd (RVA(Icon_List) + 0x80000000) ;pointer to icon resources
.icongroup:
dd 0x0E ;type ID 14 = icon group resource
dd (RVA(Icongroup_List) + 0x80000000) ;pointer to icon group resources
Icon_List: ;icon resource directory table
dd 0x00
dd 0x00
dw 0x00
dw 0x00
dw 0x00
dw 0x01 ;number of icons
.icon1:
dd 0x01 ;icon ID = 1
dd (RVA(Icon1Language) + 0x80000000) ;pointer to language directory
Icongroup_List:
dd 0x00
dd 0x00
dw 0x00
dw 0x00
dw 0x00
dw 0x01 ;number of icon groups
.icongroup1:
dd 0x01 ;icon group ID = 1
dd (RVA(Icongroup1Language) + 0x80000000) ;pointer to language directory
Icon1Language: ;icon ID = 1 language directory table
dd 0x00
dd 0x00
dw 0x00
dw 0x00
dw 0x00
dw 0x01
.default:
dd 0x00
dd RVA(Icon1)
Icongroup1Language: ;icon group ID = 1 language directory table
dd 0x00
dd 0x00
dw 0x00
dw 0x00
dw 0x00
dw 0x01
.default:
dd 0x00
dd RVA(Icongroup1)
Icon1:
dd RVA(Icon1.rawdata) ;location of raw data
dd 0x02E8 ;size of icon
dd 0x00 ;no codepage
dd 0x00 ;reserved
.rawdata:
incbin "Text.ico"
Icongroup1:
dd RVA(Icongroup1.rawdata) ;location of raw data
dd 0x14 ;size of group icon (structure)
dd 0x00 ;no codepage
dd 0x00 ;reserved
.rawdata:
incbin "Text.ico", 0x00, 0x12
dw 0x01