Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Mobile [Cocos2dx] "Heroes Charge" source code (Mobile)

Joined
Aug 14, 2009
Messages
2,304
Reaction score
1,189
Here is a decoder & decompiler for *.abc files found in one of those copycat games. It's not perfect but works.

Example of Decoded & Decompiled DailyLoginReward.abc:
Code:
-- Decompiled using luadec 2.2 rev: 895d923 for Lua 5.1 from https://github.com/viruscamp/luadec
-- Command line: Debug\dailylogin.luac 

-- params : ...
-- function num : 0
local ed = ed
local class = {
mt = {}
}
-- DECOMPILER ERROR at PC5: Confused about usage of register: R2 in 'UnsetPending'

;
(class.mt).__index = class
-- DECOMPILER ERROR at PC7: Confused about usage of register: R2 in 'UnsetPending'

;
(ed.ui).dailylogin = class
local explain_text = T("\n每月累计签到天数,领取相应的签到奖励ぜ130\n\n在特定日子里,达到对应VIP等级及以上的玩家可以领取双朱28ΥŖ励!第二份奖励可以当日内升级VIP等级后补领䜱28\130\n\n注:每日签到奖励在每天的05:00计算隔天,当天未领取的奖励隔天不可以再补领䜱28\130\n\n")
local getDate = function()
  -- function num : 0_0 , upvalues : ed
  local time = (ed.getFitServerTime)()
  local date = (ed.getYMDHMS)(time)
  local d = tonumber(date.day)
  local h = tonumber(date.hour)
  local m = tonumber(date.minute)
  local s = tonumber(date.second)
  do
    if d == 1 then
      local boa = (ed.checkBOA)({h = h, m = m, s = s})
    end
    if boa ~= "after" or boa == "before" then
      date = (ed.getYMDHMS)(time - 86400)
    end
    local y = tonumber(date.year)
    local m = tonumber(date.month)
    local d = tonumber(date.day)
    return {y = y, m = m, d = d}
  end
end

class.getDate = getDate
ed.getDate = getDate
local getRewardAt = function(i)
  -- function num : 0_1 , upvalues : ed
  local date = (ed.getDate)()
  if not i then
    local y, m, d = date.y, date.m, date.d
  end
  local row = ((((ed.getDataTable)("DailyLoginReward"))[y])[m])[d]
  if not row then
    return 
  end
  local type = row["Reward Type"]
  local id = row["Reward ID"]
  local amount = row["Reward Amount"]
  local vip = row["Double Reward VIP Level"] or 0
  return {type = type, id = id, amount = amount, vip = vip}
end




If you search for "520006_397" you'll find it.

Did anybody try my "fixed" version? WireShark fameza123 Did it work for you? If not I suggest post an issue on github and I'll try and help you out. The game is actually fun, and I'd like to help people fixing & getting this working.

