Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 20:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



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

Discussion on [WIP] Get SRO Source Code - by re-writing it within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old 07/14/2022, 03:40   #316
 
elite*gold: 0
Join Date: May 2020
Posts: 70
Received Thanks: 6
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 i want to make float left/right ^^
WolfgangNeverDie is offline  
Old 12/01/2022, 15:35   #317
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
i re-wrote CIFWnd::OnCloseWnd
but HOOK_ORIGINAL_MEMBER seems to crash
replaceAddr() too
any suggestions?
ZeonNETWORK is offline  
Old 12/02/2022, 20:16   #318
 
kyuubi09's Avatar
 
elite*gold: 0
Join Date: Dec 2021
Posts: 20
Received Thanks: 31
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
kyuubi09 is offline  
Thanks
1 User
Old 12/03/2022, 01:10   #319
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
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));
ZeonNETWORK is offline  
Old 12/04/2022, 19:27   #320
 
elite*gold: 0
Join Date: Dec 2021
Posts: 16
Received Thanks: 5
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));
UnkownW is offline  
Old 12/07/2022, 11:52   #321
 
kyuubi09's Avatar
 
elite*gold: 0
Join Date: Dec 2021
Posts: 20
Received Thanks: 31
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
kyuubi09 is offline  
Old 12/09/2022, 12:37   #322
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
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
}
ZeonNETWORK is offline  
Old 12/10/2022, 02:46   #323
 
elite*gold: 0
Join Date: Dec 2021
Posts: 16
Received Thanks: 5
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)?
UnkownW is offline  
Old 12/10/2022, 14:44   #324
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
Quote:
Originally Posted by UnkownW View Post
Are you sure about the address and the place of function the Vftable (43)?


well, including those 2 weird locations the offset should be at 43 of the vftbl!
ZeonNETWORK is offline  
Old 12/12/2022, 04:34   #325
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
I truly like the way Joymax when they want to abandon objects
thanks to their laziness we could get such things back
I hope flo still around, i even lost my old discord where we used to catch such things out missed ya buddy

AcademyChatWindow
ZeonNETWORK is offline  
Thanks
1 User
Old 01/01/2023, 22:08   #326
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
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 @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 @BA3CA0 & CGame::GetMainInstance @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 @ my reverse engineering leader and @ (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
ZeonNETWORK is offline  
Thanks
1 User
Old 01/09/2023, 18:28   #327
 
elite*gold: 0
Join Date: Nov 2008
Posts: 52
Received Thanks: 1
I get the following error in quick start

(CPSQuickStart) MSGID:0xA288

Is anyone else having this problem?
hadescik is offline  
Old 06/01/2024, 16:44   #328
 
elite*gold: 0
Join Date: Aug 2014
Posts: 2
Received Thanks: 0
Hello everyone. I built the following code using VS2005. It works well. However, when pressing F5, F6, F7 multiple times, the game may disconnect (it may crash). I think it's due to some issue with wstring. Can you let me know how to fix it? Thank you!
Quote:
#include <Windows.h>
#include <iostream>
#include <string>

using namespace std;

class CGInterface {
public:
void ShowPinkNotify(std::wstring msg);
void ShowBlueNotify(std::wstring msg);
void ShowGreenNotify(std::wstring msg);
void ShowPinkNotify(std::wstring* msg);
void ShowBlueNotify(std::wstring* msg);
void ShowGreenNotify(std::wstring* msg);
static CGInterface* Get();
};

void CGInterface::ShowPinkNotify(std::wstring msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x00777BF0)(this, &msg);
}

void CGInterface::ShowBlueNotify(std::wstring msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B580)(this, &msg);
}

void CGInterface::ShowGreenNotify(std::wstring msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B5B0)(this, &msg);
}

void CGInterface::ShowPinkNotify(std::wstring* msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x00777BF0)(this, msg);
}

void CGInterface::ShowBlueNotify(std::wstring* msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B580)(this, msg);
}

void CGInterface::ShowGreenNotify(std::wstring* msg){
reinterpret_cast<void(__thiscall *)(CGInterface*, std::wstring*)>(0x0077B5B0)(this, msg);
}

CGInterface* CGInterface::Get(void){
return *reinterpret_cast<CGInterface**>(0x0110F80C);
}


DWORD WINAPI Chuong_trinh(LPVOID param)
{
CGInterface* g_interface;

do {
g_interface = CGInterface::Get();
Sleep(1000);
} while (!g_interface);

while (true)
{
if (GetAsyncKeyState(VK_F5) && g_interface) {
g_interface->ShowPinkNotify(L"Hello world");
}
if (GetAsyncKeyState(VK_F6)&& g_interface) {
WCHAR mymsg[MAX_PATH];
wcscpy(mymsg, L"Hello world");
wstring msg = mymsg;
g_interface->ShowBlueNotify(msg);
}
if (GetAsyncKeyState(VK_F7)&& g_interface) {
wstring msg(L"Hello world");
g_interface->ShowGreenNotify(msg);
}
Sleep(1000);
}
}

__declspec(dllexport) BOOL __stdcall DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
// DisableThreadLibraryCalls(hModule);
CreateThread(NULL, 0, Chuong_trinh, hModule, 0, NULL);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
volysatthu is offline  
Old 06/06/2024, 17:56   #329
 
Judgelemental's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 1,532
Received Thanks: 835
Quote:
Originally Posted by ZeonNETWORK View Post
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 @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 @BA3CA0 & CGame::GetMainInstance @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 @ my reverse engineering leader and @ (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




Can you please share how you implemented the old lamps?
Judgelemental is offline  
Old 06/15/2024, 21:23   #330
 
elite*gold: 53
Join Date: Jun 2024
Posts: 12
Received Thanks: 11
This opened the way for many who wanted to improve themselves; Floria took a step on this path.
ArianaRisen is offline  
Thanks
4 Users
Reply

Tags
ussless


Similar Threads Similar Threads
[Source] Fix the old exp bar - by writing code!
05/17/2020 - SRO PServer Guides & Releases - 18 Replies
Hello beloved, dead community, its time for another release. Its more of a proof of concept and I hope it might inspire people to continue working on it. You don't need the source to accomplish cool things. Just write your own source. http://i.epvpimg.com/d7hJbab.png Ye, its super ugly looking. I choose to be a coder, not a designer. I'd be happy, if someone supplies me a proper version of the 2dt and ddj files so I can update this embarrassing screenshot. Anyway. It allows you to...
[Release/WIP]EP6 Source code
04/15/2018 - Shaiya PServer Guides & Releases - 33 Replies
Hi guys, First of all, I want to say that this release is not recommended for public servers yet. Shortly ago I changed my server to ep6 using shen1l's pet.dll, the server crashed every day, after checking the dump files I discovered that the problem was in pet.dll, but without the source code it would be harder to find the cause of the problem. So I decided to start a project and release the source code for everyone, so that everyone can solve their problems more easily, and also so that...
[C++ Source] My Free Farm Bot [WIP]
06/28/2011 - Browsergames - 0 Replies
I decided to release this on here as i have no more use for it and no intention to continue the project. I am releasing 2 projects: One basic library for mff called libmff(although it is not really a library) there is an example on how to use it in the package. And a helper with a fancy gui. Note that there is almost no error checking on the helper and that it crashes if you for example forget to select a product. You need libcurl and boost for both and GWEN(the gui toolkit by garry) for...



All times are GMT +1. The time now is 20:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.