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

09/01/2019 13:01 florian0#91
Quote:
Originally Posted by cuoinuamieng View Post
How can i get the current character after login ?
The code didn't make it into the main branch, yet:
[Only registered and activated users can see links. Click Here To Register...]

Code:
if (g_pCICPlayer ) {
  printf("Player Name is: %S\n", g_pCICPlayer ->m_charname.c_str()); // Edit: Added c_str here, oops
}
The "if" is somewhat important since the player object seems to be 0 while teleporting, sometimes.
09/02/2019 12:45 sarkoplata#92
I don't know class names or anything, or why this works:
Code:
reinterpret_cast<wchar_t*>(0x00EEDAC0)
can it be g_pSelfCharname something?
09/03/2019 08:52 cuoinuamieng#93
Playername is nulled , level and str int is true , may i missing something or wrong type ?
[Only registered and activated users can see links. Click Here To Register...]
09/03/2019 18:31 florian0#94
Quote:
Originally Posted by sarkoplata View Post
I don't know class names or anything, or why this works:
Code:
reinterpret_cast<wchar_t*>(0x00EEDAC0)
can it be g_pSelfCharname something?
This is the selected character from CPSCharacterSelect selection animation. Looks safe to use to me.

Quote:
Originally Posted by cuoinuamieng View Post
Playername is nulled , level and str int is true , may i missing something or wrong type ?
If you were using the code from above, there was a mistake. It should have been
Code:
g_pCICPlayer ->m_charname.c_str()
09/13/2019 03:12 Raymond*#95
Amazing job bro, keep it up.
12/24/2019 14:21 florian0#96
Hello my beloved copy-paste squad,

one year has passed since the initial release. So it's time for something new"[Only registered and activated users can see links. Click Here To Register...]". I hope @[Only registered and activated users can see links. Click Here To Register...] will give this one a proper rating as well.

I always wanted to have a proper example window to show how the library can be used. So I decided to reverse engineer the single most window nobody is interested in:

The chat window
(Dramatic: Dam dam dam ...)

I reverse engineered the chat. Not all of it, yet. But enough to keep me busy a for whole year.
We know have:
  • Networking support: You can now send packets to the server
  • Scroll-Bar behaviour: Attach a scrollbar to a textbox (probably also works with other lists)
  • Proper code to write anything to the chat
  • Did someone say "Item linking"?
  • A lot of example code on how to work with Silkroad's UI

Where's the code, bro?

It's not merged yet, therefore you can only find it here:
[Only registered and activated users can see links. Click Here To Register...]

IFChatViewer.h: [Only registered and activated users can see links. Click Here To Register...]
IFChatViewer.cpp: [Only registered and activated users can see links. Click Here To Register...]

Merry christmas, copypasters
florian0
12/29/2019 07:16 qoaway#97
Quote:
Originally Posted by Frukio92 View Post
Did you find the solution?
How do I change places automatically when every resolution changes?
you must hook the d3d reset event and calculate new positions based on client rect
12/29/2019 08:26 kanift#98
Quote:
Originally Posted by Frukio92 View Post
Did you find the solution?
How do I change places automatically when every resolution changes?
u can do it as shine said or u can hook CGInterface__Resize(0x39F030) RVA and do it whenever client has to do it

Code:
void GetWindowSize(int* width, int* height)
{
	DWORD dwBase = reinterpret_cast<DWORD>(reinterpret_cast<void*(__cdecl*)()>(MAKE_RVA(0xF9CD0))());
	*width = *reinterpret_cast<int*>(dwBase + 0x24);
	*height = *reinterpret_cast<int*>(dwBase + 0x28);
}

CGInterface__Resize_Hook(void* pCGInterface)
{
	int width, height;
	GetWindowSize(&width, &height);

	CIFWnd* pCIFMinimap = GetIFWnd(pCGInterface, 10, 1);
	pCIFMinimap->SetPosition(width / 2, height / 2);
}
im pretty sure that this project has GetIFWnd and SetPosition equivalent and with my example above, u will be set the minimap to center of the window when the resolution changed
12/29/2019 18:13 #HB#99
Code:
#define CLIENT_SCREEN_WIDTH (*(int*)0x00ED7CB8)
#define CLIENT_SCREEN_HEIGHT (*(int*)0x00ED7CBC)

void CIFFacebookGuide::ResetPosition()
{
	USHORT PosX = 0, PosY = 222;
	PosX = CLIENT_SCREEN_WIDTH - 85;
	this->MoveGWnd(PosX, PosY);
}
12/29/2019 21:04 #HB#100
You shall trigger the function after changing resolution.
01/03/2020 07:00 concucu#101
...
01/15/2020 09:59 concucu#102
...
01/15/2020 13:12 florian0#103
GetResObj returns an CIFWnd-pointer by default. This is the base type. For all UI types.
CIFStatic is a CIFWnd, but CIFWnd is not a CIFStatic. Assigning an CIFWnd-pointer to a CIFStatic-pointer would be an upcast (since CIFWnd is the parent and CIFStatic the derived class). So this wont work.
Since we KNOW (or at least hope) which type will be returned from GetResObject, we can use the reinterpret_cast-pry bar and make it a CIFStatic:
Code:
CIFStatic* label = reinterpret_cast<CIFStatic*>(wnd->m_IRM.GetResObj(13, 1));
Since this code is ugly, I made another version which casts it to the given type internally. Functionality is the same, but code is shorter and more readable.

Code:
CIFStatic* label = wnd->m_IRM.GetResObj<CIFStatic>(13, 1);
There are plenty of occurrences to use as examples:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
01/18/2020 19:58 Frukio92#104
how can i color any post
do you know? @[Only registered and activated users can see links. Click Here To Register...]
01/29/2020 07:53 concucu#105
Quote:
Originally Posted by Frukio92 View Post
how can i color any post
do you know? @[Only registered and activated users can see links. Click Here To Register...]
edit on resinfo -> your file

@[Only registered and activated users can see links. Click Here To Register...]
Can you make an example of a list in the UI?
We can
- Display a list
- Select an object from the list

thank you