[WIP] Get SRO Source Code - by re-writing it

07/14/2022 03:40 WolfgangNeverDie#316
Quote:
Originally Posted by painmaker_ View Post
for center text
rank_slot->TB_Func_5(1);
rank_slot->TB_Func_6(1);
But they center by default :D i want to make float left/right ^^
12/01/2022 15:35 ZeonNETWORK#317
i re-wrote CIFWnd::OnCloseWnd
but HOOK_ORIGINAL_MEMBER seems to crash
replaceAddr() too
any suggestions?
12/02/2022 20:16 kyuubi09#318
Quote:
Originally Posted by ZeonNETWORK View Post
i re-wrote CIFWnd::OnCloseWnd
but HOOK_ORIGINAL_MEMBER seems to crash
replaceAddr() too
any suggestions?
ye replaceAddr, ucant use HOOK_ORIGINAL_MEMBER on vft fun
better use replaceAddr and hook it with CIFWnd vft
12/03/2022 01:10 ZeonNETWORK#319
Quote:
Originally Posted by kyuubi09 View Post
ye replaceAddr, ucant use HOOK_ORIGINAL_MEMBER on vft fun
better use replaceAddr and hook it with CIFWnd vft
actually i already tried but doesn't override the original function
here's what i tried
Code:
	//hook CloseWnd
	vftableHook(0x00d9e734, 43, addr_from_this(&CIFWnd::OnCloseWnd));
	//placeHook(0x00652c00, addr_from_this(&CIFWnd::OnCloseWnd));
	//replaceAddr(0x00d9e7e0, addr_from_this(&CIFWnd::OnCloseWnd));
12/04/2022 19:27 UnkownW#320
You must use different name of the original function (Example : OnCloseWnd_IMPL)
Quote:
Originally Posted by ZeonNETWORK View Post
actually i already tried but doesn't override the original function
here's what i tried
Code:
	//hook CloseWnd
	vftableHook(0x00d9e734, 43, addr_from_this(&CIFWnd::OnCloseWnd));
	//placeHook(0x00652c00, addr_from_this(&CIFWnd::OnCloseWnd));
	//replaceAddr(0x00d9e7e0, addr_from_this(&CIFWnd::OnCloseWnd));
12/07/2022 11:52 kyuubi09#321
Quote:
Originally Posted by ZeonNETWORK View Post
actually i already tried but doesn't override the original function
here's what i tried
Code:
	//hook CloseWnd
	vftableHook(0x00d9e734, 43, addr_from_this(&CIFWnd::OnCloseWnd));
	//placeHook(0x00652c00, addr_from_this(&CIFWnd::OnCloseWnd));
	//replaceAddr(0x00d9e7e0, addr_from_this(&CIFWnd::OnCloseWnd));
Also yeah ucant hook an func thats getting override as UnknownW said
12/09/2022 12:37 ZeonNETWORK#322
Quote:
Originally Posted by UnkownW View Post
You must use different name of the original function (Example : OnCloseWnd_IMPL)
Quote:
Originally Posted by kyuubi09 View Post
Also yeah ucant hook an func thats getting override as UnknownW said
Okay here's what i did according to what you've suggested

Code:
bool CIFWnd::OnCloseWnd() {
    return reinterpret_cast<bool(__thiscall *)(CIFWnd *)>(0x00652c00)(this);
}
Code:
bool CIFWnd::OnCloseWndImpl()
{
	if ( IsSame(GFX_RUNTIME_CLASS( CIFItemMall ) ))
	{
		g_pCGInterface->RenderItemMall(0);
	}
	return CIFWnd::OnCloseWnd();
}
Code:
//Util.cpp
vftableHook(0x00d9e734, 43, addr_from_this(&CIFWnd::OnCloseWndImpl));
but that didn't work either i even used vftableHook on all possible classes that inherit CIFwnd and doesn't override OnCloseWnd like this


so from what i've experienced so far, hooking a virtual method at the parent class is impossible yet!



anyway here's the function body if someone interested

Code:
// CIFWnd::OnCloseWnd(void) .text 00652C00 000000CF 00000004 00000000 R . . . . . .
//HOOK_ORIGINAL_MEMBER(0x00652C00, &CIFWnd::OnCloseWnd);
bool CIFWnd::OnCloseWnd() {
#if 0
    return reinterpret_cast<bool(__thiscall *)(CIFWnd *)>(0x00652c00)(this);
#else
	if(IsKindOf( GFX_RUNTIME_CLASS( CIFStore ) ) && g_pCGInterface->sub_7992E0())
	{
		CGEffSoundBody::get()->PlaySoundA(L"snd_window_close");
		g_pCGInterface->sub_79DBD0(0, 0);
		return false;
	}
	else if (IsSame(GFX_RUNTIME_CLASS( CNIFEnchantWnd )))
	{
		g_pCGInterface->RenderEnchantWnd(0);
	}
	else if ( IsSame(GFX_RUNTIME_CLASS( CIFQuestInfo )))
	{
		g_pCGInterface->RenderQuestInfo(0);
	}
	else if ( IsSame(GFX_RUNTIME_CLASS( CIFNewItemMall ) ))
	{
		g_pCGInterface->RenderNewItemMall(0);
	}
	else
	{
		ShowGWnd(false);
		GetParentControl()->SetFocus_MAYBE();
		g_pCGInterface->FUN_0079a7e0(this);
	}
	return true;
#endif
}
12/10/2022 02:46 UnkownW#323
Quote:
Originally Posted by ZeonNETWORK View Post
Okay here's what i did according to what you've suggested

Code:
bool CIFWnd::OnCloseWnd() {
    return reinterpret_cast<bool(__thiscall *)(CIFWnd *)>(0x00652c00)(this);
}
Code:
bool CIFWnd::OnCloseWndImpl()
{
	if ( IsSame(GFX_RUNTIME_CLASS( CIFItemMall ) ))
	{
		g_pCGInterface->RenderItemMall(0);
	}
	return CIFWnd::OnCloseWnd();
}
Code:
//Util.cpp
vftableHook(0x00d9e734, 43, addr_from_this(&CIFWnd::OnCloseWndImpl));
but that didn't work either i even used vftableHook on all possible classes that inherit CIFwnd and doesn't override OnCloseWnd like this


so from what i've experienced so far, hooking a virtual method at the parent class is impossible yet!



anyway here's the function body if someone interested

Code:
// CIFWnd::OnCloseWnd(void) .text 00652C00 000000CF 00000004 00000000 R . . . . . .
//HOOK_ORIGINAL_MEMBER(0x00652C00, &CIFWnd::OnCloseWnd);
bool CIFWnd::OnCloseWnd() {
#if 0
    return reinterpret_cast<bool(__thiscall *)(CIFWnd *)>(0x00652c00)(this);
#else
	if(IsKindOf( GFX_RUNTIME_CLASS( CIFStore ) ) && g_pCGInterface->sub_7992E0())
	{
		CGEffSoundBody::get()->PlaySoundA(L"snd_window_close");
		g_pCGInterface->sub_79DBD0(0, 0);
		return false;
	}
	else if (IsSame(GFX_RUNTIME_CLASS( CNIFEnchantWnd )))
	{
		g_pCGInterface->RenderEnchantWnd(0);
	}
	else if ( IsSame(GFX_RUNTIME_CLASS( CIFQuestInfo )))
	{
		g_pCGInterface->RenderQuestInfo(0);
	}
	else if ( IsSame(GFX_RUNTIME_CLASS( CIFNewItemMall ) ))
	{
		g_pCGInterface->RenderNewItemMall(0);
	}
	else
	{
		ShowGWnd(false);
		GetParentControl()->SetFocus_MAYBE();
		g_pCGInterface->FUN_0079a7e0(this);
	}
	return true;
#endif
}
Are you sure about the address and the place of function the Vftable (43)?
12/10/2022 14:44 ZeonNETWORK#324
Quote:
Originally Posted by UnkownW View Post
Are you sure about the address and the place of function the Vftable (43)?
[Only registered and activated users can see links. Click Here To Register...]

well, including those 2 weird locations the offset should be at 43 of the vftbl!
12/12/2022 04:34 ZeonNETWORK#325
I truly like the way Joymax when they want to abandon objects
thanks to their laziness we could get such things back :D
I hope flo still around, i even lost my old discord where we used to catch such things out :feelsgoodman: missed ya buddy

AcademyChatWindow
01/01/2023 22:08 ZeonNETWORK#326
hey reverse engineering mates
on my way down of reversing CIFUnderbar (which was deprecated but not entirly removed from the vsro188 just become an instance to CNIFUnderMenuBar)

I've found some interesting informations that should be 90% correct
  • CGWndBase::IsVisible() should be IsShowGWnd() confirmed @[Only registered and activated users can see links. Click Here To Register...]SpecialtyDeal::sub_74F960
  • CGInterface::ToggleMainPopup() should belong to CIFUnderbar according to CIFUnderbar__MESSAGE_MAP, i call it OnMenuBtnClick()
  • CIFUnderBar::Func_28: args are (CIFSlotWithHelp *a1, CIFSlotWithHelp *a2, int a3) mean at the derived classes should be the same type too
  • CGame::GetHWnd @[Only registered and activated users can see links. Click Here To Register...]BA3CA0 & CGame::GetMainInstance @[Only registered and activated users can see links. Click Here To Register...]BA3CB0: Should belong to CGFXMainFrame
  • CObjChild should contains 3 static members [CObjChild::m_pGInterface(g_pCGInterface), CObjChild::m_pGfxEttManager(g_pGfxEttManager ), CObjChild::m_pGfxDevice]
  • g_pCICPlayer is g_pMyPlayerObj confirmed by asserts in 2 functions

feel free to correct them while i gather more informations
many thanks to @[Only registered and activated users can see links. Click Here To Register...] my reverse engineering leader and @[Only registered and activated users can see links. Click Here To Register...] (his src snippets were so much helpful in labels and data types guessing, wish he shares more in the future)


my last achievements on reversing CIFSlotWithHelp
had tough times on reversing Sort of item though, so i used the old school way of sorting depending on TID3 & TID4

Old School Item Tooltip
01/09/2023 18:28 hadescik#327
I get the following error in quick start

(CPSQuickStart) MSGID:0xA288

Is anyone else having this problem?