Hex Break

Rasprava o PIC mikrokontrolerima, PIC projekti i drugo vezano za PIC-eve...

Moderators: pedja089, stojke369, [eDo], trax

Post Reply
User avatar
InTheStillOfTheNight
Odlično uznapredovao
Odlično uznapredovao
Posts: 938
Joined: 01-06-2006, 17:54
Location: Zagreb

Hex Break

Post by InTheStillOfTheNight »

Program mikrokontolera se svodi samo na hex file. Što se zapravo nalazi u tim brojevima ničega? Kako iz hex-a izvući programerski source? teška pitanja i teški odgovori. U ovom topicu cu pokušati razbiti nečiji hex code i izvući izvorni source code c-a. Nadam se da me trax neće izbaciti sa lisle poželjnih jer ću izabrati neki njegov source za proučavanje... Sorry trax nema ljutnje, tu smo da nešto naučimo :) Molim nemojte komentirati ako stvarno nemate što pametno napisati... Hvala

Kad odaberem hex file pisati cu o nacinu kako to razumijeti, i kako doći do izvornog koda, a do tada:
Budite mi Zdravi, Lijepi i Pametni... Cujemo se uskoro...
InTheStillOfTheNight
User avatar
InTheStillOfTheNight
Odlično uznapredovao
Odlično uznapredovao
Posts: 938
Joined: 01-06-2006, 17:54
Location: Zagreb

Re: Hex Break

Post by InTheStillOfTheNight »

Izabrao ja.. Smrdi mi nekako da je ovo Trax programirao, pa cu zato sa ove stranice:
http://www.ivica-novakovic.from.hr/IrOn ... m#IrOnOff2" onclick="window.open(this.href);return false; pokušati izući source code...

1. Osnovno.... Hex file je assembler, a svaka firma i svaki procesor ima različite kodove assemblerskih naredbi... Sreća pa na ovoj stranici znamo da se radi o Hex file-u PIC12F629.

Što znamo?
Hex je za procesor PIC12F629!!!

Što dalje?
http://www.google.com" onclick="window.open(this.href);return false; upisati "PIC12F629 datasheet" i skinuti sve o njemu...

Što dalje?
Reći ću kad budem znao, naravno u idućem postu... :)
InTheStillOfTheNight
User avatar
InTheStillOfTheNight
Odlično uznapredovao
Odlično uznapredovao
Posts: 938
Joined: 01-06-2006, 17:54
Location: Zagreb

Re: Hex Break

Post by InTheStillOfTheNight »

Evo orginal Hex file kojeg cemo pokusati prevesti u nešti jednostavniji oblik. Najprije u assembler, a nakon toga u c-source:

:10000000702883169B001C141A086B2883169A000C
:100010001C1555309D00AA309D009C149C180E287C
:100020001C116B28A301A200FF30A207031CA30729
:10003000031C6B280330A100DF3020201428A1010D
:10004000E83EA000A109FC30031C2928A0070318E2
:100050002628A0076400A10F262820182F28A01CFE
:1000600033280000332808000310A10CA00CFF3E29
:100070000318342820086B28A20003304528A2006A
:1000800001304528A20006304528A8002308210297
:10009000031D4C28220820020430031801300319E4
:1000A00002302805031DFF306B281030A800A10185
:1000B000A001A70CA60C031C63282208A007230894
:1000C0000318230FA107A10CA00CA50CA40CA80BCE
:1000D000592824086B288313031383126400080033
:1000E0000730990083160D30850083128501831631
:1000F0000D30950081139F0183128316FF2390001A
:1001000083128B010C100B119001CF010512831685
:1001100005128312851283168512831285108316A9
:100120008510051583128822A72164004F1A99288B
:1001300093289B2093288514831685108312CE0163
:10014000640002304E020318CC28D30164000A3048
:1001500053020318C9280A30A600A7014E08A200BE
:10016000A3015520B2002508B3005308B2070318B5
:10017000B30A32080120D10053083C3E8400000835
:10018000B2006400510832020319C728CA28D30FED
:10019000A628CD28CE0FA028F92864008519E628C6
:1001A00064004E08003C031DDB28103085068316D2
:1001B00005128312E52864004E08013C031DE52862
:1001C00020308506831685128312F92864004E08B4
:1001D000003C031DF0280516831605128312F9282A
:1001E00064004E08013C031DF9288516831685120C
:1001F00083124F120130C600C7014608A00047080D
:10020000A1000330A300E8303F20031D0F29640044
:1002100005180B294F16C60A0319C70FFD286400DD
:100220004F1E1329F9280130C600C7014608A00057
:100230004708A1000330A300E8303F20031D282910
:10024000640005182429F928C60A0319C70F1629BE
:1002500085108316851064008312851D37290512C9
:1002600083160512831285128316851283120800E5
:10027000D30164000A3053020318452953083C3E59
:100280008400FF308000D30F3929C601C701C60A98
:100290000319C70AA72164004F1A5B294608A0006A
:1002A0004708A100FD30A300E8303C20031D5A2977
:1002B00047295B29A5298510831685108312D30150
:1002C00064000A3053020318722953083C3E84002C
:1002D0000008B200530883169B00831232080620E0
:1002E000D30F60290130A300F43013208514831646
:1002F00085108312A72164004F1A7F297A29D30120
:1003000064000A305302031897290A305307B200D9
:10031000B301B30D53083C3E84000008B40032081A
:1003200083169B00831234080620D30F8029851082
:100330008316851083120130A300F4301320851436
:1003400083168510C83083121220850108004F12D1
:100350006400051CAD290800C9290C10CA01CB0195
:100360004A088E004B088F00101464000518B92944
:10037000B52910100E08CA000F08CB004A08A000CB
:100380004B08A1000130A3005E303C20031DC929A9
:1003900008004A08A0004B08A1000430A300E23086
:1003A0003C20031DD829E230C8000430C900052ACA
:1003B0004A08A0004B08A1000A30A3008C303C2062
:1003C000031DE7298430C8000330C900152A4A08F4
:1003D000A0004B08A1000C30A300E4303C20031D1A
:1003E000F629EE30C8000230C900152A4A08A000DC
:1003F0004B08A1000C30A300E4304220031D052A65
:10040000B030C8000430C9000D2A6400051C092A58
:10041000052A640005180D2A092A6400051C112A02
:100420000D2A64000518152A112AD30164000A3028
:1004300053020318862A0130D400640005305402A8
:100440000318842A0C10CA01CB014A088E004B08FD
:100450008F0010146400051C352A640008300F0258
:100460000318332A2A2A352A552A10100E08CA00E2
:100470000F08CB004A08A0004B08A1004908A300C0
:1004800048084220031D4D2AD01753083C3E8400E3
:10049000500880000310D00C552AD01353083C3E5E
:1004A0008400500880000310D00C0C10CA01CB014E
:1004B0004A088E004B088F00101464000518622A49
:1004C0005D2A822A10100E08CA000F08CB004A08C5
:1004D000A0004B08A1004908A30048084220031DC2
:1004E0007A2AD01753083C3E84005008800003103D
:1004F000D00C822AD01353083C3E84005008800060
:100500000310D00CD40F1D2AD30F162A4F16080043
:100510006400051D8C2AAA2A0130CC00CD014C08AC
:10052000A0004D08A1000330A300E8303F20031DC8
:10053000A12A6400051D9D2A882ACC0A0319CD0F23
:100540008F2A85148316851083123821851083160F
:0A0550008510831208006300AB2A37 :02400E00CC3FA5
:00000001FF
InTheStillOfTheNight
User avatar
InTheStillOfTheNight
Odlično uznapredovao
Odlično uznapredovao
Posts: 938
Joined: 01-06-2006, 17:54
Location: Zagreb

Re: Hex Break

Post by InTheStillOfTheNight »

Hex..... Rekao bih Intel Hex...

:10246200464C5549442050524F46494C4500464C33
||||||||||| CC->Checksum
|||||||||DD->Data
|||||||TT->Record Type
|||AAAA->Address
|LL->Record Length
:->Colon

Ovo o cemu pisem je intel hex file, pa sam zato postao ovaj hit iz kojeg cemo malo sortirati ovaj hex file, naravno u sljedećem postu, izbrisati ću nepotrebne stvari kao što su ova zadnja bytea hecksuna. colon i Record lenght....
InTheStillOfTheNight
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3509
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Hex Break

Post by trax »

InTheStillOfTheNight wrote:Izabrao ja.. Smrdi mi nekako da je ovo Trax programirao, pa cu zato sa ove stranice:
http://www.ivica-novakovic.from.hr/IrOn" onclick="window.open(this.href);return false; ... m#IrOnOff2 pokušati izući source code...
Uzmi moj HEX, nema problema! Taman mogu pomoci kad negdje pogrijesis :D
User avatar
baltazar
Posts: 22
Joined: 10-05-2009, 11:55

Re: Hex Break

Post by baltazar »

Alaha ti ba, sta bi sa tim source codom? :!: :?: :shock:
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7877
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: Hex Break

Post by pedja089 »

Da nije negde zaplelo :?: :?:
User avatar
Smjesko
Stariji član
Stariji član
Posts: 4012
Joined: 26-12-2005, 17:12

Re: Hex Break

Post by Smjesko »

Nemojte biti nestrpljivi. Ovako zahtjevan posao traži mir, tišinu noći i vrijeme. Ove noći vjerojatno nisu tihe. :D
D101h
Posts: 14
Joined: 25-01-2010, 00:51

Re: Hex Break

Post by D101h »

Heh, takav zadatak sam imo na ispitu, naravno kraci i za 6502 XD... Mogo bi se slozit decompiler za to, ako vec nema...
User avatar
pedja089
Administrator sajta
Administrator sajta
Posts: 7877
Joined: 20-02-2007, 14:50
Location: Beočin -Srbija

Re: Hex Break

Post by pedja089 »

Dekompajler ne moze. Disasembleri postoje, ima ga npr u icprog.
Post Reply