PHP Code:
byte[] functionbytes = { 0x56, //push esi
0x8B, 0x74, 0x24, 0x08, //mov esi, [esp+8]
0x8B,0x4E,0x28, //mov ecx, [esi+28h]
0x8B, 0x46, 0x30, //mov eax, [esi+30h]
0x6A, 0x00, //push 0
0x51, //push ecx
0x8D, 0x56, 0x24, //lea edx, [esi+24h]
0x52, //push edx
0x8D,0x4E,0x18, //lea ecx, [esi+18h]
0x51, //push ecx
0x8D, 0x56, 0x0C, //lea edx, [esi+0Ch]
0x52, //push edx
0x56, //push esi
0xFF, 0xD0, //call eax
0x0F, 0xB6, 0xC0, //movzx eax, al
0x89, 0x46, 0x34, //mov [esi+34h], eax
0xB8, 0x01, 0x00, 0x00, 0x00, // mov eax, 1
0x5E, //pop esi
0x83, 0xC4, 0x18, //add esp, 18h
0xC2, 0x04, 0x00 //retn 4
};