AngryHank / Lin2RevJunk

21 stars 15 forks source link

L2RPackReader has stopped working [Crash] #2

Closed LordAzuRa closed 5 years ago

LordAzuRa commented 6 years ago

Your Packet Reader has been an absolute time saver for me on L2R Global (US) but it has unfortunately been crashing for the last month or so, it seems an update triggered the issue. I am running L2R through Bluestacks.

Is there any fix planned for it? Find attached the message and state of the command prompt when the crash occurs.

l2rpacketcrash

AMiniLegend commented 6 years ago

I believe the fix for this was reading a single byte more, after the introduction string in PktGuildMemberListReadresult.cs. It looks like he's already fixed it though.

LordAzuRa commented 6 years ago

I still have the same crash after grabbing the latest version :( It happens as soon as I press Enter to stop it.

AMiniLegend commented 6 years ago

Are you building from the source? I don't believe the one that's built is the current version, so it wouldn't have the fix in it.

LordAzuRa commented 6 years ago

Ahhh no, I'm a noob when it comes to that. I did try and grabbed the proper VS version but when I tried to compile the project I was plagued with multiple errors that I am unable to troubleshoot. I wish he did submit a fixed compile version :(

AMiniLegend commented 6 years ago

It looks like he's updated the executable. If it works for you, you can probably close this issue.

Moxer81 commented 6 years ago

I have the same issue when I try to grab my clan memberlist. I get the same error:

2018-06-25_4-50-07

I noticed that it happens with my clan, and other clans when checking members from ranking list, while some clans members lists were completed without the error. Maybe something with name string lengths or something similar? Could this be solved?

AMiniLegend commented 6 years ago

I may have had this issue earlier. If it is the same one, I added a sleep in the loop for the guild member list function, and I haven't seen the issue since.

Moxer81 commented 6 years ago

Could you elaborate how to do this? I understand you edited this on the source but actually I have no experience with it, I use the executable file in tools.

On Tue, 26 Jun 2018, 18:52 AMiniLegend, notifications@github.com wrote:

I may have had this issue earlier. If it is the same one, I added a sleep in the loop for the guild member list function, and I haven't seen the issue since.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AngryHank/Lin2RevJunk/issues/2#issuecomment-400386620, or mute the thread https://github.com/notifications/unsubscribe-auth/AmrMrY6n9xZS7QTRx1C_JQK2G0jLbCyiks5uAmaxgaJpZM4TV2Qa .

AMiniLegend commented 6 years ago

Try adding "System.Threading.Thread.Sleep(10);" (without quotes) on line 58 of the file "PktGuildMemberListReadresult.cs" in "SourceFiles/L2RPacketReader/L2RPacketReader/L2RPacketReader/Parser/Parsers/". Then rebuild the tool.

To rebuild it you'll need Visual Studio 2017 (Community edition). You open the solution file (.sln) and go to Build->Build Solution. The output will be in the bin folder of the source location.

FWIW, I don't know if that will fix the issue for you.

patotskiy commented 6 years ago

Can someone create PR with fix for:

Unhandled Exception: System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer.
Parameter name: bytes
   at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
   at L2RPacketReader.PacketReader.ReadString()
   at L2RPacketReader.Parser.Parsers.PktChatGuildListReadResult.Packet(PacketReader packet)
   at L2RPacketReader.Parser.Handler.Parse(PacketReader packet, UInt16 packetID)
   at L2RPacketReader.RecordPackets.AppendIncomingData(Byte[] payloadData)
   at L2RPacketReader.RecordPackets.PacketCapturer(Object sender, CaptureEventArgs e)
   at SharpPcap.LibPcap.PcapDevice.SendPacketArrivalEvent(RawCapture p)
   at SharpPcap.WinPcap.WinPcapDevice.SendPacketArrivalEvent(RawCapture p)
   at SharpPcap.LibPcap.PcapDevice.PacketHandler(IntPtr param, IntPtr header, IntPtr data)
   at SharpPcap.LibPcap.LibPcapSafeNativeMethods.pcap_dispatch(IntPtr adaptHandle, Int32 count, pcap_handler callback, IntPtr ptr)
   at SharpPcap.LibPcap.PcapDevice.CaptureThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

After rebuilding from sources is faced with problem:

PacketID: 25D Length: 44 Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Patotsky\Packets\PktSkillStartNotify(44).dat'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at L2RPacketReader.Parser.HandlerINT.TypePacket(PacketReader packet, UInt16 packetID) in C:\Users\Patotsky\Downloads\Archives\Lin2RevJunk-master\Lin2RevJunk-master\SourceFiles\L2RPacketReader\L2RPacketReader\L2RPacketReader\Parser\HandlerINT.cs:line 4990 at L2RPacketReader.RecordPackets.ParsePacket(PacketReader packet) in C:\Users\Patotsky\Downloads\Archives\Lin2RevJunk-master\Lin2RevJunk-master\SourceFiles\L2RPacketReader\L2RPacketReader\L2RPacketReader\Program.cs:line 139 at L2RPacketReader.RecordPackets.AppendIncomingData(Byte[] payloadData) in C:\Users\Patotsky\Downloads\Archives\Lin2RevJunk-master\Lin2RevJunk-master\SourceFiles\L2RPacketReader\L2RPacketReader\L2RPacketReader\Program.cs:line 117 at L2RPacketReader.RecordPackets.PacketCapturer(Object sender, CaptureEventArgs e) in C:\Users\Patotsky\Downloads\Archives\Lin2RevJunk-master\Lin2RevJunk-master\SourceFiles\L2RPacketReader\L2RPacketReader\L2RPacketReader\Program.cs:line 94 at SharpPcap.LibPcap.PcapDevice.SendPacketArrivalEvent(RawCapture p) at SharpPcap.WinPcap.WinPcapDevice.SendPacketArrivalEvent(RawCapture p) at SharpPcap.LibPcap.PcapDevice.PacketHandler(IntPtr param, IntPtr header, IntPtr data) at SharpPcap.LibPcap.LibPcapSafeNativeMethods.pcap_dispatch(IntPtr adaptHandle, Int32 count, pcap_handler callback, IntPtr ptr) at SharpPcap.LibPcap.PcapDevice.CaptureThread() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

AMiniLegend commented 6 years ago

For the source error, you need to copy the "Packets" folder that's in the already-built executable's folder, into your debug/release folder in the source folder

Moxer81 commented 6 years ago

Yeah figured that out! and it works like a charm since then. Thanks alot for your great help and sorry for the late reply

On Wed, 18 Jul 2018, 18:42 AMiniLegend, notifications@github.com wrote:

For the source error, you need to copy the "Packets" folder that's in the already-built executable's folder, into your debug/release folder in the source folder

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AngryHank/Lin2RevJunk/issues/2#issuecomment-405997574, or mute the thread https://github.com/notifications/unsubscribe-auth/AmrMrfH0OKQdPgPTlU-2rW0ghrR2Hum-ks5uH2VkgaJpZM4TV2Qa .

patotskiy commented 6 years ago

@AMiniLegend Could you please point me where is "Packets" folder located?

Or I do not understand something :-) I faced with issue: Could not find a part of the path ... \L2RPacketReader\L2RPacketReader\L2RPacketReader\bin\Debug\Packets\PktNpcMoveNotify(34).dat'....

AMiniLegend commented 6 years ago

I just looked at it again, and you don't actually need to copy anything. Just make a new folder called "Packets". I think the problem is that the folder doesn't exist, so it can't write the files correctly.

patotskiy commented 6 years ago

@AMiniLegend Thanks!! And final question, how to convert dat file to csv? Previously, this was done automatically. Or latest source code is draft and still in development?

AMiniLegend commented 6 years ago

The dat file is different from the csv file. The dat file contains the packet data from when you run the tool, so you don't need to make those. The csv files come from the other tool (decrypt) and from the game data, but those should already exist somewhere, so you shouldn't need to decrypt those files unless you want the latest ones.

patotskiy commented 6 years ago

In this case I don't understand why my output folder is empty :)

AMiniLegend commented 6 years ago

What data are you trying to collect? I'm not sure what the tool has enabled, but I think you should be able to get guild member data, if you have the tool running and go to Clan->Clan->Members

AMiniLegend commented 6 years ago

If you're building from the source, you'll have to un-comment the ".Packet(" lines you want from the HandlerInt.cs file, since all of the functions are disabled.

patotskiy commented 6 years ago

@AMiniLegend Thanks a lot for your help! It's hard to understand C# when you write on java

AMiniLegend commented 6 years ago

No problem, I hope you get it working.

patotskiy commented 6 years ago

@AMiniLegend After latest release I faced with issue which was mentioned above:

Unhandled Exception: System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer.
Parameter name: bytes
   at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
   at L2RPacketReader.PacketReader.ReadString()
   at L2RPacketReader.Parser.Parsers.PktGuildMemberListReadresult.Packet(PacketReader packet)
   at L2RPacketReader.Parser.Handler.Parse(PacketReader packet, UInt16 packetID)
   at L2RPacketReader.RecordPackets.AppendIncomingData(Byte[] payloadData)
   at L2RPacketReader.RecordPackets.PacketCapturer(Object sender, CaptureEventArgs e)
   at SharpPcap.LibPcap.PcapDevice.SendPacketArrivalEvent(RawCapture p)
   at SharpPcap.WinPcap.WinPcapDevice.SendPacketArrivalEvent(RawCapture p)
   at SharpPcap.LibPcap.PcapDevice.PacketHandler(IntPtr param, IntPtr header, IntPtr data)
   at SharpPcap.LibPcap.LibPcapSafeNativeMethods.pcap_dispatch(IntPtr adaptHandle, Int32 count, pcap_handler callback, IntPtr ptr)
   at SharpPcap.LibPcap.PcapDevice.CaptureThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Could you please help me?

Moxer81 commented 5 years ago

I am having the same problem when trying to get GuildRankings list. I think there is a problem with the packet parser and I have zero knowledge of c#. If anyone can help fixing this I would really be thankful!

the main error is: Unhandled Exception: System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer. Parameter name: bytes