Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Netcon/Netcon/src/org/netcon/BaseReadPacket.java
- /*
- Java
- public abstract class BaseReadPacket implements Runnable
- {
- protected final int readD()
- {
- int result = _data[(_off++)] & 0xFF;
- result |= (_data[(_off++)] << 8) & 0xFF00;
- result |= (_data[(_off++)] << 16) & 0xFF0000;
- result |= (_data[(_off++)] << 24) & 0xFF000000;
- return result;
- }
- }
- */
- // C++
- unsigned int BaseReadPacket::read_dword() {
- unsigned int result;
- #ifdef L2J_LITTLE_ENDIAN
- result = *reinterpret_cast<const unsigned int *>(&_data[_off]);
- #else
- result = (unsigned int) _data[_off]
- | ((unsigned int) _data[_off + 1] << 8)
- | ((unsigned int) _data[_off + 2] << 16)
- | ((unsigned int) _data[_off + 3] << 24);
- #endif
- _off += 4;
- return result;
- }
- inline unsigned int BaseReadPacket::readD() { return read_dword(); }
- /*
- C++
- L2J_LITTLE_ENDIAN is defined
- 25 [1] unsigned int BaseReadPacket::read_dword() {
- 0x4007d4 55 push %rbp
- 0x4007d5 <+0x0001> 48 89 e5 mov %rsp,%rbp
- 0x4007d8 <+0x0004> 48 89 7d e8 mov %rdi,-0x18(%rbp)
- 0x4007dc <+0x0008> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x4007e0 <+0x000c> 48 8b 10 mov (%rax),%rdx
- 0x4007e3 <+0x000f> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x4007e7 <+0x0013> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x4007eb <+0x0017> 48 01 d0 add %rdx,%rax
- 0x4007ee <+0x001a> 8b 00 mov (%rax),%eax
- 0x4007f0 <+0x001c> 89 45 fc mov %eax,-0x4(%rbp)
- 0x4007f3 <+0x001f> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x4007f7 <+0x0023> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x4007fb <+0x0027> 48 8d 50 04 lea 0x4(%rax),%rdx
- 0x4007ff <+0x002b> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400803 <+0x002f> 48 89 50 08 mov %rdx,0x8(%rax)
- 0x400807 <+0x0033> 8b 45 fc mov -0x4(%rbp),%eax
- 0x40080a <+0x0036> 5d pop %rbp
- 0x40080b <+0x0037> c3 retq
- */
- /*
- C++
- L2J_LITTLE_ENDIAN isn't defined
- 25 [1] unsigned int BaseReadPacket::read_dword() {
- 0x4007fa 55 push %rbp
- 0x4007fb <+0x0001> 48 89 e5 mov %rsp,%rbp
- 0x4007fe <+0x0004> 48 89 7d e8 mov %rdi,-0x18(%rbp)
- 0x400802 <+0x0008> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400806 <+0x000c> 48 8b 10 mov (%rax),%rdx
- 0x400809 <+0x000f> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x40080d <+0x0013> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x400811 <+0x0017> 48 01 d0 add %rdx,%rax
- 0x400814 <+0x001a> 0f b6 00 movzbl (%rax),%eax
- 0x400817 <+0x001d> 0f be d0 movsbl %al,%edx
- 0x40081a <+0x0020> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x40081e <+0x0024> 48 8b 08 mov (%rax),%rcx
- 0x400821 <+0x0027> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400825 <+0x002b> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x400829 <+0x002f> 48 83 c0 01 add $0x1,%rax
- 0x40082d <+0x0033> 48 01 c8 add %rcx,%rax
- 0x400830 <+0x0036> 0f b6 00 movzbl (%rax),%eax
- 0x400833 <+0x0039> 0f be c0 movsbl %al,%eax
- 0x400836 <+0x003c> c1 e0 08 shl $0x8,%eax
- 0x400839 <+0x003f> 89 d1 mov %edx,%ecx
- 0x40083b <+0x0041> 09 c1 or %eax,%ecx
- 0x40083d <+0x0043> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400841 <+0x0047> 48 8b 10 mov (%rax),%rdx
- 0x400844 <+0x004a> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400848 <+0x004e> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x40084c <+0x0052> 48 83 c0 02 add $0x2,%rax
- 0x400850 <+0x0056> 48 01 d0 add %rdx,%rax
- 0x400853 <+0x0059> 0f b6 00 movzbl (%rax),%eax
- 0x400856 <+0x005c> 0f be c0 movsbl %al,%eax
- 0x400859 <+0x005f> c1 e0 10 shl $0x10,%eax
- 0x40085c <+0x0062> 09 c1 or %eax,%ecx
- 0x40085e <+0x0064> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400862 <+0x0068> 48 8b 10 mov (%rax),%rdx
- 0x400865 <+0x006b> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400869 <+0x006f> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x40086d <+0x0073> 48 83 c0 03 add $0x3,%rax
- 0x400871 <+0x0077> 48 01 d0 add %rdx,%rax
- 0x400874 <+0x007a> 0f b6 00 movzbl (%rax),%eax
- 0x400877 <+0x007d> 0f be c0 movsbl %al,%eax
- 0x40087a <+0x0080> c1 e0 18 shl $0x18,%eax
- 0x40087d <+0x0083> 09 c8 or %ecx,%eax
- 0x40087f <+0x0085> 89 45 fc mov %eax,-0x4(%rbp)
- 0x400882 <+0x0088> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400886 <+0x008c> 48 8b 40 08 mov 0x8(%rax),%rax
- 0x40088a <+0x0090> 48 8d 50 04 lea 0x4(%rax),%rdx
- 0x40088e <+0x0094> 48 8b 45 e8 mov -0x18(%rbp),%rax
- 0x400892 <+0x0098> 48 89 50 08 mov %rdx,0x8(%rax)
- 0x400896 <+0x009c> 8b 45 fc mov -0x4(%rbp),%eax
- 0x400899 <+0x009f> 5d pop %rbp
- 0x40089a <+0x00a0> c3 retq
- 0x40089b 90 nop
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement