{"action":"created","comment":{"url":"https://api.github.com/repos/cea-sec/miasm/pulls/comments/195901884","pull_request_review_id":129362139,"id":195901884,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTkwMTg4NA==","diff_hunk":"@@ -0,0 +1,1147 @@\n+# Toshiba MeP-c4 - miasm instructions side effects\n+# Guillaume Valadon <guillaume@valadon.net>\n+\n+from miasm2.core.sembuilder import SemBuilder\n+from miasm2.ir.ir import IntermediateRepresentation\n+from miasm2.arch.mep.arch import mn_mep\n+from miasm2.arch.mep.regs import PC, SP, LP, SAR, TP, RPB, RPE, RPC, EPC, NPC\n+from miasm2.arch.mep.regs import EXC, HI, LO, PSW, DEPC, DBG\n+from miasm2.expression.expression import ExprId, ExprInt, ExprOp\n+from miasm2.expression.expression import ExprAff, ExprCond, ExprMem\n+from miasm2.core.cpu import sign_ext\n+\n+from miasm2.arch.mep.regs import exception_flags\n+MEP_EXCEPTION_ZERO_DIVIDE = 1 << 0\n+\n+\n+# SemBuilder context\n+ctx = {\"PC\": PC, \"SP\": SP, \"LP\": LP, \"SAR\": SAR, \"TP\": TP,\n+       \"RPB\": RPB, \"RPE\": RPE, \"RPC\": RPC, \"EPC\": EPC, \"NPC\": NPC,\n+       \"EXC\": EXC, \"HI\": HI, \"LO\": LO, \"PSW\": PSW, \"DEPC\": DEPC, \"DBG\": DBG,\n+       \"exception_flags\": exception_flags}\n+sbuild = SemBuilder(ctx)\n+\n+\n+# Functions used to get an instruction IR\n+manual_functions = dict()\n+\n+\n+@sbuild.parse\n+def mep_nop():\n+    \"\"\"Dummy instruction\"\"\"\n+\n+\n+@sbuild.parse\n+def mep_nop_2_args(arg1, arg2):\n+    \"\"\"Dummy instruction with two arguments\"\"\"\n+\n+\n+### Load/Store instructions\n+\n+# Register indirect addressing mode\n+\n+@sbuild.parse\n+def sb(reg_src, deref_dst):\n+    \"\"\"SB - Store Byte into memory\"\"\"\n+\n+    # MemByte(Rm31..0) <- Rn7..0\n+    # MemByte((ZeroExt(disp7)+TP)31..0)) <- Rn7..0\n+    # MemByte((SignExt(disp16)+Rm)31..0) <- Rn7..0\n+    mem8[deref_dst.arg] = reg_src[:8]\n+\n+\n+@sbuild.parse\n+def sh(reg_src, deref_dst):\n+    \"\"\"SH - Store Halfword into memory\"\"\"\n+\n+    # MemHword(Rm31..1||0) <- Rn15..0\n+    # MemHword((ZeroExt((disp7)6..1||0)+TP)31..1||0)) <- Rn15..0\n+    # MemHword((SignExt(disp16)+Rm)31..1||0) <- Rn15..0\n+    mem16[deref_dst.arg & i32(0xFFFFFFFE)] = reg_src[:16]\n+\n+\n+@sbuild.parse\n+def sw(reg_src, deref_dst):\n+    \"\"\"SW - Store Word into memory\"\"\"\n+\n+    # MemWord(Rm31..2||00) <- Rn31..0\n+    # MemWord((ZeroExt((disp7)6..2||00)+SP)31..2||00)) <- Rn31..0\n+    # MemWord((ZeroExt((disp7)6..2||00)+TP)31..2||00)) <- Rn31..0\n+    # MemWord((SignExt(disp16)+Rm)31..2||00) <- Rn31..0\n+    # MemWord(ZeroExt((abs24)23..2||00)) - Rn31..0\n+\n+    mem32[deref_dst.arg & i32(0xFFFFFFFC)] = reg_src\n+\n+# Without the sembuilder\n+#def sw(ir, instr, reg_src, deref_reg_or_imm, deref_reg=None):\n+#    \"\"\"SW - store Word into memory.\n+#\n+#       Note: there are three variants to get the memory address:\n+#            - from a register\n+#            - relatively to SP\n+#            - relatively to TP\"\"\"\n+#\n+#    if isinstance(deref_reg_or_imm, ExprMem):\n+#        # MemWord(Rm31..2||00) <- Rn31..0\n+#        dst = deref_reg_or_imm\n+#\n+#    elif isinstance(deref_reg_or_imm, ExprInt) and deref_reg:\n+#        # MemWord((ZeroExt((disp7)6..2||00)+SP)31..2||00)) <- Rn31..0\n+#        # MemWord((ZeroExt((disp7)6..2||00)+TP)31..2||00)) <- Rn31..0\n+#\n+#        imm = deref_reg_or_imm.zeroExtend(32)\n+#        dst = ExprMem(ExprOp(\"+\", imm, deref_reg.arg))\n+#\n+#    return [ExprAff(dst, reg_src)], []\n+\n+\n+@sbuild.parse\n+def lb(reg_dst, deref_dst):\n+    \"\"\"LB - Load Byte from memory\"\"\"\n+\n+    # Rn <- SignExt(MemByte(Rm31..0))\n+    # Rn <- SignExt(MemByte((ZeroExt(disp7)+TP)31..0))\n+    # Rn <- SignExt(MemByte((SignExt(disp16)+Rm)31..0)\n+    reg_dst = mem8[deref_dst.arg].signExtend(32)\n+\n+\n+@sbuild.parse\n+def lh(reg_dst, deref_dst):\n+    \"\"\"LH - Load Halfword from memory\"\"\"\n+\n+    # Rn <- SignExt(MemHword(Rm31..1||0))\n+    # Rn <- SignExt(MemHword((ZeroExt((disp7)6..1||0)+TP)31..1||0)\n+    # Rn <- SignExt(MemHword((SignExt(disp16)+Rm)31..1||0))\n+    reg_dst = mem16[deref_dst.arg & i32(0xFFFFFFFE)].signExtend(32)\n+\n+\n+@sbuild.parse\n+def lw(reg_dst, deref_dst):\n+    \"\"\"LW - Load Word from memory\"\"\"\n+\n+    # Rn <- MemWord(Rm31..2||00)\n+    # Rn <- MemWord((ZeroExt((disp7)6..2||00)+TP)31..2||00)\n+    # Rn <- MemWord((SignExt(disp16)+Rm)31..2||00)\n+    # Rn <- MemWord(ZeroExt((abs24)23..2||00))\n+    reg_dst = mem32[deref_dst.arg & i32(0xFFFFFFFC)]\n+\n+\n+@sbuild.parse\n+def lbu(reg_dst, deref_dst):\n+    \"\"\"LBU - Load an unsigned Byte from memory\"\"\"\n+\n+    # Rn <- ZeroExt(MemByte(Rm31..0))\n+    # Rn <- ZeroExt(MemByte((ZeroExt(disp7)+TP)31..0))\n+    # Rn <- ZeroExt(MemByte((SignExt(disp16)+Rm)31..0))\n+    reg_dst = mem8[deref_dst.arg].zeroExtend(32)\n+\n+\n+@sbuild.parse\n+def lhu(reg_dst, deref_dst):\n+    \"\"\"LHU - Load an unsigned Halfword from memory\"\"\"\n+\n+    # Rn <- ZeroExt(MemHword(Rm31..1||0))\n+    # Rn <- ZeroExt(MemHword((SignExt(disp16)+Rm)31..1||0))\n+    # Rn <- ZeroExt(MemHword((ZeroExt((disp7)6..1||0)+TP)31..1||0))\n+    reg_dst = mem16[deref_dst.arg & i32(0xFFFFFFFE)].zeroExtend(32)\n+\n+\n+### Byte/Halfword extension instructions\n+\n+@sbuild.parse\n+def extb(reg):\n+    \"\"\"EXTB - sign extend a byte\"\"\"\n+\n+    # Rn <- SignExt(Rn7..0)\n+    reg = reg[:8].signExtend(32)\n+\n+\n+@sbuild.parse\n+def exth(reg):\n+    \"\"\"EXTH - sign extend a word\"\"\"\n+\n+    # Rn <- ZeroExt(Rn15..0)\n+    reg = reg[:16].signExtend(32)\n+\n+\n+@sbuild.parse\n+def extub(reg):\n+    \"\"\"EXUTB - zero extend a byte\"\"\"\n+\n+    # Rn <- SignExt(Rn7..0)\n+    reg = reg[:8].zeroExtend(32)\n+\n+\n+@sbuild.parse\n+def extuh(reg):\n+    \"\"\"EXTUH - zero extend a word\"\"\"\n+\n+    # Rn <- ZeroExt(Rn15..0)\n+    reg = reg[:16].zeroExtend(32)\n+\n+\n+### Shift amount manipulation instructions\n+\n+#@sbuild.parse\n+#def ssarb(deref_reg):\n+\n+\n+### Move instructions\n+\n+@sbuild.parse\n+def mov(reg, value):\n+    \"\"\"MOV - copy 'value' to a register. The three alternatives are handled.\"\"\"\n+\n+    # Rn <- Rm\n+    # Rn <- SignExt(imm8)\n+    # Rn <- SignExt(imm16)\n+    reg = value.signExtend(32)\n+\n+\n+@sbuild.parse\n+def movu(reg, value):\n+    \"\"\"MOV - copy 'value' to a register. The two alternatives are handled.\"\"\"\n+\n+    # Rn[0-7] <- ZeroExt(imm24)\n+    # Rn <- ZeroExt(imm16)\n+    reg = value.zeroExtend(32)\n+\n+\n+@sbuild.parse\n+def movh(reg, imm16):\n+    \"\"\"MOVH - copy a shifted imm16 to a register.\"\"\"\n+\n+    # Rn <- imm16 <<16\n+    reg = imm16.zeroExtend(32) << i32(16)\n+\n+\n+### Arithmetic instructions\n+\n+def add3(ir, instr, reg_dst, reg_src, reg_or_imm):\n+    \"\"\"ADD3 - add two register and store the result to a register, or\n+              add a register and an immediate and store the result to a register\"\"\"\n+\n+    if isinstance(reg_or_imm, ExprId):\n+        # Rl <- Rn + Rm\n+        result = ExprOp(\"+\", reg_src, reg_or_imm)\n+    else:\n+        # Rn <- Rm + SignExt(imm16)\n+        value = int(reg_or_imm.arg)\n+        result = ExprOp(\"+\", reg_src, ExprInt(value, 32))\n+\n+    return [ExprAff(reg_dst, result)], []\n+\n+manual_functions[\"add3\"] = add3\n+\n+\n+@sbuild.parse\n+def add(arg1, arg2):\n+    \"\"\"ADD - add a register and an immediate\"\"\"\n+\n+    # Rn <- Rn + SignExt(imm6)\n+    arg1 = arg1 + arg2.signExtend(32)\n+\n+\n+@sbuild.parse\n+def advck3(r0, rn, rm):\n+    \"\"\"ADVCK3 - check addition overflow\"\"\"\n+\n+    # if(Overflow(Rn+Rm)) R0<-1 else R0<-0 (Signed)\n+\n+    # Get the register storing the highest value\n+    max_rn_rm = rn.zeroExtend(64) if \">\"(rn, rm) else rm.zeroExtend(64)\n+\n+    # Check for an overflow\n+    r0 = i32(1) if \"<\"(rn.zeroExtend(64) + rm.zeroExtend(64), max_rn_rm) else i32(0)\n+\n+\n+@sbuild.parse\n+def sub(reg1, reg2):\n+    \"\"\"SUB - Substract one register to another.\"\"\"\n+\n+    # Rn <- Rn - Rm\n+    reg1 = reg1 - reg2\n+\n+\n+def sbvck3(ir, instr, r0, rn, rm):\n+    \"\"\"SBVCK3 - check substraction overflow\"\"\"\n+\n+    # if(Overflow(Rn-Rm)) R0<-1 else R0<-0 (Signed)\n+\n+    # Substract registers\n+    reg_sub = ExprOp(\"+\", rn, rm)\n+\n+    # Get the register storing the highest value\n+    max_rn_rm = ExprCond(ExprOp(\">\", rn, rm), rn, rm)\n+\n+    # Check for an overflow\n+    overflow_test = ExprOp(\">\", reg_sub, max_rn_rm)\n+\n+    # Return the result\n+    condition = ExprCond(overflow_test, ExprInt(1, 32), ExprInt(0, 32))\n+    return [ExprAff(r0, condition)], []\n+\n+manual_functions[\"sbvck3\"] = sbvck3\n+\n+\n+@sbuild.parse\n+def neg(reg1, reg2):\n+    \"\"\"NEG - negate one register.\"\"\"\n+\n+    # Rn <- - Rm\n+    reg1 = - reg2\n+\n+\n+@sbuild.parse\n+def slt3(r0, rn, rm_or_imm5):\n+    \"\"\"SLT3 - Set on less than (signed).\"\"\"\n+\n+    # if (Rn<Rm) R0<-1 else R0<-0 (Signed)\n+    # if (Rn<ZeroExt(imm5)) R0<-1 else R0<-0(Signed)\n+\n+    rm_ext = rm_or_imm5\n+\n+    # Mask sign bits\n+    sign_mask = i32(0x80000000)\n+    sign_rn = rn & sign_mask\n+    sign_rm = rm_ext & sign_mask\n+\n+    # Check if both numbers are positive or negative\n+    are_both_neg = sign_rn & sign_rm\n+    are_both_pos = ~(sign_rn & sign_rm) >> i32(31)\n+\n+    # rn is positive and rm negative, return 1\n+    r0_mixed = i32(1) if sign_rn else i32(0)\n+\n+    # rn & rm are both positives, test and return 1 or 0\n+    r0_pos = (i32(1) if \"<\"(rn, rm_ext) else i32(0)) if are_both_pos else r0_mixed\n+\n+    # rn & rm are both negatives, test and return 0 or 1\n+    r0 = (i32(0) if \"<\"(rn, rm_ext) else i32(1)) if are_both_neg else r0_pos\n+\n+\n+@sbuild.parse\n+def sltu3(r0, rn, rm_or_imm5):\n+    \"\"\"SLTU3 - Set on less than (unsigned).\"\"\"\n+\n+    # if (Rn<Rm) R0<-1 else R0<-0 (Unigned)\n+    # if (Rn<ZeroExt(imm5)) R0<-1 else R0<-0(Unsigned)\n+    r0 = i32(1) if \"<\"(rn, rm_or_imm5) else i32(0)\n+\n+\n+@sbuild.parse\n+def sl1ad3(r0, rn, rm):\n+    \"\"\"SL1AD3 - Shift a register one bit left, then add another one.\"\"\"\n+\n+    # R0 <- (Rn<<1) + Rm\n+    r0 = (rn << i32(1)) + rm\n+\n+\n+@sbuild.parse\n+def sl2ad3(r0, rn, rm):\n+    \"\"\"SL2AD3 - Shift a register two bits left, then add another one.\"\"\"\n+\n+    # R0 <- (Rn<<2) + Rm\n+    r0 = (rn << i32(2)) + rm\n+\n+\n+### Logical instructions\n+\n+@sbuild.parse\n+def logical_or(rn, rm):\n+    \"\"\"OR - Logical OR between two registers.\"\"\"\n+\n+    # Rn <- Rn or Rm\n+    rn = rn | rm\n+\n+manual_functions[\"or\"] = logical_or\n+\n+\n+@sbuild.parse\n+def logical_and(rn, rm):\n+    \"\"\"AND - Logical AND between two registers.\"\"\"\n+\n+    # Rn <- Rn and Rm\n+    rn = rn & rm\n+\n+manual_functions[\"and\"] = logical_and\n+\n+\n+@sbuild.parse\n+def xor(rn, rm):\n+    \"\"\"XOR - Logical XOR between two registers.\"\"\"\n+\n+    # Rn <- Rn xor Rm\n+    rn = rn ^ rm\n+\n+\n+@sbuild.parse\n+def nor(rn, rm):\n+    \"\"\"NOR - Logical NOR between two registers.\"\"\"\n+\n+    # Rn <- Rn nor Rm\n+    rn = ~ (rn | rm)\n+\n+\n+@sbuild.parse\n+def or3(rn, rm, imm16):\n+    \"\"\"OR3 - Logical OR between a register and an immediate\"\"\"\n+\n+    # Rn <- Rm or ZeroExt(imm16)\n+    rn = rm | imm16\n+\n+\n+@sbuild.parse\n+def and3(rn, rm, imm16):\n+    \"\"\"AND3 - Logical AND between a register and an immediate\"\"\"\n+\n+    # Rn <- Rm and ZeroExt(imm16)\n+    rn = rm & imm16\n+\n+\n+@sbuild.parse\n+def xor3(rn, rm, imm16):\n+    \"\"\"XOR3 - Logical XOR between a register and an immediate\"\"\"\n+\n+    # Rn <- Rm xor ZeroExt(imm16)\n+    rn = rm ^ imm16\n+\n+\n+### Shift instruction\n+\n+@sbuild.parse\n+def sra(rn, rm_or_imm5):\n+    \"\"\"SRA - Shift Right signed\"\"\"\n+\n+    # Rn <- (Signed) Rn >> Rm4..0\n+    # Rn <- (Signed) Rn >> imm5\n+\n+    # Unsigned result\n+    shift_u = rn >> rm_or_imm5\n+\n+    # Signed result\n+    shift_mask = i32(32) - rm_or_imm5\n+    mask = (i32(0xFFFFFFFF) >> shift_mask) << shift_mask\n+    shift_s = shift_u | mask\n+\n+    rn = shift_s if rn.msb() else shift_u\n+\n+\n+@sbuild.parse\n+def srl(rn, rm_or_imm5):\n+    \"\"\"SRL - Shift Right unsigned.\"\"\"\n+\n+    # Rn <- (Unsigned) Rn >> Rm4..0\n+    # Rn <- (Unsigned) Rn >> imm5\n+    rn = rn >> rm_or_imm5\n+\n+\n+@sbuild.parse\n+def sll(rn, rm_or_imm5):\n+    \"\"\"SLL - Shift Left unsigned.\"\"\"\n+\n+    # Rn <- (Unsigned) Rn >> Rm4..0\n+    # Rn <- (Unsigned) Rn << imm5\n+    rn = rn << rm_or_imm5\n+\n+\n+@sbuild.parse\n+def sll3(r0, rn, imm5):\n+    \"\"\"SLL3 - Shift Left unsigned, with 3 arguments.\"\"\"\n+\n+    # R0 <- (Unsigned) Rn << imm5\n+    r0 = rn << imm5\n+\n+\n+@sbuild.parse\n+def fsft(rn, rm):\n+    \"FSFT - Funnel shift.\"\"\"\n+\n+    # Rn <- ((Rn||Rm)<<SAR5..0)63..32\n+    # Note: lowest Rm bits are discarded\n+\n+    sar = SAR[:5].zeroExtend(32)\n+    tmp_rn = rn << sar  # Shift Rn\n+    tmp_rm = rm >> (i32(32) - sar)  # Shift Rm in the reverse order\n+    rn = tmp_rn | tmp_rm  # Concatenate registers\n+\n+\n+## Branch/Jump instructions\n+\n+@sbuild.parse\n+def bra(disp12):\n+    \"\"\"BRA - Branch to an address.\"\"\"\n+\n+    # PC <- PC + SignExt((disp12)11..1||0)\n+    dst = disp12\n+    PC = dst\n+    ir.IRDst = dst\n+\n+\n+@sbuild.parse\n+def beqz(reg_test, disp8):\n+    \"\"\"BEQZ - Branch if the register stores zero.\"\"\"\n+\n+    # if(Rn==0) PC <- PC +SignExt((disp8)7..1||0)\n+    dst = ExprLoc(ir.get_next_break_loc_key(instr), 32) if reg_test else disp8\n+    PC = dst\n+    ir.IRDst = dst\n+\n+\n+@sbuild.parse\n+def bnez(reg_test, disp8):\n+    \"\"\"BNEZ - Branch if the register does not store zero.\"\"\"\n+\n+    # if(Rn!=0) PC <- PC + SignExt((disp8)7..1||0)\n+    dst = disp8 if \"-\"(reg_test, i32(0)) else ExprLoc(ir.get_next_break_loc_key(instr), 32)\n+    PC = dst\n+    ir.IRDst = dst\n+\n+\n+@sbuild.parse\n+def beqi(reg_test, imm4, disp16):\n+    \"\"\"BEQI - Branch if the register stores imm4.\"\"\"\n+\n+    # if(Rn==ZeroExt(imm4)) PC <- PC +SignExt((disp17)16..1||0)\n+    dst = ExprLoc(ir.get_next_break_loc_key(instr), 32) if \"-\"(reg_test, imm4) else disp16\n+    PC = dst\n+    ir.IRDst = dst\n+\n+\n+@sbuild.parse\n+def bnei(reg_test, imm4, disp16):\n+    \"\"\"BNEI - Branch if the register does not store imm4.\"\"\"\n+\n+    # if(Rn!=ZeroExt(imm4)) PC <- PC+SignExt((disp17)16..1||0)\n+    dst = disp16 if \"-\"(reg_test, imm4) else ExprLoc(ir.get_next_break_loc_key(instr), 32)\n+    PC = dst\n+    ir.IRDst = dst\n+\n+\n+@sbuild.parse\n+def blti(reg_test, imm4, disp16):\n+    \"\"\"BLTI - Branch if the register is lower than imm4.\"\"\"\n+\n+    # if(Rn< ZeroExt(imm4)) PC <- PC +SignExt((disp17)16..1||0) - (Signed comparison)\n+    dst = disp16 if \"<\"(reg_test, imm4) else ExprLoc(ir.get_next_break_loc_key(instr), 32)","path":"miasm2/arch/mep/sem.py","position":526,"original_position":526,"commit_id":"6769633ec15bffe0c298df039cae49129750b1dd","original_commit_id":"6769633ec15bffe0c298df039cae49129750b1dd","user":{"login":"guedou","id":11683796,"node_id":"MDQ6VXNlcjExNjgzNzk2","avatar_url":"https://avatars1.githubusercontent.com/u/11683796?v=4","gravatar_id":"","url":"https://api.github.com/users/guedou","html_url":"https://github.com/guedou","followers_url":"https://api.github.com/users/guedou/followers","following_url":"https://api.github.com/users/guedou/following{/other_user}","gists_url":"https://api.github.com/users/guedou/gists{/gist_id}","starred_url":"https://api.github.com/users/guedou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guedou/subscriptions","organizations_url":"https://api.github.com/users/guedou/orgs","repos_url":"https://api.github.com/users/guedou/repos","events_url":"https://api.github.com/users/guedou/events{/privacy}","received_events_url":"https://api.github.com/users/guedou/received_events","type":"User","site_admin":false},"body":"The failing tests are likely caused by this line. Locally, I am using PR #556.\r\n\r\nWhat is the correct way to modify this line?","created_at":"2018-06-16T12:18:52Z","updated_at":"2018-06-16T12:18:53Z","html_url":"https://github.com/cea-sec/miasm/pull/763#discussion_r195901884","pull_request_url":"https://api.github.com/repos/cea-sec/miasm/pulls/763","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/comments/195901884"},"html":{"href":"https://github.com/cea-sec/miasm/pull/763#discussion_r195901884"},"pull_request":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/763"}}},"pull_request":{"url":"https://api.github.com/repos/cea-sec/miasm/pulls/763","id":195132805,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTMyODA1","html_url":"https://github.com/cea-sec/miasm/pull/763","diff_url":"https://github.com/cea-sec/miasm/pull/763.diff","patch_url":"https://github.com/cea-sec/miasm/pull/763.patch","issue_url":"https://api.github.com/repos/cea-sec/miasm/issues/763","number":763,"state":"open","locked":false,"title":"Toshiba MeP support","user":{"login":"guedou","id":11683796,"node_id":"MDQ6VXNlcjExNjgzNzk2","avatar_url":"https://avatars1.githubusercontent.com/u/11683796?v=4","gravatar_id":"","url":"https://api.github.com/users/guedou","html_url":"https://github.com/guedou","followers_url":"https://api.github.com/users/guedou/followers","following_url":"https://api.github.com/users/guedou/following{/other_user}","gists_url":"https://api.github.com/users/guedou/gists{/gist_id}","starred_url":"https://api.github.com/users/guedou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guedou/subscriptions","organizations_url":"https://api.github.com/users/guedou/orgs","repos_url":"https://api.github.com/users/guedou/repos","events_url":"https://api.github.com/users/guedou/events{/privacy}","received_events_url":"https://api.github.com/users/guedou/received_events","type":"User","site_admin":false},"body":"This PR adds a new architecture to miasm. Toshiba MeP-c4 can be assembled, disassembled and jited.\r\n\r\nIt might require some modifications:\r\n- I tried to document it as much as possible in order to help future architectures developers. Some `# GV:` comments might be removed or replaced\r\n- test are currently performed using `pytest`. I did not investigate how to integrate them to `test_all.py`\r\n\r\nComments are welcome =)","created_at":"2018-06-15T10:15:25Z","updated_at":"2018-06-16T12:18:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ad0d584869da6f7d0b61933b4a0fdecc360d312","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cea-sec/miasm/pulls/763/commits","review_comments_url":"https://api.github.com/repos/cea-sec/miasm/pulls/763/comments","review_comment_url":"https://api.github.com/repos/cea-sec/miasm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cea-sec/miasm/issues/763/comments","statuses_url":"https://api.github.com/repos/cea-sec/miasm/statuses/6769633ec15bffe0c298df039cae49129750b1dd","head":{"label":"guedou:Toshiba_MeP-c4","ref":"Toshiba_MeP-c4","sha":"6769633ec15bffe0c298df039cae49129750b1dd","user":{"login":"guedou","id":11683796,"node_id":"MDQ6VXNlcjExNjgzNzk2","avatar_url":"https://avatars1.githubusercontent.com/u/11683796?v=4","gravatar_id":"","url":"https://api.github.com/users/guedou","html_url":"https://github.com/guedou","followers_url":"https://api.github.com/users/guedou/followers","following_url":"https://api.github.com/users/guedou/following{/other_user}","gists_url":"https://api.github.com/users/guedou/gists{/gist_id}","starred_url":"https://api.github.com/users/guedou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guedou/subscriptions","organizations_url":"https://api.github.com/users/guedou/orgs","repos_url":"https://api.github.com/users/guedou/repos","events_url":"https://api.github.com/users/guedou/events{/privacy}","received_events_url":"https://api.github.com/users/guedou/received_events","type":"User","site_admin":false},"repo":{"id":58953967,"node_id":"MDEwOlJlcG9zaXRvcnk1ODk1Mzk2Nw==","name":"miasm-issues","full_name":"guedou/miasm-issues","owner":{"login":"guedou","id":11683796,"node_id":"MDQ6VXNlcjExNjgzNzk2","avatar_url":"https://avatars1.githubusercontent.com/u/11683796?v=4","gravatar_id":"","url":"https://api.github.com/users/guedou","html_url":"https://github.com/guedou","followers_url":"https://api.github.com/users/guedou/followers","following_url":"https://api.github.com/users/guedou/following{/other_user}","gists_url":"https://api.github.com/users/guedou/gists{/gist_id}","starred_url":"https://api.github.com/users/guedou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guedou/subscriptions","organizations_url":"https://api.github.com/users/guedou/orgs","repos_url":"https://api.github.com/users/guedou/repos","events_url":"https://api.github.com/users/guedou/events{/privacy}","received_events_url":"https://api.github.com/users/guedou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guedou/miasm-issues","description":"Reverse engineering framework in Python","fork":true,"url":"https://api.github.com/repos/guedou/miasm-issues","forks_url":"https://api.github.com/repos/guedou/miasm-issues/forks","keys_url":"https://api.github.com/repos/guedou/miasm-issues/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guedou/miasm-issues/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guedou/miasm-issues/teams","hooks_url":"https://api.github.com/repos/guedou/miasm-issues/hooks","issue_events_url":"https://api.github.com/repos/guedou/miasm-issues/issues/events{/number}","events_url":"https://api.github.com/repos/guedou/miasm-issues/events","assignees_url":"https://api.github.com/repos/guedou/miasm-issues/assignees{/user}","branches_url":"https://api.github.com/repos/guedou/miasm-issues/branches{/branch}","tags_url":"https://api.github.com/repos/guedou/miasm-issues/tags","blobs_url":"https://api.github.com/repos/guedou/miasm-issues/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guedou/miasm-issues/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guedou/miasm-issues/git/refs{/sha}","trees_url":"https://api.github.com/repos/guedou/miasm-issues/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guedou/miasm-issues/statuses/{sha}","languages_url":"https://api.github.com/repos/guedou/miasm-issues/languages","stargazers_url":"https://api.github.com/repos/guedou/miasm-issues/stargazers","contributors_url":"https://api.github.com/repos/guedou/miasm-issues/contributors","subscribers_url":"https://api.github.com/repos/guedou/miasm-issues/subscribers","subscription_url":"https://api.github.com/repos/guedou/miasm-issues/subscription","commits_url":"https://api.github.com/repos/guedou/miasm-issues/commits{/sha}","git_commits_url":"https://api.github.com/repos/guedou/miasm-issues/git/commits{/sha}","comments_url":"https://api.github.com/repos/guedou/miasm-issues/comments{/number}","issue_comment_url":"https://api.github.com/repos/guedou/miasm-issues/issues/comments{/number}","contents_url":"https://api.github.com/repos/guedou/miasm-issues/contents/{+path}","compare_url":"https://api.github.com/repos/guedou/miasm-issues/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guedou/miasm-issues/merges","archive_url":"https://api.github.com/repos/guedou/miasm-issues/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guedou/miasm-issues/downloads","issues_url":"https://api.github.com/repos/guedou/miasm-issues/issues{/number}","pulls_url":"https://api.github.com/repos/guedou/miasm-issues/pulls{/number}","milestones_url":"https://api.github.com/repos/guedou/miasm-issues/milestones{/number}","notifications_url":"https://api.github.com/repos/guedou/miasm-issues/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guedou/miasm-issues/labels{/name}","releases_url":"https://api.github.com/repos/guedou/miasm-issues/releases{/id}","deployments_url":"https://api.github.com/repos/guedou/miasm-issues/deployments","created_at":"2016-05-16T17:46:35Z","updated_at":"2018-06-14T13:53:28Z","pushed_at":"2018-06-16T10:40:33Z","git_url":"git://github.com/guedou/miasm-issues.git","ssh_url":"git@github.com:guedou/miasm-issues.git","clone_url":"https://github.com/guedou/miasm-issues.git","svn_url":"https://github.com/guedou/miasm-issues","homepage":null,"size":13519,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"cea-sec:master","ref":"master","sha":"99e1aeaa41d3560f4f1ed226a00ad2ea198efc2d","user":{"login":"cea-sec","id":5071925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwNzE5MjU=","avatar_url":"https://avatars2.githubusercontent.com/u/5071925?v=4","gravatar_id":"","url":"https://api.github.com/users/cea-sec","html_url":"https://github.com/cea-sec","followers_url":"https://api.github.com/users/cea-sec/followers","following_url":"https://api.github.com/users/cea-sec/following{/other_user}","gists_url":"https://api.github.com/users/cea-sec/gists{/gist_id}","starred_url":"https://api.github.com/users/cea-sec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cea-sec/subscriptions","organizations_url":"https://api.github.com/users/cea-sec/orgs","repos_url":"https://api.github.com/users/cea-sec/repos","events_url":"https://api.github.com/users/cea-sec/events{/privacy}","received_events_url":"https://api.github.com/users/cea-sec/received_events","type":"Organization","site_admin":false},"repo":{"id":25875083,"node_id":"MDEwOlJlcG9zaXRvcnkyNTg3NTA4Mw==","name":"miasm","full_name":"cea-sec/miasm","owner":{"login":"cea-sec","id":5071925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwNzE5MjU=","avatar_url":"https://avatars2.githubusercontent.com/u/5071925?v=4","gravatar_id":"","url":"https://api.github.com/users/cea-sec","html_url":"https://github.com/cea-sec","followers_url":"https://api.github.com/users/cea-sec/followers","following_url":"https://api.github.com/users/cea-sec/following{/other_user}","gists_url":"https://api.github.com/users/cea-sec/gists{/gist_id}","starred_url":"https://api.github.com/users/cea-sec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cea-sec/subscriptions","organizations_url":"https://api.github.com/users/cea-sec/orgs","repos_url":"https://api.github.com/users/cea-sec/repos","events_url":"https://api.github.com/users/cea-sec/events{/privacy}","received_events_url":"https://api.github.com/users/cea-sec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cea-sec/miasm","description":"Reverse engineering framework in Python","fork":false,"url":"https://api.github.com/repos/cea-sec/miasm","forks_url":"https://api.github.com/repos/cea-sec/miasm/forks","keys_url":"https://api.github.com/repos/cea-sec/miasm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cea-sec/miasm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cea-sec/miasm/teams","hooks_url":"https://api.github.com/repos/cea-sec/miasm/hooks","issue_events_url":"https://api.github.com/repos/cea-sec/miasm/issues/events{/number}","events_url":"https://api.github.com/repos/cea-sec/miasm/events","assignees_url":"https://api.github.com/repos/cea-sec/miasm/assignees{/user}","branches_url":"https://api.github.com/repos/cea-sec/miasm/branches{/branch}","tags_url":"https://api.github.com/repos/cea-sec/miasm/tags","blobs_url":"https://api.github.com/repos/cea-sec/miasm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cea-sec/miasm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cea-sec/miasm/git/refs{/sha}","trees_url":"https://api.github.com/repos/cea-sec/miasm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cea-sec/miasm/statuses/{sha}","languages_url":"https://api.github.com/repos/cea-sec/miasm/languages","stargazers_url":"https://api.github.com/repos/cea-sec/miasm/stargazers","contributors_url":"https://api.github.com/repos/cea-sec/miasm/contributors","subscribers_url":"https://api.github.com/repos/cea-sec/miasm/subscribers","subscription_url":"https://api.github.com/repos/cea-sec/miasm/subscription","commits_url":"https://api.github.com/repos/cea-sec/miasm/commits{/sha}","git_commits_url":"https://api.github.com/repos/cea-sec/miasm/git/commits{/sha}","comments_url":"https://api.github.com/repos/cea-sec/miasm/comments{/number}","issue_comment_url":"https://api.github.com/repos/cea-sec/miasm/issues/comments{/number}","contents_url":"https://api.github.com/repos/cea-sec/miasm/contents/{+path}","compare_url":"https://api.github.com/repos/cea-sec/miasm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cea-sec/miasm/merges","archive_url":"https://api.github.com/repos/cea-sec/miasm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cea-sec/miasm/downloads","issues_url":"https://api.github.com/repos/cea-sec/miasm/issues{/number}","pulls_url":"https://api.github.com/repos/cea-sec/miasm/pulls{/number}","milestones_url":"https://api.github.com/repos/cea-sec/miasm/milestones{/number}","notifications_url":"https://api.github.com/repos/cea-sec/miasm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cea-sec/miasm/labels{/name}","releases_url":"https://api.github.com/repos/cea-sec/miasm/releases{/id}","deployments_url":"https://api.github.com/repos/cea-sec/miasm/deployments","created_at":"2014-10-28T15:05:47Z","updated_at":"2018-06-16T07:44:52Z","pushed_at":"2018-06-16T10:40:35Z","git_url":"git://github.com/cea-sec/miasm.git","ssh_url":"git@github.com:cea-sec/miasm.git","clone_url":"https://github.com/cea-sec/miasm.git","svn_url":"https://github.com/cea-sec/miasm","homepage":null,"size":13463,"stargazers_count":1270,"watchers_count":1270,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":220,"mirror_url":null,"archived":false,"open_issues_count":54,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":220,"open_issues":54,"watchers":1270,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/763"},"html":{"href":"https://github.com/cea-sec/miasm/pull/763"},"issue":{"href":"https://api.github.com/repos/cea-sec/miasm/issues/763"},"comments":{"href":"https://api.github.com/repos/cea-sec/miasm/issues/763/comments"},"review_comments":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/763/comments"},"review_comment":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cea-sec/miasm/pulls/763/commits"},"statuses":{"href":"https://api.github.com/repos/cea-sec/miasm/statuses/6769633ec15bffe0c298df039cae49129750b1dd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"guedou"}}