JOOOO leute ich habs
0000 13 d4 66 f2 4c 00 17 31 d7 8d b3 08 00 45 00 ...f.L..1.....E.
0010 00 3c d7 2e 00 00 80 01 7e 17 c0 a8 b2 14 c0 a8 .<......~.......
0020 b2 15 00 00 4a 5c 02 00 09 00 61 62 63 64 65 66 ....J\....abcdef
0030 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 ghijklmnopqrstuv
0040 77 61 62 63 64 65 66 67 68 69 wabcdefghi
ckecksum berechnug für icmp header
45 00 00 3c d7 2e 00 00 80 01 .. .. c0 a8 b2 14 c0 a8 b2 15
da wo .. .. stehen die 7e 17 darf nicht mitberechnet werden sondern
ist ja euer ergebnis falls die werte stimmen
siehe
http://www.packetshack.org/index.php?page=IPchksum
checksum berechnung für icmp data (das was ich gesucht hatte) :-)
0020 .. .. 00 00 4a 5c 02 00 09 00 61 62 63 64 65 66 ....J\....abcdef
0030 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 ghijklmnopqrstuv
0040 77 61 62 63 64 65 66 67 68 69 wabcdefghi
einfach alles zusammen rechnen
hab dafür auch gleich ein prog geschrieben für den 8051
ergebnis der berechnung ist im R7 low byte und R6 high byte zu finden
A51 MACRO ASSEMBLER MAIN
09/08/2007 18:26:52 PAGE 1
MACRO ASSEMBLER A51 V8.00d
OBJECT MODULE PLACED IN main.OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE main SET(SMALL) DEBUG EP
LOC OBJ LINE SOURCE
1
2
3 ;r5 temp
4 ;r6 high
5 ;r7 low
6
0000 7 org 0x0000
8
0000 C3 9 clr c
0001 7FFF 10 mov r7,#0xff ;reset low
0003 7EFF 11 mov r6,#0xff ;reset high
0005 900120 12 mov dptr,#hexii
0008 7C40 13 mov r4,#0x40 ;so many round s
14
000A 15 checkagain:
000A E4 16 clr a ;lösche akku
000B 93 17 movc a,@a+dptr ;hole high byte
000C F4 18 cpl a ;komplimentiere
000D FD 19 mov r5,a ;high byte in das r5 register
zwischen speichern
000E A3 20 inc dptr ;datenpionter +1
000F E4 21 clr a ;lösche akku
0010 93 22 movc a,@a+dptr ;hole low byte
0011 F4 23 cpl a ;komplimentiere
0012 3F 24 addc a,r7 ; addiere low mit gespeichertem
low byte
0013 FF 25 mov r7,a ;speichere low byte
0014 ED 26 mov a,r5 ;hole high byte
0015 3E 27 addc a,r6 ;adiere high byte mit
gespeichertem high byte
0016 FE 28 mov r6,a ;speichere high byte
0017 A3 29 inc dptr ;datenpionter +1
0018 DCF0 30 djnz r4,checkagain ;again?
001A E4 31 clr a ;falls jetzt noch carry gesetzt ist
wird es dazu adiert
001B 3F 32 addc a,r7 ;adiere low byte mit carry
001C FF 33 mov r7,a ;ergebnis speichern
001D E4 34 clr a ;lösche akku
001E 3E 35 addc a,r6 ;ist bei der adition ein übertrag
entsatnden?
001F FE 36 mov r6,a ;high byte speichern
37
0020 38 halt:
0020 80FE 39 sjmp halt
40
0100 41 org 0x0100
0100 4500003C 42 hex: db
0x45,0x00,0x00,0x3c,0xed,0xf1,0x00,0x00,0x80,0x01,0xc0,0xa8,0xb2,0x15,0x
c0,0xa8,0xb
2,0x14
0104 EDF10000
0108 8001C0A8
010C B215C0A8
0110 B214
43
0120 44 org 0x0120
0120 08000000 45 hexII: db
0x08,0x00,0x00,0x00,0x02,0x00,0x09,0x00,0x61,0x62,0x63,0x64,0x65,0x66,0x
67,0x68,0
x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x7
7,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69
0124 02000900
0128 61626364
012C 65666768
0130 696A6B6C
0134 6D6E6F70
0138 71727374
013C 75767761
A51 MACRO ASSEMBLER MAIN
09/08/2007 18:26:52 PAGE 2
0140 62636465
0144 66676869
46 end
A51 MACRO ASSEMBLER MAIN
09/08/2007 18:26:52 PAGE 3
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
CHECKAGAIN . . . . C ADDR 000AH A
HALT . . . . . . . C ADDR 0020H A
HEX. . . . . . . . C ADDR 0100H A
HEXII. . . . . . . C ADDR 0120H A
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)
c.u
commtel