uint PATCH_OFFSET = 0x008EEC00;
int PATCH_RETURN_TO = 0x008EEC07;
int _STRICMP = 0x9ED918;
int ORIGINAL = 0x9B8FB0;
BlackMagic magic = new BlackMagic();
string name = "test";
int nTargetPlayer = name.Length + 1;
int skinId = 1;
Find("League of Legends (tm) Client", "League of Legends");
magic.Open(GamePID);
ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
Byte[] bytes = encoding.GetBytes(name);
uint lpAddress = magic.AllocateMemory(sizeof(Byte) * nTargetPlayer);
magic.WriteBytes(lpAddress, bytes);
magic.Asm.AddLine("mov eax, " + (int)lpAddress);
magic.Asm.AddLine("push eax");// a.push(eax);
magic.Asm.AddLine("push esi");//a.push(esi);
magic.Asm.AddLine("mov eax, " + (int)_STRICMP);//a.mov(eax, (int)_STRICMP);
magic.Asm.AddLine("call dword[eax]");// magic.Asm.AddLine("call(dword_ptr(eax)");
magic.Asm.AddLine("test eax, eax");// a.test(eax, eax);
//a.jnz(lbl_Skip);
magic.Asm.AddLine("mov edx, " + skinId);// magic.Asm.AddLine("mov(edx, atoi(" + skinId + ")");
//a.bind(lbl_Skip);
magic.Asm.AddLine("pop eax");//a.pop(eax);
magic.Asm.AddLine("pop eax");//a.pop(eax);
magic.Asm.AddLine("push -1");//a.push(-1);
magic.Asm.AddLine("push " + ORIGINAL);//a.push(0x9B8EC3);
magic.Asm.AddLine("mov eax, " + (int)PATCH_RETURN_TO);//a.mov(eax, (int)PATCH_RETURN_TO);
magic.Asm.AddLine("jmp eax");//a.jmp(eax);
lpAddress = magic.AllocateMemory(magic.Asm.GetMemorySize());
magic.Asm.Inject(lpAddress);
BlackMagic magic2 = new BlackMagic();
magic2.Asm.AddLine("mov eax, " + (int)lpAddress);// b.mov(eax, (int)lpMemory);
magic2.Asm.AddLine("jmp eax");//b.jmp(eax);
magic2.Open(GamePID);
magic2.Asm.Inject(PATCH_OFFSET);