elitepvpers

elitepvpers (https://www.elitepvpers.com/forum/)
-   Forsaken World (https://www.elitepvpers.com/forum/forsaken-world/)
-   -   Forsaken World collaboration (https://www.elitepvpers.com/forum/forsaken-world/854983-forsaken-world-collaboration.html)

vuduy 11/24/2010 07:20

Forsaken World collaboration
 
1 Attachment(s)
I am looking for help mapping the opcodes for PWE's latest game Forsaken World. It's a whole new ball game; every single code is different.

My main computer apparently can't launch the game because of its new protection not working properly on certain x64 configurations; and my other computer is too slow to be painfully working on it.

I can provide the tool for you to hook to the game client and it will dump the opcodes whenever something is sent to the server (you will need NET Framework 4.0 though); or you can grab MHS and setup breakpoints + scripts to dump manually.

Download:
- the tool can be downloaded from the attachment and it works for all PWE games.
- you will need NET Framework 4.0 to run it ([Only registered and activated users can see links. Click Here To Register...])
- you may also need MS C++ 2010 Redistributable ([Only registered and activated users can see links. Click Here To Register...])
(EDIT: I posted the MS C++ 2008 Redistributable earlier which won't work; needs the 2010 version)

Requirement:
- your own FW CB account
- some knowledge of hexadecimals and offsets will make things easier

For starters, here are some current offsets for the latest client:

Send function address = 0x7876B0
Base = 0xD14280

Self player's structure = [Base + 0x20] + 0x24

NPC hash list = [[[Base + 0x20] + 0xc] + 0x20] + 0x18
NPC sequential list = [[[Base + 0x20] + 0xc] + 0x20] + 0x48
NPC's name offset = 0x1c8
NPC's unique Id = 0x150 (8 bytes long = 64 bit) (example: 0x8000000000001A56)

Player's hash list = [[[Base + 0x20] + 0xc] + 0x1c] + 0x18
Player's sequential list = [[[Base + 0x20] + 0xc] + 0x1c] + 0x88
Player name's offset = 0x54c
Player's Id = 0x220 (also 8 bytes = 64 bit)

Loot hash list = [[[Base + 0x20] + 0xc] + 0x24] + 0x18
Loot's name = 0x1e0
Loot's unique Id = 0x130 (8 bytes)

Opcodes format:
============
Cancel = "001D"
NormalAttack = "02001C"
Select = "{0:X16}0007"
Interact = "{0:X16}0046" (engage dialog with NPC)
UseInventory = "{0:X8}00{1:X2}01000032" where {0} = item Id, {1} = inventory slot
UseEquipment = "{0:X8}00{1:X2}00000032" where {0} = item Id, {1} = equipment slot
UseSkill = "{0:X16}0102000000000000000000000000{1:X8}0020 " where {0} = target Id, {1} = skill Id

Opcodes function in C#
================+
Code:

byte[] HexToBytes(string str)
{
        if (string.IsNullOrEmpty(str) || str.Length % 2 != 0) return null;
        byte[] buffer = new byte[str.Length / 2];
        for (int bx = 0, sx = 0; bx < buffer.Length; ++bx, ++sx)
        {
                // Convert first half of byte
                char c = str[sx];
                buffer[bx] = (byte)((c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')) << 4);

                // Convert second half of byte
                c = str[++sx];
                buffer[bx] |= (byte)(c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0'));
        }
        return buffer;
}

byte[] GetOpCodes(string format, params object[] operands)
{
        try
        {
                byte[] data = (operands == null) ? HexToBytes(format) : HexToBytes(string.Format(format, operands));
                if (data != null) Array.Reverse(data);
                return data;
        }
        catch
        {
                return null;
        }
}

Example how to use:
Code:

// Selecting targets
string Select = "{0:X16}0007";
ulong targetId = 0x8000000000005001;
byte[] opcodes = GetOpCodes(Select, targetId);

// Using skill
string UseSkill = "{0:X16}0102000000000000000000000000{1:X8}0020";
ulong targetId = 0x8000000000005001;
uint skillId = 0x160;
byte[] opcodes = GetOpCodes(UseSkill, targetId, skillId);


Interest07 11/24/2010 08:24

:( don't have an account there, or I would love to have a go at it lol

Shareen 11/24/2010 15:03

Registered for CB, waiting on any email notification from them.

BuBucekTop 11/24/2010 22:15

Awaiting approval for CB. Then of cource, I'll join collaboration

BuBucekTop 12/02/2010 12:29

BTW, in your attach you've forgot PWDump.dll =/

vuduy 12/02/2010 14:52

It's embedded resource in the net assembly; should work fine. You can try it on PW.

Interest07 12/02/2010 15:32

interesting that theyre using 8 bytes long ids now... any clue as to why? :o

I can't imagine they have THAT many NPCs

vuduy 12/02/2010 16:19

They're just making it a harder time for us which is kinda stupid really; their protection is very lame and stupid; only hurt legitimate players (like me can't start the game).

At least they force me to rewrite my bot to support both 32bit and 64bit Ids in one bot.

Interest07 12/02/2010 18:10

I use XP 64bit, oh well might be in for some issues if I try that game, but I'm already used to it by now, couldn't even connect my phone to my PC cos the software didn't support my windows. Have to mail my own applications to my phone to use them *sighs*

Oh well, I'm pretty sure it won't stop anyone from doing what they want with their games, especially not you lol :D

Shareen 12/03/2010 14:23

Quote:

Originally Posted by vuduy (Post 7938305)
It's embedded resource in the net assembly; should work fine. You can try it on PW.

After selecting the process elementclient and clicking button Analyze, I get the following error dialog box(c/p):
---------------------------
elementclient (3340)
---------------------------
Unable to hook process.
---------------------------
OK
---------------------------

I have .NET Framework 4.0 and I also tried after reinstalling MS C++ Redistributable. When I say reinstall I mean "repair" because I had full installation of Visual Studio 2008 already installed and appart from remove, repair was the only option left. PWEDump analyze failed before and after with same error.

Attempted PW version was PWI 446 (current) as well as one version before current patch, numeric version of which I do not recall.

System specs are:
Windows XP 32bit (eng)
Intel Pentium 4 3.20Ghz
3070Mb RAM

Reason for reporting this issue is not my desire to use it on PW, just wanted to test if all is ok, in case I do get CB key for Forsaken World, which I have not received as of yet.

vuduy 12/03/2010 15:18

Did you get a popup about missing MSVCR100.DLL? I built the DLL in VS2010 and it's linking with this version. If you are missing this, you can google and download it and place in the Windows\System32 folder.

Other than that, I don't see any other possible problem. You can view the source code by using Reflector (free). The hooking process is straight forward.

EDIT: I gave the link to the MS C++ 2008 Redistributable by mistake on my first post; you need the 2010 version which now has the correct link.

Shareen 12/04/2010 13:58

The 2010 version of MS C++ Redistributable did the trick, it now works as it should. Thanks for the modified link.

Just for reference, no, I did not get a popup about missing MSVCR100.DLL before.

godsblight 12/26/2010 19:05

here is a dump of some things.

Code:

Analyzing process game (1316)
Found base = D107D0
Found send function address = 7876B0
12/26/2010 10:02:26 AM: 19-00-82-07-F5-C3-FE-7D-53-43-F5-45-50-C0-82-07-F5-C3-FE-7D-53-43-F5-45-50-C0-30-02-B4-03-21-01-00
12/26/2010 10:02:27 AM: 19-00-F3-DD-F5-C3-A7-C7-53-43-D7-CA-04-C0-F3-DD-F5-C3-A7-C7-53-43-D7-CA-04-C0-26-02-C3-03-21-02-00
12/26/2010 10:02:27 AM: 1A-00-C9-4D-F6-C3-A5-DE-53-43-EA-F5-98-BF-F6-03-5E-21-03-00-3A-01
12/26/2010 10:02:28 AM: 07-00-FD-04-00-00-00-00-00-80
12/26/2010 10:02:28 AM: 07-00-FD-04-00-00-00-00-00-80
12/26/2010 10:02:29 AM: 1C-00-02
12/26/2010 10:02:29 AM: 1C-00-02
12/26/2010 10:02:33 AM: 20-00-90-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-02-01-FD-04-00-00-00-00-00-80
12/26/2010 10:02:35 AM: 1C-00-0F
12/26/2010 10:02:35 AM: 20-00-91-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-02-01-FD-04-00-00-00-00-00-80
12/26/2010 10:02:36 AM: 20-00-93-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-02-01-FD-04-00-00-00-00-00-80
12/26/2010 10:02:39 AM: 1B-00
12/26/2010 10:02:40 AM: 19-00-48-CC-F6-C3-93-F9-53-43-85-0E-07-3F-48-CC-F6-C3-93-F9-53-43-85-0E-07-3F-15-02-BB-03-21-04-00
12/26/2010 10:02:40 AM: 18-00-01-00-02-50-35-11-00-00-00-00
12/26/2010 10:02:40 AM: 19-00-F1-BF-F6-C3-49-02-54-43-B6-0A-03-3E-F1-BF-F6-C3-49-02-54-43-B6-0A-03-3E-23-02-C1-00-21-05-00
12/26/2010 10:02:41 AM: 1A-00-1D-91-F6-C3-B9-21-54-43-36-F1-01-3F-4D-03-0A-21-06-00-A4-00
12/26/2010 10:02:41 AM: 1B-00
12/26/2010 10:02:42 AM: 19-00-58-0C-F7-C3-6C-CE-53-43-F6-D9-8B-3F-58-0C-F7-C3-6C-CE-53-43-F6-D9-8B-3F-FD-01-4E-02-21-07-00
12/26/2010 10:02:42 AM: 19-00-50-D4-F6-C3-71-F3-53-43-08-86-AB-3F-50-D4-F6-C3-71-F3-53-43-08-86-AB-3F-FB-01-08-01-21-08-00
12/26/2010 10:02:43 AM: 19-00-39-F1-F6-C3-D5-DF-53-43-A3-63-AB-3F-39-F1-F6-C3-D5-DF-53-43-A3-63-AB-3F-25-02-6F-00-21-09-00
12/26/2010 10:02:43 AM: 19-00-0E-1D-F7-C3-02-C4-53-43-33-78-9E-3F-0E-1D-F7-C3-02-C4-53-43-33-78-9E-3F-0F-02-B5-00-21-0A-00
12/26/2010 10:02:44 AM: 1A-00-BE-7E-F7-C3-7A-8B-53-43-4C-51-2B-3F-9D-02-D0-21-0B-00-75-01
12/26/2010 10:02:47 AM: 1B-00
12/26/2010 10:02:47 AM: 1A-00-CA-99-F7-C3-4E-7A-53-43-36-BD-69-3F-06-03-8D-21-0C-00-6D-00
12/26/2010 10:02:47 AM: 1B-00
12/26/2010 10:02:47 AM: 1A-00-D0-7E-F7-C3-70-8B-53-43-36-62-2B-3F-05-03-BE-21-0D-00-6D-00
12/26/2010 10:02:48 AM: 1B-00
12/26/2010 10:02:48 AM: 1A-00-BE-88-F7-C3-E6-86-53-43-83-9D-17-3F-0C-01-B3-21-0E-00-6A-00
12/26/2010 10:02:48 AM: 1B-00
12/26/2010 10:02:49 AM: 1A-00-D3-7E-F7-C3-6E-8B-53-43-2C-63-2B-3F-B2-00-DA-21-0F-00-9F-00
12/26/2010 10:02:51 AM: 1F-00-A9-07-00-00-02-01-02-40-FE-10-00-00-00-00
12/26/2010 10:04:05 AM: 18-00-01-00-02-70-26-11-00-00-00-00
12/26/2010 10:04:26 AM: 18-00-01-00-02-D0-CE-0E-00-00-00-00
12/26/2010 10:04:28 AM: 51-00
12/26/2010 10:04:28 AM: 18-00-01-00-02-50-C6-0D-00-00-00-00


Rask_of_Shadows 02/06/2011 16:11

Vuduy what all do you need? I'd be glad to help but do you just want me to record and dump it here? Or are you looking for specific stuff?

vuduy 02/06/2011 17:01

Anything that is useful. Example, cast skills, get the dump and formalize the opcodes; different type of skills may have different opcodes eg. instant cast skill (no cast time) vs normal cast skills.

Also get opcodes for summoning/stowing pets, feeding pets, and any other activities with pets.

Get opcodes for inventory item usage, like using pots, using mounts, or any other special items.

Get opcodes for buying, selling, repairing.

Also, find data offsets like HP, MP, level, gender, etc... all the useful properties for NPC, player and provisions.

serahah 02/14/2011 23:00

Quote:

Originally Posted by Shareen (Post 7951718)
Reason for reporting this issue is not my desire to use it on PW, just wanted to test if all is ok, in case I do get CB key for Forsaken World, which I have not received as of yet.

heck [Only registered and activated users can see links. Click Here To Register...] . they still have alot of beta keys for free

Shareen 02/15/2011 17:10

Thank you serahah, I wasn't aware of this giveaway before and I really wish I was, beacuse in the mean time, while I had nothing to do (after PW MS got shut down), I went and found my fix in EVE Online.

While injecting Python isn't exactly what I was hoping for, it keeps me busy these days, so I'll stick with it for a little while longer, before I "go back" to FW.

vuduy 02/23/2011 23:01

Public closed beta starts today. Let the cracking and hacking begins!

On a side note, it's better to use SINS 2.1.x to get data. It has the same packet capture and it also supports memory snapshot. Will be easier to find offsets.

alaor 02/26/2011 04:23

w8 for us work... =]... im playing beta 4

kd5eej350 03/03/2011 04:11

Reporting in, PW/FW player since CBT of PW. Some may recognize my name, I hope, I like to feel important.

I have a small IRC server we can use to colab if need be.

vuduy 03/03/2011 06:28

Well, so far, nobody contributes anything; and my bot supports FW almost 100%.

The few things still missing are some pet's offsets and quest list/structures.

It seems like most of the pet's information is stored in a packed bits of some sort. I can get the offset for the data whenever information changes; but I still cannot decode it.

kd5eej350 03/03/2011 10:04

FW seems to lock up each time I search what accesses an address for some reason, PW never did that and it's basically the same game reskinned and retooled.

Not sure if i'm missing something, been out of the loop for a while.

vuduy 03/03/2011 22:36

Its built in anti-hack does that. Basically, it searches the process list for cheatengine.exe, and any other popular debuggers including Olly and Visual Studio (devenv.exe). If any of these processes exist, then it locks up.

Try putting a break point will also terminate the client. It's not as easy compared to other PWE games.

Soma-Atlasia 03/10/2011 19:05

I want to see a pserver of this game so I'll try to see what I can pick up with MS Network Monitor. Be advise, I'm a total noob doing this kind of stuff so if anything I send is helpful, let me know.

Sᴡoosh 03/10/2011 21:36

It wouldn't be helpful.

Packets are ARC4 encrypted, so monitoring them with a external tool would be useless.
Also, building a pserver requires :

a) leaked server files (PW's newest leak was 1.2.8 server)
b) an emulator

and I doubt both will ever happen for FW.

sweetlady 03/13/2011 05:49

Quote:

Originally Posted by vuduy (Post 9422689)
Its built in anti-hack does that. Basically, it searches the process list for cheatengine.exe, and any other popular debuggers including Olly and Visual Studio (devenv.exe). If any of these processes exist, then it locks up.

Try putting a break point will also terminate the client. It's not as easy compared to other PWE games.

Then if I may ask how can I reverse the game. Even tried with Olly's IsDebuggerPresent plugin but still won't work. Well, was able to attach IDA's debugger but didn't seem to do any good either. My computer got really slow.

saya4 03/13/2011 11:25

hey if someone also play beta add me as friends im on the german realm my name is nazrezim and im in the guild Scrubs a guild with much people from the old ms.

Sᴡoosh 03/13/2011 12:44

Sweetlady,

A friend of mine said that FW uses Armadillo packer, which may explain why you cannot attach any debugger to it.

I never checked, as I have no interest in FW (will be same cash shop shit as PW in a few months), but maybe this helps ya.

Cheers

micecats 03/13/2011 13:48

It's easily bypassable, using kernelmode's CE debugger is enough.

sweetlady 03/14/2011 01:02

Thank you both 2981611 and micecats. I'll take a look at it tonight after work or tomorrow. I haven't really played much but I'm sure it's already a cash machine so that's why I wanna reverse it as much as my brain cells allow me and make a bot for it.

Cheers :mofo:


Edit1: My system does not support DBVM :(
Only works on Intel CPU.

Edit2: Olly Advanced did the trick for olly which is really great. Also found some plugins for IDA too but when I attach after a couple of seconds I can't select a mob or npc. But still can't use CE. Is there a MHS kernel mode debugging?

Anyway, IDK how you were able to retrieve all those offsets, it all seems too complicated and time consuming for me. PWI was much easier.

sweetlady 03/17/2011 19:52

Bump!!;)

micecats 03/18/2011 00:11

Quote:

Originally Posted by sweetlady (Post 9603048)
Edit1: My system does not support DBVM :(
Only works on Intel CPU.

Use VMWare with a 32 bit OS

Edit : Anybody playing on EU server ?

sweetlady 03/19/2011 19:02

Quote:

Originally Posted by micecats (Post 9658133)
Use VMWare with a 32 bit OS

Edit : Anybody playing on EU server ?

I actually have Windows 7 64 bits installed. But gonna give it a try. Thanks a lot Mice. I've installed VMware workstation and player but I still don't understand how to use this. I need to install a new OS to use on VM. That's not what I want.

erezmaster 03/20/2011 17:31

AutoIt seems to work just fine to form a basic bot,
my problem is that i never managed to detect when a mob dies,
so the bot will move to the next one..

If you found smtin that I didnt, maybe you can take my idea and develop it further :)

sweetlady 03/20/2011 18:13

K, I've installed VMWare with Windows 7 32 bit. Created a shared folder to my C; drive so I can access the game and CE. But when I attach CE's debugger it still crashes the game.

micecats 03/21/2011 01:29

Quote:

Originally Posted by erezmaster (Post 9703054)
AutoIt seems to work just fine to form a basic bot,
my problem is that i never managed to detect when a mob dies,
so the bot will move to the next one..

If you found smtin that I didnt, maybe you can take my idea and develop it further :)

You can read pixel from Mob's bar, if it's not there, then move to another mob, or read value from target's address (probably boolean 1 when targeted 0 when nothing), I'll look into it, when I have time.

Quote:

Originally Posted by sweetlady (Post 9703899)
K, I've installed VMWare with Windows 7 32 bit. Created a shared folder to my C; drive so I can access the game and CE. But when I attach CE's debugger it still crashes the game.

Win7 is well known to have a lot of problems with CE, you should have installed XP on your VMWare instead.

sweetlady 03/21/2011 19:20

Quote:

Originally Posted by micecats (Post 9710039)
Win7 is well known to have a lot of problems with CE, you should have installed XP on your VMWare instead.

Dang, gonna see if I still have an xp disc somewhere. Thx Mice

Edit 1: Well, the cracked xp I have installs fine when you boot from disc, format and install. But on a VM it asks for the cdkey. I'm so lucky. Guess I'll have to stick to olly only.

sweetlady 03/23/2011 18:53

Well, LordPE confirmed it's Armadillo 1.71.

Sᴡoosh 03/23/2011 19:34

Now Called Winlicence.
Cool, my friend was right.

sweetlady 03/24/2011 01:34

This whole unpacking stuff is quite new to me. Althought I'm able to attach olly and IDA I'm still not able to attach CE or MHS's debugger. It's all quite frustrating.

This might be a really stupid question but is it legal for a game's protection software to run parts of it's code in kernel mode? And I quote from winlicense site: ''WinLicense runs parts of its code in Kernel Mode to implement the most advanced techniques against modern cracking, making it a unique protector.''


All times are GMT +2. The time now is 15:41.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.