Jump to content

MasterToma

Members
  • Posts

    158
  • Joined

  • Last visited

  • Days Won

    5
  • Feedback

    100%

Everything posted by MasterToma

  1. Looks like we lost and talking about different things. I really understand, that if there are only &&, no point in extra bracers... belive me, because I've decompiled most of L2, and it works (including NASC itself). But this info about extra scope () is present in ai.obj. I posted examples, where you can see the difference. I posted the difference in pastebin. NASC generates DIFFERENT code for (a && (b && c)) and for (a && b && c). But decompiler restores them in SAME way - no bracers. I don't know how to be more clear. I have two concerns about it. First - messed diff. I can't compare original and recompiled objs due to much more trash. Second - there is might be some weird context, which might lead to bug. OK, never-mind, you did great job anyway. I have at least two more bugs apart this: 1. some jump is just missed. Have no idea, but in original class's obj there is just 1 more jump instruction. I can't say nothing concrete, because diff produces too much mismatches due to my previous point. Could you just add those bracers? Or point me the function and I'll fix it by my own maybe :) 2. in some classes (e.g. pet_manager_martin) push_event // i5 push_const 212 add instead of push_reg_sp fetch_i
  2. I sent you ai.obj from C1. Being decompiled (bracers are missed) and compiled back, ai.obj with mixed and/or is produced. I pasted in my recent posts. I have about 35 classes with such case. You can check drunkard_treaf for instance
  3. I've compiled your code with C1 NASC. Left - no bracers, right - with bracers.
  4. I think, I've provided it in recent post. Both, script code and 2 obj. results (links to pastebin)
  5. Okay then... so as I told, nested bracers change resulted ai.obj Try this one (output https://pastebin.com/6Su1S470) EventHandler TALK_SELECTED(talker) { if ( HaveMemo(talker, @trial_of_scholar)==1 && OwnItemCount(talker, @dieters_diary) >= 1 || OwnItemCount(talker, @scripture_chapter_1) >= 1 || OwnItemCount(talker, @strong_liquor) >= 1) { AddChoice(0,"Mention what Raut said"); } } and with additional bracers EventHandler TALK_SELECTED(talker) { if ( HaveMemo(talker, @trial_of_scholar)==1 && (OwnItemCount(talker, @dieters_diary) >= 1 || OwnItemCount(talker, @scripture_chapter_1) >= 1 || OwnItemCount(talker, @strong_liquor) >= 1)) { AddChoice(0,"Mention what Raut said"); } } https://pastebin.com/JL3sWgyz (output) Scroll to the end in pastebin, to see the difference The same in complex cases with + and * Take into account, that NASC is actually simple stream translator, so it doesn't have (almost) context like AST. It translates line by line (with special handling of loops and if/else)
  6. I never used shitty NASC decompilers :D No, Scripts from C0 were leaked. Real one with comments, etc. You should know it. Okay, I will find good example, where OBJ code differs. Or if you don't want to hear about bugs, just say it clearly ;) I'm comparing two obj's with diff, so code differs... And Im trying to find good example, like with modulo
  7. I understand it. But some of cases might like like with modulo. I wouldn't noticed difference in if (a && c || d) if NASC would generated same code. Could you please also add bracers for all nested expressions? According to leaked code, all nested expressions have (). I'm not sure about such thing as precedence in script-engine, I could show you their VM code, where arguments only taken from stack in such and order in which compiler pasted them. And NASC pasted them in opposite order :) (as I wrote in recent post)
  8. I've noticed the same with nested &&. Original pseudo-code if (a && (c && d)) after decompilation will be if (a && c && d) Which is OK. But some times not: if (a && (c || d)) goes into if (a && c || d) Trying to find some nice example...
  9. Ok, now it works. Another bug with operator precedence. For instance, look at blacksmith_duning (code is too large). Here is how it should look like: fetch_i push_const 10 mod mul greater_equal else if(reply == 6) { if (OwnItemCount(talker, @q_gold_wyvern) >= (4*(talker.param2 % 10))) { DeleteItem1(talker, @q_gold_wyvern, 4*(talker.param2 % 10)); talker.param1 = talker.param1+((Rand(3)+1)*16); } else ShowPage(talker, "blacksmith_duning_q0336_10.htm"); } Note about two points 1. (4*(talker.param2 % 10)) 2. ((Rand(3)+1)*4) Decompiler generates } else if (reply == 6) { if (OwnItemCount(talker, @q_gold_wyvern) >= 4 * talker.param2 % 10) { if (GetCurrentTick() - talker.quest_last_reward_time > 1) { DeleteItem1(talker, @q_gold_wyvern, 4 * talker.param2 % 10); talker.param1 = talker.param1 + (Rand(3) + 1) * 4; talker.param1 = talker.param1 + (Rand(3) + 1) * 16; } } else { ShowPage(talker, "blacksmith_duning_q0336_10.htm"); } 1. 4 * talker.param2 % 10 2. (Rand(3) + 1) * 4 While point #2 in THIS case is not crucial (but in other cases it might be crucial), point #1 is for sure wrongly decompiled - extra () are missed and cause wrong calculation, which will be fetch_i mul push_const 10 mod greater_equal
  10. Everything is inside archive under the link, which I posted. Here it is again: https://drive.google.com/file/d/1WZx4FGF_FrkAOkem3bC8Stdd3Y--ixUj/view Decompiled code looks is class guard_babenco : guard_fixed { handler: EventHandler TALK_SELECTED(talker) { if (_from_choice == 0) { if (HaveMemo(talker, @path_to_elven_scout) == 1 && GetMemoState(talker, @path_to_elven_scout) == 1) { _choiceN = _choiceN + 1; _code = 0; AddChoice(0, "询问有关废墟的事"); } if (_choiceN > 1) { ShowChoicePage(talker, 1); return; } } if (_from_choice || _choiceN == 1) { if (_code == 0) { if (_from_choice == 0 || HaveMemo(talker, @path_to_elven_scout) == 1 && GetMemoState(talker, @path_to_elven_scout) == 1) { ShowPage(talker, "guard_babenco_q0407_01.htm"); } } return; } super; } } There is some mess with _from_choice. Tonight I will try to decompile it manually.
  11. push_reg_sp fetch_i is missed in files from the link, which I posted. Also two jumps at the end jump L23975 jump L23982 L23977 L23982 L23975 shift_sp -1 I think, there is no "no op" operands, and those lines are simply missed from the decompiled/compiled code. Doesn't look good for me. Also, shift_sp -1 is called before exit_handler(). So, caller will receive not-shifted stack I will post second difference, when find some smaller handler for it, right now there are about 30kb obj files
  12. After adding C1 support, I've compared all ai.obj from original one, and after decompilation/compilation. There is bunch of classes (about 15 of them of 2200) with 2 significant differences. Here is one example of 1 style of difference. Could you check, what's the problem here? https://drive.google.com/open?id=1WZx4FGF_FrkAOkem3bC8Stdd3Y--ixUj Most probably the same thing is in other chronicles, since looks like it's related with some nested if() conditions
  13. Okay, I've found some error root-causes (if talking about C1-package from PP and smeli) . Few variables were present with same offset in original C1, but have another names. So, in your script files (ai_macro.txt, ai_script.txt and questdata.txt) you have to change m_bIsPledgeMaster -> is_pledge_master m_nResidenceId -> residence_id m_nPledgeId -> pledge_id and remove all int residence_id = 0; (probably it was a work-around, related with wrong name). About all other errors, I will figure out, when all L2NPC.exe will be decompiled. Probaby there are some functions in script
  14. @zconll, tnx a lot for the feedback! Indeed, this part of code haven't been revealed. Ofc, it's a bug in decompiled sources. I fixed it and re-uploaded newest version.
  15. Tnx for C4 scripts. I'll check them! Yes, ofc. I re-uploaded release version with static c-runtime, so no redist is needed. Thx for note!
  16. No, I mean AI scripts in NCSOFT scripting language. Code like this: class my_ai { handler: EventHandler CREATED() { if( ShoutMsg1 > 0 ) { Shout(MakeFString(ShoutMsg1,"","","","","")); } if( MoveAroundSocial > 0 || ShoutMsg2 > 0 || ShoutMsg3 > 0 ) { AddTimerEx(1001,actInterval); } } } This one is passed as an input to the NASC to get ai.obj. Probably someone has them in private (decompiled with sauron's C4 decompiled and fixed manually)
  17. Hi, As far as yo know, there was only nc.exe for C0, which was patched by kvoxi to be compatible with C1. However, it has few bugs (some offsets are wrong, for meal for example). So I've decompied NASC for C1. It took me only 3 days, since everything is inside 1 function (apart yacc modules and NPC-related data, which was decompiled in scope o L2NPC.exe), which is about 2200 lines long. It's original compilator from C1, which is built inside L2NPC.exe. Feel free to use it. However, custom C1 Script code won't compile, you will get errors for missed fields: field[m_nNPC_clan_id] doesn't exist field[m_nBuilderLevel] doesn't exist field[curslot] doesn't exist field[m_bIsOnline] doesn't exist field[m_bIsPledgeMaster] doesn't exist field[m_bIsNPC_in_Clan] doesn't exist field[m_nPledgeId] doesn't exist field[m_nResidenceId] doesn't exist field[m_nMountType] doesn't exist field[feet_uid] doesn't exist field[head_uid] doesn't exist field[exp] doesn't exist field[m_Direction] doesn't exist field[sex] doesn't exist field[m_bIsRunning] doesn't exist I know, that it's very easy to fix, but my goal is to provide ORIGINAL C1 compiler. For those, who need just tweaked one, might use kvoxi's mode. C1 sources are very similar to C4 ones, where actually only error diagnostic was improved, and few more changes in ai.obj out were added. But to test C4 I need a C4 scripts. If someone could share them, then I can decompile and build C4 compilator. PS: It's x64 version
  18. I think, format for add_string is a bit incorrect. Types are enum OperandType { Invalid = 0, Int = 1, Float = 2, Double = 3, String = 4 }; Taking into account that format is format_id = rtype | (ltype << 8) We will get Int + String = 256 + 4 = 260 Float + String = 512 + 4 = 516 Double + String = 768 + 4 = 772 String + Int = 1024 + 1 = 1025 String + Float = 1024 + 2 = 1026 String + Double = 1024 + 3 = 1027 String + String = 1024 + 4 = 1028
  19. Well, posting updates still attract people. Each month someone gives code and brings back some value.
  20. When I noticed, that at least 3 people used my code for commercial purposes without notices and without sharing modifications. One Greek server has my L2Auth modified, all others are private and unknown. I think, it's a bit unfair :) I would share it for those, who give me something back. Fixing compilation warnings, making some improvements, etc. BTW, thanks for bumping. My status about L2NPC.exe: 80% is decompiled in IDA (all variables, methods, structures, offsets, stack types, etc) 66% is in code right now ALL parsers are decompiled and tested (for npcpos, categories, ai.obj etc) NASC virtual machine is on 50% completion state NASC-C1 compilator is on 66% completion state I suppose to finish L2NPC.exe and NASC for C1 (for those, who might not now - there is no leaked C1 NASC, but C1 NASC is embedded inside L2NPC.exe) till the end of summer As usual, any help is welcome. But recent months about 30 people only got my code, but didn't do anything back. So I share it pretty carefully now.
  21. Wow, it's just great!! PS: old-post-pacific advanced users, PM me if you want join. I almost completed L2NPC decompilation (including script engine and NASC),
  22. Hi all, new heroes are needed! I'm decompiling L2NPC.exe, and have gone so far for now (ai.obj parsing is decompiled, which is a great success). But I know, that you want to get sources and contribute some how. For those of you: only c++ knowledge are needed (no decompilation). We need to port L2Auth, L2LogD and CacheD to Linux. So, all WinAPI has to be switched to c++: Critical section - to std::mutex Interlocked* to atomic Unicode string conversions to std::wstring_convert PM me with your Skype account, I'll send you needed modules, and when the work is done, you will receive all sources
  23. See first post. Repo was in public for year. Right now it's "help-to-get" model. Anyone can join, contribute and get access to the code. Many people already have this done. BTW, L2NPC is decompiled on 15% already. It connects to LogD and CacheD, and has all infra ready.
  24. CacheD has been completely decompiled. 100% original code restored. Tested with C1 server, as well as with SINA extenders. Also, CacheD has been ported to x64 as well. L2NPC is the next one!
  25. Just finished porting L2Auth for x64. Job was tricky, but it works! LogD and L2CacheD x64 porting is coming soon. Next step - cross-platform build, to be able to run on Linux. It means - cheaper hosting, more powerful server administration tools and more resources available for L2 server! Meanwhile, there is parallel activities on decompilation L2Server and L2NPC server. We still need contributors for porting Windows IO Completion Ports to boost::asio. If you are skilled enough, just PM me, and when task is done, you will have access to our repo with all WORKING source codes, 100% original (legacy branch) and modified (other branches)
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock