아이템 인벤토리 상태 슬롯 리뷰

HWANSE_ITEM_INVENTORY_STATE_LAYOUT_REVIEW_READY

소모품은 전역 6-slot id/count pair 배열이며 수량 상한은 10이다. 중요품/스토리 아이템은 전역 30-slot id/value pair 배열이며 add/shop 경로에서 값 상한은 1이다. 부적은 수량 byte 하나가 아니라 1장/2장/3장/4장 별도 item id 상태로 표현된다.

0x004576ec소모품 id base
6 slots · max 10소모품 수량형
0x004576f8중요품 id base
30 slots · max 1중요품 단일형

Storage Layout

{
  "consumables": {
    "shape": "6 slots x {id byte, count byte}",
    "idBaseVaHex": "0x004576ec",
    "countBaseVaHex": "0x004576ed",
    "slotAddressRule": "id=0x4576ec+slot*2, count=0x4576ed+slot*2",
    "maxCount": 10
  },
  "importantItems": {
    "shape": "30 slots x {id byte, value byte}",
    "idBaseVaHex": "0x004576f8",
    "valueBaseVaHex": "0x004576f9",
    "slotAddressRule": "id=0x4576f8+slot*2, value=0x4576f9+slot*2",
    "maxValue": 1
  }
}

Initial Consumable Slots

초기 EXE 데이터의 첫 소모품 pair 03 03은 리프레시 워터 3개와 일치한다.

slot id VA id item count VA count
0 0x004576ec 3 리프레시 워터 0x004576ed 3
1 0x004576ee 0 0x004576ef 0
2 0x004576f0 0 0x004576f1 0
3 0x004576f2 0 0x004576f3 0
4 0x004576f4 0 0x004576f5 0
5 0x004576f6 0 0x004576f7 0

Initial Important Slots

slot id VA id item value VA value
0 0x004576f8 0x004576f9
1 0x004576fa 0x004576fb
2 0x004576fc 0x004576fd
3 0x004576fe 0x004576ff
4 0x00457700 0x00457701
5 0x00457702 0x00457703
6 0x00457704 0x00457705
7 0x00457706 0x00457707
8 0x00457708 0x00457709
9 0x0045770a 0x0045770b
10 0x0045770c 0x0045770d
11 0x0045770e 0x0045770f
12 0x00457710 0x00457711
13 0x00457712 0x00457713
14 0x00457714 0x00457715
15 0x00457716 0x00457717
16 0x00457718 0x00457719
17 0x0045771a 0x0045771b
18 0x0045771c 0x0045771d
19 0x0045771e 0x0045771f
20 0x00457720 0x00457721
21 0x00457722 0x00457723
22 0x00457724 0x00457725
23 0x00457726 0x00457727
24 0x00457728 0x00457729
25 0x0045772a 0x0045772b
26 0x0045772c 0x0045772d
27 0x0045772e 0x0045772f
28 0x00457730 0x00457731
29 0x00457732 0x00457733

부적은 수량이 아니라 상태 레코드

1장/2장/3장/4장이 같은 icon cell을 쓰지만 서로 다른 item id와 설명을 갖는다.

item id name record icon cell description
27 부적 1장 0x0048ba54 0x32 주술을 위해 / 필요한 부적
28 부적 2장 0x0048ba5c 0x32 주술을 위해 / 필요한 부적 / 매수 2매
29 부적 3장 0x0048ba64 0x32 주술을 위해 / 필요한 부적 / 매수 3매
30 부적 4장 0x0048ba6c 0x32 주술을 위해 / 필요한 부적 / 매수 4매

Item Records

id name flag storage max effect/reference
1 약초 0x0000 consumable-count 10 HP +50
2 해독초 0x0000 consumable-count 10 독/마비 회복
3 리프레시 워터 0x0000 consumable-count 10 기절 회복, HP +200
4 마법의 물약 0x0000 consumable-count 10 MP +50
5 고급한방약 0x0000 consumable-count 10 HP +100, MP +100
6 마수석 0x0000 consumable-count 10 기절 회복, HP/MP 완전 회복
7 무투대회 안내장 0x0001 important-single-state 1 무투대회 참가를 위해 맹호권도장에 제출
8 햄머 0x0001 important-single-state 1 금 간 벽과 동작석상을 파괴
9 수면약 0x0001 important-single-state 1 병원 이벤트 후 맹호룬룬권 습득 조건
10 황금돼지두루마리 0x0001 important-single-state 1 다리오스에게 주고 어설트 슈트 획득
11 화령석 0x0001 important-single-state 1 불/열 관련 상자와 횃불 조합에 사용
12 수령석 0x0001 important-single-state 1 뜨거운 보물상자의 열을 식힘
13 지령석 0x0001 important-single-state 1 얼어붙은 보물상자를 깨트림
14 풍령석 0x0001 important-single-state 1 보물상자의 쐐기를 잘라 개방
15 횃불 0x0001 important-single-state 1 화령석과 조합해 어두운 공간을 밝힘
16 횃불세트 0x0001 important-single-state 1 화령석 없이 어두운 공간을 밝힘
17 ○○책 0x0001 important-single-state 1 스마슈 특수기 눈요기 사용 조건
18 호랑이굴 인정서 0x0001 important-single-state 1 호랑이동굴 수련 완료 및 탈출 증명
19 지옥 인정서1 0x0001 important-single-state 1 지옥 간단한 코스 클리어 인정서
20 지옥 인정서2 0x0001 important-single-state 1 지옥 적당한 코스 클리어 인정서
21 지옥 인정서3 0x0001 important-single-state 1 지옥 초난관 코스 클리어 인정서
22 고급술병 0x0001 important-single-state 1 술집 주인의 도난당한 고급 술병
23 서류 0x0001 important-single-state 1 대회 주최자 전달 이벤트
24 암청수 0x0001 important-single-state 1 호랑이동굴 비밀통로 진입 이벤트에 사용
25 정호수 0x0001 important-single-state 1 암청수 눈속임용 우물물
26 나찰의 돌 0x0001 important-single-state 1 진 호혈 지하 666층 진입
27 부적 1장 0x0001 important-single-state 1 봉인 해제용 부적 1장
28 부적 2장 0x0001 important-single-state 1 봉인 해제용 부적 2장
29 부적 3장 0x0001 important-single-state 1 봉인 해제용 부적 3장
30 부적 4장 0x0001 important-single-state 1 봉인 해제용 부적 4장
31 스마슈 0x0001 important-single-state 1 부상당한 스마슈를 해변마을 병원으로 운반

Write/Use Semantics

kind function target limit
consumable-add 0x00422093 0x4576ec/0x4576ed current + amount <= 10
important-add 0x00422093 0x4576f8/0x4576f9 current + amount <= 1
remove/decrement 0x004226e9 same pair arrays by item flag subtract amount; if value becomes 0, id is cleared
battle-use 0x0040f6a8 selected slot id -> actor+0x59 -> 0x546a38 dispatch first six consumable ids/effects
shop-limit 0x0040fd3f purchase count UI consumable max 10, single/equipment max 1

Evidence Functions

function VA span role evidence
전투 소모품 선택 -> actor effect 0x0040f6a8..0x0040f6dc 선택된 소모품 슬롯 index로 0x4576ec id를 읽고 actor+0x59에 효과 index를 쓴다.
  40f6b0:	33 c0                	xor    eax,eax
  40f6b2:	a0 43 e3 59 00       	mov    al,ds:0x59e343
  40f6b7:	8a 04 45 ec 76 45 00 	mov    al,BYTE PTR [eax*2+0x4576ec]
  40f6be:	8b 4d fc             	mov    ecx,DWORD PTR [ebp-0x4]
  40f6c1:	88 41 59             	mov    BYTE PTR [ecx+0x59],al
  40f6c4:	33 c0                	xor    eax,eax
  40f6c6:	a0 47 e3 59 00       	mov    al,ds:0x59e347
상점 소모품 구매 상한 0x0040fd3f..0x0040fdf4 0x4576ec/ed 6칸을 검색하고 현재 수량+구매가능 수량을 10개로 clamp한다.
  40fd72:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  40fd75:	33 c9                	xor    ecx,ecx
  40fd77:	8a 0c 45 ec 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576ec]
  40fd7e:	3b d1                	cmp    edx,ecx
  40fd80:	0f 85 14 00 00 00    	jne    0x40fd9a
  40fd86:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  40fd89:	8a 04 45 ed 76 45 00 	mov    al,BYTE PTR [eax*2+0x4576ed]
  40fd90:	a2 39 e3 59 00       	mov    ds:0x59e339,al
  40fd95:	e9 05 00 00 00       	jmp    0x40fd9f
  40fdca:	8a 0d 3b e3 59 00    	mov    cl,BYTE PTR ds:0x59e33b
  40fdd0:	03 c1                	add    eax,ecx
  40fdd2:	83 f8 0a             	cmp    eax,0xa
  40fdd5:	0f 8e 14 00 00 00    	jle    0x40fdef
  40fddb:	b8 0a 00 00 00       	mov    eax,0xa
  40fde0:	33 c9                	xor    ecx,ecx
  40fde2:	8a 0d 39 e3 59 00    	mov    cl,BYTE PTR ds:0x59e339
