Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Langtype not found on 202309 client due to the missing of america string #132

Open
Shaktohh opened this issue Sep 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Shaktohh
Copy link

Shaktohh commented Sep 9, 2023

I changed to that, it should do the job

///
/// \brief Function to extract data from loaded exe and set the members
///
export function load()
{
const _ = Log.dive(self, 'load');

$$(_ + '1.1 - Check if load was already called')
if (Valid != null)
{
	$$(_ + '1.2 - Check for errors and report them again if present otherwise simply return')
	Log.rise();

	if (Valid)
		return Valid;
	else
		throw ErrMsg;
}

$$(_ + '1.3 - Initialize \'Valid\' to false')
Valid = false;

$$(_ + '1.4 - Find the string "america"')
let addr = Exe.FindText("america");
if (addr < 0){

	const prefix =
		CMP(BYTE_PTR, [POS4WC], 0) //cmp byte ptr [g_passwordencrypt], 0
	+	JNE(POS2WC)                //jne _skip
	+	'8B ?? ?? ?? ?? ??'
	;
	const suffix =
		WC + WC                    //test eax, eax OR cmp eax, ebp
	+	JZ(POS2WC)                 //jz _sendSSO -> Send SSO Packet (ID = 0x825. was 0x2B0 in Old clients)
	+	CMP(R32, 0x12)             //cmp regA, 12h ; ideally should be EAX but some clients have different register
	+	JZ(POS2WC)                 //jz _sendSSO
	+	CMP(R32, 0x0c)             //cmp regA, 12h ; ideally should be EAX but some clients have different register
	+	JZ(POS2WC)                 //jz _sendSSO
	;

	addr = Exe.FindHex(prefix + suffix);
	if (addr < 0)
		throw Log.rise(ErrMsg = new Error(`${self} - 'america' not found nor langtype`));

	$$(_ + '2.1 - Extract the address to \'Value\' & save its hex')
	Value = Exe.GetUint32(addr + 15);
	
	//let testdebug = Exe.GetHex(addr + 15, 4);
	//throw Error(testdebug.toString());

} else {

	$$(_ + '1.5 - Find where its used in a PUSH')
	addr = Exe.FindHex( PUSH(addr) );
	if (addr < 0)
		throw Log.rise(ErrMsg = new Error(`${self} - 'america' not used`));

	$$(_ + '1.6 - Find an assignment to g_serviceType after it')
	addr = Exe.FindHex( MOV([POS4WC], 1), addr + 5); //mov dword ptr ds:[g_serviceType], 1
	if (addr < 0)
		throw Log.rise(ErrMsg = new Error(`${self} - g_serviceType not assigned`));

	$$(_ + '2.1 - Extract the address to \'Value\' & save its hex')
	Value = Exe.GetUint32(addr + 2);
}

Hex = Value.toHex(4);

$$(_ + '2.2 - Set validity to true')
return Log.rise(Valid = true);

}

@Shaktohh Shaktohh added the bug Something isn't working label Sep 9, 2023
@Shaktohh Shaktohh changed the title Langtype not found on 202309 client due to the missing of america string [BUG] Langtype not found on 202309 client due to the missing of america string Sep 9, 2023
@Icemasta
Copy link

Icemasta commented May 26, 2024

@Shaktohh Hey, this doesn't seem to be working anymore with 2024-05-14 version, it follows the bottom path, any reasons for that you think?

In the older versions, there was only one america, in the current version there are 4 america.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants