uintptr_t searchInGameChatWhat() { //========================================= // (1) // // mov ecx, "InGameChatWhat" // call sub_6F3304C0 // ds:flt_6F946378 // mov eax, [esi+98h] // movzx edx, byte ptr [esi+15h] // push ecx ; txtTime // lea ecx, [esp+114h+text] // fstp [esp+114h+var_114] // push eax ; ctype // push ecx ; text // push edx ; PlayerID // mov ecx, ebx ; this // call InGameChatWhat <---- //========================================= uintptr_t ptr = get_war3_searcher().search_string("InGameChatWhat"); ptr += 0x04; ptr = next_opcode(ptr, 0xE8, 5); ptr += 0x05; ptr = next_opcode(ptr, 0xE8, 5); return convert_function(ptr); }
uintptr_t search_create_string() { uintptr_t ptr = get_war3_searcher().search_string("I2S"); ptr = *(uintptr_t*)(ptr + 0x05); ptr = next_opcode(ptr, 0xE8, 5); ptr += 0x05; ptr = next_opcode(ptr, 0xE8, 5); return convert_function(ptr); }
uintptr_t search_jass_vmmain() { war3_searcher& s = get_war3_searcher(); uintptr_t ptr = 0; //========================================= // (1) // // push 493E0h // push 1 // push 1 // push 0 // mov edx, offset s_Config ; "config" // mov ecx, esi // call UnknowFunc <---- //========================================= ptr = s.search_string("config"); ptr += sizeof uintptr_t; ptr = next_opcode(ptr, 0xE8, 5); ptr = convert_function(ptr); //========================================= // (2) // // UnknowFunc: // push esi // mov esi, edx // call GetVMInstance // cmp [esp+4+arg_8], 0 // mov ecx, eax // jz short loc_6F44C170 // cmp dword ptr [ecx+20h], 0 // jz short loc_6F44C170 // call UnknowFunc2 <---- //========================================= ptr = next_opcode(ptr, 0xE8, 5); ptr += 5; ptr = next_opcode(ptr, 0xE8, 5); ptr = convert_function(ptr); //========================================= // (3) // // UnknowFunc2: // mov eax, [ecx+20h] // push 0 // push 493E0h // push 0 // push eax // call JassVMMain <---- // retn //========================================= ptr = next_opcode(ptr, 0xE8, 5); ptr = convert_function(ptr); return ptr; }
uintptr_t get_random_seed() { war3_searcher& s = get_war3_searcher(); uintptr_t ptr = s.search_string("SetRandomSeed"); ptr = *(uintptr_t*)(ptr + 0x05); ptr = next_opcode(ptr, 0x8B, 6); ptr = *(uintptr_t*)(ptr + 2); return *(uintptr_t*)(*(uintptr_t*)(ptr)+4); }
static inline void retry_first_write_send(struct rxe_qp *qp, struct rxe_send_wqe *wqe, unsigned int mask, int npsn) { int i; for (i = 0; i < npsn; i++) { int to_send = (wqe->dma.resid > qp->mtu) ? qp->mtu : wqe->dma.resid; qp->req.opcode = next_opcode(qp, wqe, wqe->wr.opcode); if (wqe->wr.send_flags & IB_SEND_INLINE) { wqe->dma.resid -= to_send; wqe->dma.sge_offset += to_send; } else { advance_dma_data(&wqe->dma, to_send); } if (mask & WR_WRITE_MASK) wqe->iova += qp->mtu; } }