상점 단일 보유품 구매 상한 0x0040fdf4..0x0040fe68 보유 predicate 0x421d3d 결과를 기준으로 구매가능 수량을 1개로 clamp한다.
  40fdf6:	a0 4a e3 59 00       	mov    al,ds:0x59e34a
  40fdfb:	8b 0d a8 e2 59 00    	mov    ecx,DWORD PTR ds:0x59e2a8
  40fe01:	8a 44 81 01          	mov    al,BYTE PTR [ecx+eax*4+0x1]
  40fe05:	50                   	push   eax
  40fe06:	e8 32 1f 01 00       	call   0x421d3d
  40fe0b:	83 c4 04             	add    esp,0x4
  40fe0e:	a2 39 e3 59 00       	mov    ds:0x59e339,al
  40fe2c:	2b d2                	sub    edx,edx
  40fe2e:	f7 f3                	div    ebx
  40fe30:	a2 3b e3 59 00       	mov    ds:0x59e33b,al
  40fe35:	33 c0                	xor    eax,eax
  40fe37:	a0 39 e3 59 00       	mov    al,ds:0x59e339
  40fe3c:	33 c9                	xor    ecx,ecx
  40fe3e:	8a 0d 3b e3 59 00    	mov    cl,BYTE PTR ds:0x59e33b
  40fe44:	03 c1                	add    eax,ecx
  40fe46:	83 f8 01             	cmp    eax,0x1
  40fe49:	0f 8e 14 00 00 00    	jle    0x40fe63
  40fe4f:	b8 01 00 00 00       	mov    eax,0x1
  40fe54:	33 c9                	xor    ecx,ecx
  40fe56:	8a 0d 39 e3 59 00    	mov    cl,BYTE PTR ds:0x59e339
  40fe5c:	2b c1                	sub    eax,ecx
  40fe5e:	a2 3b e3 59 00       	mov    ds:0x59e33b,al
  40fe63:	e9 3f 00 00 00       	jmp    0x40fea7
아이템 슬롯 lookup 0x00421c8c..0x00421d3d item record+0x10 flag에 따라 6칸 소모품 또는 30칸 중요품 배열에서 id를 찾는다.
  421c9a:	8b 04 c5 7c b9 48 00 	mov    eax,DWORD PTR [eax*8+0x48b97c]
  421ca1:	33 c9                	xor    ecx,ecx
  421ca3:	8a 48 10             	mov    cl,BYTE PTR [eax+0x10]
  421ca6:	85 c9                	test   ecx,ecx
  421ca8:	0f 84 44 00 00 00    	je     0x421cf2
  421cc7:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  421cca:	33 c9                	xor    ecx,ecx
  421ccc:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  421cd3:	33 c0                	xor    eax,eax
  421cd5:	8a 45 08             	mov    al,BYTE PTR [ebp+0x8]
  421d0b:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  421d0e:	33 c9                	xor    ecx,ecx
  421d10:	8a 0c 45 ec 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576ec]
  421d17:	33 c0                	xor    eax,eax
  421d19:	8a 45 08             	mov    al,BYTE PTR [ebp+0x8]
아이템 추가 writer 0x00422093..0x0042224b flag 0이면 0x4576ec/ed 수량형 6칸 max 10, flag 1이면 0x4576f8/f9 단일형 30칸 max 1에 쓴다.
  4220c2:	e9 03 00 00 00       	jmp    0x4220ca
  4220c7:	ff 45 f8             	inc    DWORD PTR [ebp-0x8]
  4220ca:	83 7d f8 1e          	cmp    DWORD PTR [ebp-0x8],0x1e
  4220ce:	0f 83 a3 00 00 00    	jae    0x422177
  4220d4:	8b 45 f8             	mov    eax,DWORD PTR [ebp-0x8]
  4220d7:	33 c9                	xor    ecx,ecx
  4220d9:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  4220e0:	85 c9                	test   ecx,ecx
  4220e2:	0f 84 19 00 00 00    	je     0x422101
  4220e8:	8b 45 f8             	mov    eax,DWORD PTR [ebp-0x8]
  4220eb:	33 c9                	xor    ecx,ecx
  4220ed:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  4220f4:	33 c0                	xor    eax,eax
  4220f6:	8a 45 08             	mov    al,BYTE PTR [ebp+0x8]
  422101:	8a 45 08             	mov    al,BYTE PTR [ebp+0x8]
  422104:	8b 4d f8             	mov    ecx,DWORD PTR [ebp-0x8]
  422107:	88 04 4d f8 76 45 00 	mov    BYTE PTR [ecx*2+0x4576f8],al
  42210e:	8b 45 f8             	mov    eax,DWORD PTR [ebp-0x8]
  422111:	33 c9                	xor    ecx,ecx
  422113:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  42211a:	33 c0                	xor    eax,eax
  42211c:	8a 45 0c             	mov    al,BYTE PTR [ebp+0xc]
  422142:	8b 45 f8             	mov    eax,DWORD PTR [ebp-0x8]
  422145:	33 c9                	xor    ecx,ecx
  422147:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  42214e:	33 c0                	xor    eax,eax
  422150:	8a 45 0c             	mov    al,BYTE PTR [ebp+0xc]
  422153:	03 c8                	add    ecx,eax
