hex file transformer

Status
Not open for further replies.

4electros

New Member
I have a hex file PIC16F628 program,how can i get the original program form in ASM file .Is that possible to convert hex file to its original form by some software?!

regards
 
This is :


:04000000B901882991
:10000800B229B916B91EB912B9190E28B91547205F
:10001800031835280830A4005B20A30DA40B102872
:10002800B91E402065206120B91A35203A202308DE
:1000380003108329B916B91EB91239192828FE39AF
:10004800BB00391503108329391A3028A70039163F
:1000580047200318352827084E2003183528B91ECD
:1000680083294020652039113912B9113F088400CD
:100078003D088417800446283F0884003D09800510
:100088008417800508003A206520402061203B083D
:10009800B9190138A3000830A400A30D03183A20A9
:1000A800031C402065206120A40B51283A206520BC
:1000B8003F0884003D080005FF3E400884003E09D3
:1000C8004328400884003E083D280408A8008511FC
:1000D8000610061083168511061006100F308605C7
:1000E80083122808B91896283A30A20098300D21B2
:1000F8003330A700AA201330A20088300D21AA208F
:1001080064300C21AA2064300C212230A700AA20D8
:10011800283095200C30952006309520B9142808F1
:1001280096283914A700391CA4280610033C031C80
:10013800A928A9200730A200D0300D2103140800F7
:100148003914FE3C031983290614391C3910851506
:100158000F3086052708F03986048511A70E39184F
:10016800AA2832300C2103140800BB132A080319EB
:10017800BB170530A9002730A4001030CF2003306A
:10018800A400E830CF20A4016430CF20A4010A30B5
:10019800CF202508D628A3002608A2002508A100FC
:1001A8004C212108A100A9030319BB132A0803192C
:1001B800E0282902031808002108031DBB13BB1BF4
:1001C8000800303E7E2983178001840AFF3E031D04
:1001D800E828832983169B001C141A088329831690
:1001E8009A001C1555309D00AA309D009C149C183F
:1001F800FB281C118329A401A300FF30A307031CBB
:10020800A407031C83290330A200DF300D21012934
:10021800A201E83EA100A209FC30031C1629A1078F
:1002280003181329A1076400A20F132921181C29F8
:10023800A11C2029000020290800A201A401A30074
:1002480002303129A30003303129A30001303129BC
:10025800A30006303129A3000530A9002408220292
:10026800031D38292308210204300318013003191B
:1002780002302905031DFF3083290038031DFF3094
:100288000405031DFF3083290404031DFF3083295F
:10029800A601A5011030A700220DA50DA60D230863
:1002A800A5022408031C240FA602031862292308A8
:1002B800A50724080318240FA6070310A10DA20DF3
:1002C800A70B5029210883291030A900A201A101F8
:1002D800A80CA70C031C76292308A10724080318D7
:1002E800240FA207A20CA10CA60CA50CA90B6C2923
:1002F80025088329840032088A0031088200831384
:100308000313831264000800203084006030E82062
:10031800A03084005030E820203084003030E720BE
:10032800C830FF200030EE20CB000130EE20CC009A
:100338000230EE20CA000330EE20DA0051115211CB
:1003480007309F008316EF308500831285018316DE
:10035800F130860083128601D116532AA000030EBD
:100368008301C1000A08BC000408BA001010F73065
:100378008E0703188F0AD8308F0710140C10210825
:10038800C4002208C5002308C6002408C700D90AEB
:100398006400D11CF6296400D119F62964005908B3
:1003A800193C031DDB298615831686118312640008
:1003B8005908323C031DE4298611831686118312DD
:1003C800640059084B3C031DED29861583168611D8
:1003D800831264005908643C031DF62986118316AC
:1003E8008611831264005908643C031D192A64307D
:1003F800D902D60AD116640056083C3C031D0C2AC3
:10040800D00A6400FF304D0203180B2ACD0AD6012A
:10041800640050083C3C031D132ACF0AD001640035
:100428004F08183C031D192ACF014608A3004708A6
:10043800A4004408A1004508A2003A0884003C082A
:100448008A00410E8300A00E200E09009010901122
:100458000C1083160C1483120B178B17101408003A
:1004680010100800003010180130C400C501101029
:100478008E018F0110108E018F011010F7308E073A
:1004880003188F0AD8308F0744181014441C101012
:10049800D901D601D001CF01D116CD0108003622ED
:1004A8002A225210D401D501FE306A2001306A2078
:1004B8009324552564005218302E64005408003CDB
:1004C800031D682A1523702A64005408013C031D83
:1004D8006F2AC622702A552A74220130FF205C2A0E
:1004E8004B08A1004F082121B3004C08A100500877
:1004F8002121B5003308840035084121B500B60034
:100508006400350836040319932ACD016400511D8F
:100518008E2AAD226400521D922ABA22AC2A6400A7
:100528004A084D02031CA12AD110D1116400511AA6
:10053800A12A061183160611831264005A084D0277
:10054800031CAC2AD210D21186108316861083128F
:1005580008006400D119B92A6400D118B92ACE015B
:10056800D114061583160611831208006400D219E7
:10057800C52A6400D218C52AD21486148316861098
:1005880083120800FE306A2002306A2041306A2057
:100598004C306A202E306A204F306A204E306A2054
:1005A80020306A203A306A2020306A200330AA00BE
:1005B8004A08A500A6016930B100B201B92020306F
:1005C8006A206D306A2069306A206E306A202E30C9
:1005D8006A20FE306A20C0306A2054306A204D30CC
:1005E8006A2052306A202E306A204F306A204E30FE
:1005F8006A203A306A2020306A200330AA005A085C
:10060800A500A6016930B100B201B92020306A20E6
:100618006D306A2069306A206E306A202E306A2078
:100628000800003052180130A10000302121B30029
:100638005908A10032302121B5003308840035085B
:100648004121B500B6006400350836040319382B7B
:10065800FE306A2082306A2020306A20FE306A200C
:1006680085306A2020306A206400D11E522BD112B6
:100678005608A100A2010530A300A4014C212508B9
:10068800B3002608B4003308A1003408A200A4016E
:1006980000302F21031D512B1E2453230800FE3048
:1006A8006A2002306A200230AA004F08A500A6017D
:1006B8006930B100B201B9203A306A200230AA008C
:1006C8005008A500A6016930B100B201B9203A303E
:1006D8006A200230AA005608A500A6016930B100B8
:1006E800B201B92020306A2020306A206400D11B72
:1006F800BD2BFE306A205B086A2057086A20AA01D1
:100708005808A500A6016930B100B201B9202E3001
:100718006A20AA010030C81B0130A100A2010130E3
:10072800A300A4014C21B3002208B4003308A70099
:100738003408A8003230A300A4016821B3002608B9
:10074800B4003308A1003408A2000A30A300A401B1
:100758004C21B3002208B4003308A5003408A600D1
:100768006930B100B201B920DF306A2043306A2015
:10077800CF2BFE306A2089306A2020306A202D3045
:100788006A202D306A202E306A202D306A20DF3012
:100798006A2043306A20FE306A20C0306A20413027
:1007A8006A204C306A202E306A200230AA004B089A
:1007B800A500A6016930B100B201B9203A306A201B
:1007C8000230AA004C08A500A6016930B100B201A8
:1007D800B9206400511DFB2BFE306A20C9306A2005
:1007E8002A306A2029306A2029306A20052CFE30F8
:1007F8006A20C9306A2020306A2020306A202030E0
:100808006A206400521D132CFE306A20CD306A2005
:1008180054306A204D306A2052306A201D2CFE3038
:100828006A20CD306A2020306A2020306A202030AB
:100838006A200800D1130530BF000430BD00053020
:10084800C0001030BE0090302020AC302020003096
:100858001E200530BF000430BD000530C000103038
:10086800BE0090302020EE301E200530BF0004303E
:10087800BD000530C0001030BE00903020200318A5
:10088800832CAA3020200318832C07200318832CDC
:10089800C90005200318832CC8002030D700490858
:1008A800D800640080305802031C702C2D30D7000B
:1008B80058080310C81B013EB300B401B40D330837
:1008C800003CD8008930DB0064000A305802031865
:1008D8006F2C8A30DB00822C640064305802031CC1
:1008E800782C8830DB00822C64000A305802031C04
:1008F800802C8930DB00822C8A30DB000800D1177D
:1009080008006400851A8B2C0130D300922C6400F7
:100918000518912C0230D300922CD30108008524AD
:10092800640001305302031C272D64005118272D41
:100938006400D11CA02C41255308A10002302121BC
:10094800B3000030D2180130840033084121B300CD
:10095800B4006400330834040319B32C4B25511434
:10096800C201C3010130FF20C20A0319C30A0030C3
:1009780005180130A10001302121B3000030851A8B
:100988000130A10001302121B50033088400350869
:100998004121B500B6004208A1004308A200033077
:1009A800A400E8302921B700350836048400370848
:1009B8004821B700B8006400370838040319B62C7A
:1009C8004208A1004308A2000330A400E8302C210B
:1009D800031D112D64005308013C031DFF2C030166
:1009E80051190130013A03195111031D51156400C1
:1009F800511DFF2CD11164005308023C031D102D1A
:100A0800030152190130013A03195211031D5215FD
:100A18006400521D102DD211272D4208A100430851
:100A2800A200A40132302C21031D272D0301511AE5
:100A38000130013A03195112031D5116511A0615B6
:100A4800511E0611272D85245308A10000302121AD
:100A5800B300003051180130A10001302121B50048
:100A68003308840035084121B500B6006400350814
:100A780036040319402D511008006400D1194A2D7D
:100A8800D115861183168611831251160800640049
:100A9800D219542DD215861083168610831251163A
:100AA800080064008518A02D6400511BA02D640067
:100AB800D11C5F2D41255117C201C3010130FF2010
:100AC800C20A0319C30A003085180130A100013099
:100AD8002121B3004208A1004308A2000330A4006A
:100AE800E8302921B5003308840035084821B500CD
:100AF800B6006400350836040319622D4208A100C7
:100B08004308A200A40114302621031D8C2DA02D1A
:100B18004208A1004308A2000330A400E8302621BF
:100B2800031D982DD40AA02D030152180130013A53
:100B380003195210031D5214003085180130A1000A
:100B480001302121B3000030511B0130A1000130D8
:100B58002121B5003308840035084121B500B600CD
:100B68006400350836040319BA2D5113080085248A
:100B7800640001305302031CC22DD02564005308C1
:100B8800013C031DC92DD503CF2D64005308023C39
:100B9800031DCF2DD50A0800C201C301C20A0319DB
:100BA800C30A0130FF204208A1004308A200A401A3
:100BB800C8302C21031DD22D0800BB256400540821
:100BC800033C0319EC2D64005408003C031DFA2D66
:100BD80064005508183C031DF32D1730D500640038
:100BE80019305502031CF92DD5012F2E6400540825
:100BF800043C0319092E64005408023C0319092E09
:100C080064005408013C031D172E640055083C3C41
:100C1800031D102E3B30D50064003D305502031CE7
:100C2800162ED5012F2E64005408063C0319212ED8
:100C380064005408053C031D2F2E6400FF30550244
:100C4800031C282E0130D50064000130550203181A
:100C58002F2EFE30D5000800640001305402031C1A
:100C6800382E0530D4008A2E552564005218482E97
:100C780083169B0183124B08F320831601309B00D7
:100C880083124C08F320552A64005408003C031DC5
:100C9800532E4F08D500E1255508CF00802E64005B
:100CA8005408013C031D5E2E5008D500E125550867
:100CB800D000802E64005408023C031D692E56089B
:100CC800D500E1255508D600802E64005408033C61
:100CD800031D742E4B08D500E1255508CB00802E46
:100CE80064005408043C031D7F2E4C08D500E12500
:100CF8005508CC00802ED401852464005308003C9C
:100D0800031D882EBD26892E5323382E55256400B1
:100D180052189B2E831602309B0083124A08F32038
:100D2800831603309B0083125A08F320552A640067
:100D38005408053C031DA62E4A08D500E125550890
:100D4800CA00B32E64005408063C031DB12E5A088D
:100D5800D500E1255508DA00B32E0530D4008524E6
:100D680064005308003C031DBB2E0A27BC2EC62274
:100D78008A2E640059084B3C031D082F6400540850
:100D8800003C031DD02EFE306A2080306A202030BF
:100D98006A2020306A20072F64005408013C031D94
:100DA800DE2EFE306A2083306A2020306A20203010
:100DB8006A20072F64005408023C031DEC2EFE3005
:100DC8006A2086306A2020306A2020306A20072F67
:100DD80064005408033C031DFA2EFE306A20C33019
:100DE8006A2020306A2020306A20072F64005408C7
:100DF800043C031D072FFE306A20C6306A202030CD
:100E08006A2020306A20092F152308005608A100FF
:100E1800A2010230A300A4014C212508B300260832
:100E2800B4003308A1003408A200A40100302F2127
:100E3800031D3E2F64005408053C031D2E2FFE3071
:100E48006A2088306A2020306A2020306A202030CA
:100E58006A203D2F64005408063C031D3D2FFE30D8
:100E68006A20C8306A2020306A2020306A2020306A
:0C0E78006A203F2FC62208006300402FB4
:02400E00413F30
:084200000C00000005000F0096
:00000001FF
 
Be careful, between macro's and inteligent compilers using C code, the assembly code you end up with might not be human readable right off the bat. Even a disassembler written by the same company that produced the software that created the hex code is going to come up with very different results.
 
Here you go.

Woops, you can't post a message longer than 20k. So, I'll attach it. Had to rename it to asc as asm isn't allowed!! and txt has a 20k limit.

Mike.
Edit, changed the attachment as I dissasembled for 16f88 and not 628.
 
Last edited:
That's not a very user friendly disassembly Pommie!, here's what mine produces.
 

Attachments

  • temp.zip
    5.5 KB · Views: 133

The idea isn't to recreate the original source (that would be impossible, as the required information isn't there), it's to create source code that MPASM can accept and create the identical HEX file from.

Macro's aren't a problem, their code simply appears multiple times in the source as they would during assembly anyway. C generated code is more of a problem, as C compilers usually produce really poor unreadable code!, with some really bizzare methods?.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…