alloc(FindCharacterAddress, 1024) 

alloc(ListOffset, 4) 

alloc(ESIList, 1024) 

alloc(DupeXVac, 1024) 

alloc(EDIValue, 4) 

label(EndSearch) 

label(CompareOffset) 

label(StoreESI) 

label(DoNormal) 

label(LeaveMe) 



FindCharacterAddress: 

mov [esi+114],edi 

push eax 

push ebx 

push ecx 

push edx 

mov eax,0 

mov ebx,ListOffset 

mov ecx,ESIList 

mov edx,EDIValue 



CompareOffset: 

cmp eax,[ebx] 

je StoreESI 

cmp esi,[ecx+eax*4] 

je EndSearch 

inc eax 

jmp CompareOffset 



StoreESI: 

mov [ecx+eax*4],esi 

inc eax 

mov [ebx],eax 

mov [edx],edi 



EndSearch: 

pop edx 

jmp LeaveMe 



DupeXVac: 

push eax 

push ebx 

push ecx 

mov ebx,[ListOffset] 

dec ebx 

mov ecx,ESIList 

mov eax,[ecx+ebx*4] 

cmp esi,eax 

je DoNormal 

mov edi,[EAX+114] 



DoNormal: 

mov [esi+114],edi 



LeaveMe: 

pop eax 

pop ebx 

pop ecx 

jmp 6984A3