아이템 슬롯 pack/sort helper 0x0042224b..0x0042234e 0x4576ec 또는 0x4576f8 pair 배열의 0 구멍을 뒤로 밀고 정렬/압축한다.
  422281:	85 c0                	test   eax,eax
  422283:	0f 84 0c 00 00 00    	je     0x422295
  422289:	c7 45 fc 1e 00 00 00 	mov    DWORD PTR [ebp-0x4],0x1e
  422290:	e9 07 00 00 00       	jmp    0x42229c
  422295:	c7 45 fc 06 00 00 00 	mov    DWORD PTR [ebp-0x4],0x6
  42229c:	c7 45 f0 01 00 00 00 	mov    DWORD PTR [ebp-0x10],0x1
  4222a3:	e9 03 00 00 00       	jmp    0x4222ab
아이템 제거/감소 writer 0x004226e9..0x00422899 flag에 따라 수량/value를 감소시키고 0이 되면 pair의 id도 0으로 지운다.
  42272a:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  42272d:	33 c9                	xor    ecx,ecx
  42272f:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  422736:	33 c0                	xor    eax,eax
  422738:	8a 45 08             	mov    al,BYTE PTR [ebp+0x8]
  422743:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  422746:	33 c9                	xor    ecx,ecx
  422748:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  42274f:	33 c0                	xor    eax,eax
  422751:	8a 45 0c             	mov    al,BYTE PTR [ebp+0xc]
  422756:	0f 8d 14 00 00 00    	jge    0x422770
  42275c:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  42275f:	c6 04 45 f9 76 45 00 	mov    BYTE PTR [eax*2+0x4576f9],0x0
  422766:	00
  422767:	c6 45 fc 01          	mov    BYTE PTR [ebp-0x4],0x1
  422770:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  422773:	33 c9                	xor    ecx,ecx
  422775:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  42277c:	33 c0                	xor    eax,eax
  42277e:	8a 45 0c             	mov    al,BYTE PTR [ebp+0xc]
  422781:	2b c8                	sub    ecx,eax
  422783:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  422786:	88 0c 45 f9 76 45 00 	mov    BYTE PTR [eax*2+0x4576f9],cl
  42278d:	c6 45 fc 00          	mov    BYTE PTR [ebp-0x4],0x0
  422791:	8b 45 f4             	mov    eax,DWORD PTR [ebp-0xc]
  422794:	33 c9                	xor    ecx,ecx
  422796:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  42279d:	85 c9                	test   ecx,ecx
소모품 UI 상태 map 0x00410f23..0x00410fc4 0x4576ec/ed 6칸에서 없음/부족/있음 상태 0/2/1을 만든다.
  410f49:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  410f4c:	33 c9                	xor    ecx,ecx
  410f4e:	8a 0c 45 ec 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576ec]
  410f55:	85 c9                	test   ecx,ecx
  410f57:	0f 85 0f 00 00 00    	jne    0x410f6c
  410f6c:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  410f6f:	33 c9                	xor    ecx,ecx
  410f71:	8a 0c 45 ed 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576ed]
  410f78:	85 c9                	test   ecx,ecx
  410f7a:	0f 85 0f 00 00 00    	jne    0x410f8f
중요품 UI 페이지 수 0x00411068..0x00411138 0x4576f8 nonzero id를 세어 6칸 페이지 단위로 계산한다.
  411091:	8b 45 f8             	mov    eax,DWORD PTR [ebp-0x8]
  411094:	33 c9                	xor    ecx,ecx
  411096:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  41109d:	85 c9                	test   ecx,ecx
  41109f:	0f 84 03 00 00 00    	je     0x4110a8
중요품 UI 상태 map 0x00411138..0x004111e5 현재 중요품 page에서 0x4576f8/f9 pair를 읽어 없음/부족/있음 상태를 만든다.
  41116a:	03 45 fc             	add    eax,DWORD PTR [ebp-0x4]
  41116d:	33 c9                	xor    ecx,ecx
  41116f:	8a 0c 45 f8 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f8]
  411176:	85 c9                	test   ecx,ecx
  411178:	0f 85 0f 00 00 00    	jne    0x41118d
  41118d:	8b 45 fc             	mov    eax,DWORD PTR [ebp-0x4]
  411190:	33 c9                	xor    ecx,ecx
  411192:	8a 0c 45 f9 76 45 00 	mov    cl,BYTE PTR [eax*2+0x4576f9]
  411199:	85 c9                	test   ecx,ecx
  41119b:	0f 85 0f 00 00 00    	jne    0x4111b0