EDIT:
Before I forget it: The game I posted above is EXACTLY the same. Not the actual game but the download link the dude gave is the SAME SOURCE-CODE with SAME ASSETS. Nothing is different. This game here is also NOT Heroes charge. But who cares... There are about ~20 of these games released all exactly the same except for minor differences in UI and graphics. I guess one company developed the base & sold it, and others just changed the graphics. While researching I also found out that Lilith Games sued the company UCool which "developed" Heroes Charge because they "supposedly" "decompiled" and "stole" their code.. Yea right.. Decompiled a game which was made in C++ and replicated 1 to 1.. If it would be so easy :(
 
Last edited:
Joined
Jun 3, 2009
Messages
969
Reaction score
278
[/spoiler]




If you search for "520006_397" you'll find it.

Did anybody try my "fixed" version? @WireShark @fameza123 Did it work for you? If not I suggest post an issue on github and I'll try and help you out. The game is actually fun, and I'd like to help people fixing & getting this working.

EDIT:
Before I forget it: The game I posted above is EXACTLY the same. Not the actual game but the download link the dude gave is the SAME SOURCE-CODE with SAME ASSETS. Nothing is different. This game here is also NOT Heroes charge. But who cares... There are about ~20 of these games released all exactly the same except for minor differences in UI and graphics. I guess one company developed the base & sold it, and others just changed the graphics. While researching I also found out that Lilith Games sued the company UCool which "developed" Heroes Charge because they "supposedly" "decompiled" and "stole" their code.. Yea right.. Decompiled a game which was made in C++ and replicated 1 to 1.. If it would be so easy :(
Yeah I found it also its the same base source of their games UCool just changed UI and make it as Heroes Charge clear now.

Didn't try your fixed source downloading it now and got to comment on this later thanks.

 
Joined
Aug 14, 2009
Messages
2,304
Reaction score
1,189
The last 2 days I tried getting Protobuf2 to work with C#. It didn't work. So I guess I try to write a C++ library that parses the message with Protobuf c++ and call that from C#. While I was investigating the protocol the client/server uses I made a documentation for it:


This is how far I got with my C# code (Left C#, right PHP):
aDHLuQi - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums


I get as far as extracting the ProtoBuf message. But parsing it doesn't work.
 

Attachments

You must be registered for see attachments list
Joined
Jun 3, 2009
Messages
969
Reaction score
278
The last 2 days I tried getting Protobuf2 to work with C#. It didn't work. So I guess I try to write a C++ library that parses the message with Protobuf c++ and call that from C#. While I was investigating the protocol the client/server uses I made a documentation for it:


This is how far I got with my C# code (Left C#, right PHP):
aDHLuQi - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums


I get as far as extracting the ProtoBuf message. But parsing it doesn't work.
I cant see the image clearly using tapatalk app the emulator work but i cant run the webserver what is the dependencies of the webserver files i see php files may i ask if you can give a guide how does the webserver works do I need a linux based machine to run this as I see the default source webserver is running on yiiframework.

I know now I must run this with PHP and set the PHP to Environment Variables will be back here

Sorry for the noob question here

Update: My Problem now is how to compile the client? I have cocos2dx and other dependencies installed.
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Jun 3, 2009
Messages
969
Reaction score
278
Yeah I already run it thanks I need a simple guide just to recompile the client source on cocos2dx. I reference it with your release it was a clean client source.
Update: I see the client on the original release lol I didn't check it before will try it now

My Problem now I check the config.lua and set the ip to 127.0.0.1 but serverlist error



Problem Solved:

You need to config Resource_Client\version_win32.cfg to

Code:
{   
"branch" : "MAIN",   
"inStoreUpdate" : "http://www.baidu.com",   
"localVerson" : "1.000.16",   
"sever" : "http://[COLOR=#0000ff]127.0.0.1[/COLOR]/severs_dota_ios.php",   
"severBackup" : "http://[COLOR=#0000ff]127.0.0.1[/COLOR]/severs_dota_ios.php",   
"version" : 1
}


Additional Note: copy the msyh.ttf & msyhbd.ttf fonts from GigaToni repo Resource_Client paste into the Resource_Client on the Original release
 
Last edited:
Joined
Aug 14, 2009
Messages
2,304
Reaction score
1,189
Did it work for you? If not I suggest post an issue on github and I'll try and help you out. The game is actually fun, and I'd like to help people fixing & getting this working.

Please. Also post the *.log file.

EDIT:
You don't actually need to edit any *.lua files.

version_win32.cfg is already "patched" in the Repository:


Config.lua doesn't need to be modified. It gets the server IP from severs_dota_ios.php. Not from the LUA file.

EDIT2:
The only thing missing in my repository should be the *.exe file. Which you should compile yourself.
 
Last edited:
Joined
Jun 3, 2009
Messages
969
Reaction score
278
Please. Also post the *.log file.

EDIT:
You don't actually need to edit any *.lua files.
Yes only the version_win32.cfg only need to edit I did test not the lua but again I get this I try AccountID 1 2 3 not working



Game & Server logs:



Attachment not working for logs sorry
 
Joined
Aug 14, 2009
Messages
2,304
Reaction score
1,189
@WireShark Please use Github for posting any issues with my repository. Since it's the easiest way for me to track and get notified (also it helps others that stumble across my repository.).



EDIT:

Woooooohoo C++ CLI to the rescue!
ZaG2dC - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums

I finally Ducking got the sessionkey. For some odd reason the decryption of the package was done wrong, but not wrong enough for anything else to break. Just the part where the sessionkey is read :)

6bd7Zut - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums


Progress! :D
7gvVGEj - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Initiate Mage
Joined
Sep 23, 2020
Messages
6
Reaction score
1
Hello, I am from Taiwan. I saw this game you repaired. I really want to play it. Can I ask you for the repaired game? please,Thank you
 
Last edited:
Junior Spellweaver
Joined
Feb 13, 2018
Messages
106
Reaction score
12
help
Screenshot_566 - [Cocos2dx] "Heroes Charge"  source code (Mobile) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Initiate Mage
Joined
Aug 20, 2023
Messages
7
Reaction score
0
Any tutorial how to set up client? or what program need to be used to edit client? Im new of this and want make this work :D
 
Back
Top