Code:
.text:0049DBA0 ProtectedLuaCheck proc near ; CODE XREF: Lua_SendChatMessage+1Fp
.text:0049DBA0 ; sub_49E900+2p ...
.text:0049DBA0
.text:0049DBA0 arg_0 = dword ptr 8
.text:0049DBA0
.text:0049DBA0 push ebp
.text:0049DBA1 mov ebp, esp
.text:0049DBA3 cmp dword_E1F640, 0
.text:0049DBAA mov ecx, [ebp+arg_0]
.text:0049DBAD mov eax, dword_C6E820
.text:0049DBB2
.text:0049DBB2 Lua_Protection_Patch: ; default
.text:0049DBB2 jz short loc_49DC19 ; jumptable 0049DBC0 case 10
.text:0049DBB4 cmp ecx, 12h ; switch 19 cases
.text:0049DBB7 ja short loc_49DC19 ; default
.text:0049DBB7 ; jumptable 0049DBC0 case 10
.text:0049DBB9 movzx edx, byte ptr ds:unk_49DC40[ecx]
.text:0049DBC0 jmp ds:off_49DC30[edx*4] ; switch jump
.text:0049DBC7
.text:0049DBC7 loc_49DBC7: ; DATA XREF: .text:off_49DC30o
.text:0049DBC7 xor eax, eax ; jumptable 0049DBC0 cases 0-5,16,17
.text:0049DBC9 push eax
.text:0049DBCA push eax
.text:0049DBCB call sub_498100 ; <"%s%s">
.text:0049DBD0 add esp, 8
.text:0049DBD3 xor eax, eax
.text:0049DBD5 pop ebp
.text:0049DBD6 retn
.text:0049DBD7 ; ---------------------------------------------------------------------------
.text:0049DBD7
.text:0049DBD7 loc_49DBD7: ; CODE XREF: ProtectedLuaCheck+20j
.text:0049DBD7 ; DATA XREF: .text:off_49DC30o
.text:0049DBD7 test eax, eax ; jumptable 0049DBC0 cases 11-14
.text:0049DBD9 jz short loc_49DC27
.text:0049DBDB cmp dword ptr [eax+114Ch], 0
.text:0049DBE2 jnz short loc_49DC19 ; default
.text:0049DBE2 ; jumptable 0049DBC0 case 10
.text:0049DBE4 mov eax, 2
.text:0049DBE9 push eax
.text:0049DBEA push 0
.text:0049DBEC call sub_498100 ; <"%s%s">
.text:0049DBF1 add esp, 8
.text:0049DBF4 xor eax, eax
.text:0049DBF6 pop ebp
.text:0049DBF7 retn
.text:0049DBF8 ; ---------------------------------------------------------------------------
.text:0049DBF8
.text:0049DBF8 loc_49DBF8: ; CODE XREF: ProtectedLuaCheck+20j
.text:0049DBF8 ; DATA XREF: .text:off_49DC30o
.text:0049DBF8 test eax, eax ; jumptable 0049DBC0 cases 6-9,15,18
.text:0049DBFA jz short loc_49DC27
.text:0049DBFC cmp dword ptr [eax+1150h], 0
.text:0049DC03 jnz short loc_49DC19 ; default
.text:0049DC03 ; jumptable 0049DBC0 case 10
.text:0049DC05 mov eax, 1
.text:0049DC0A push eax
.text:0049DC0B push 0
.text:0049DC0D call sub_498100 ; <"%s%s">
.text:0049DC12 add esp, 8
.text:0049DC15 xor eax, eax
.text:0049DC17 pop ebp
.text:0049DC18 retn
.text:0049DC19 ; ---------------------------------------------------------------------------
.text:0049DC19
.text:0049DC19 loc_49DC19: ; CODE XREF: ProtectedLuaCheck:Lua_Protection_Patchj
.text:0049DC19 ; ProtectedLuaCheck+17j ...
.text:0049DC19 test eax, eax ; default
.text:0049DC19 ; jumptable 0049DBC0 case 10
.text:0049DC1B jz short loc_49DC27
.text:0049DC1D test ecx, ecx
.text:0049DC1F jnz short loc_49DC27
.text:0049DC21 mov [eax+1150h], ecx
.text:0049DC27
.text:0049DC27 loc_49DC27: ; CODE XREF: ProtectedLuaCheck+39j
.text:0049DC27 ; ProtectedLuaCheck+5Aj ...
.text:0049DC27 mov eax, 1
.text:0049DC2C pop ebp
.text:0049DC2D retn
.text:0049DC2D ProtectedLuaCheck endp
Patch the section I've annotated as Lua_Protection_Patch to enable running of all Blizz-only functions.