Skip to content

Instantly share code, notes, and snippets.

@iagox86
Created September 17, 2014 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iagox86/63b124461de0ff9dbdf6 to your computer and use it in GitHub Desktop.
Save iagox86/63b124461de0ff9dbdf6 to your computer and use it in GitHub Desktop.
{
"name": "strrchr example",
"labels": [
{
"name": "start",
"offset": "0x0"
},
{
"name": "loc1",
"offset": "0x17"
},
{
"name": "loc2",
"offset": "0x22"
},
{
"name": "loc3",
"offset": "0x2e"
},
{
"name": "loc4",
"offset": "0x30"
}
],
"segments": [
{
"name": ".raw",
"offset": "0x0",
"length": "0x34"
}
],
"memory": [
{
"offset": "0x00",
"type": "instruction",
"raw": "55",
"instruction":
{
"operator": "push",
"operands": [ {"type": "register", "value": "ebp"} ]
},
"refs": ["0x01"],
"xrefs": []
},
{
"offset": "0x01",
"type": "instruction",
"raw": "89 E5",
"instruction":
{
"operator": "mov",
"operands": [ {"type": "register", "value": "ebp"}, {"type": "register", "value": "esp"}]
},
"refs": ["0x03"],
"xrefs": ["0x01"]
},
{
"offset": "0x03",
"type": "instruction",
"raw": "8B 45 04",
"instruction":
{
"operator": "mov",
"operands": [ {"type": "register", "value": "eax"}, {"type": "memory", "value": "[ebp+0x4]"}]
},
"refs": ["0x06"],
"xrefs": ["0x03"]
},
{
"offset": "0x06",
"type": "instruction",
"raw": "85 C0",
"instruction":
{
"operator": "test",
"operands": [ {"type": "register", "value": "eax"}, {"type": "register", "value": "eax"}]
},
"refs": ["0x08"],
"xrefs": ["0x06"]
},
{
"offset": "0x08",
"type": "instruction",
"raw": "75 0D",
"instruction":
{
"operator": "jnz",
"operands": [ {"type": "immediate", "value": "0x17"}]
},
"refs": ["0x0A", "0x17"],
"xrefs": ["0x06"]
},
{
"offset": "0x0A",
"type": "instruction",
"raw": "6A 57",
"instruction":
{
"operator": "push",
"operands": [ {"type": "immediate", "value": "0x57"}]
},
"refs": ["0xc"],
"xrefs": ["0x8"]
},
{
"offset": "0x0C",
"type": "instruction",
"raw": "E8 23 00 00 00",
"instruction":
{
"operator": "call",
"operands": [ {"type": "immediate", "value": "0x34"}]
},
"refs": ["0x11"],
"xrefs": ["0xA"]
},
{
"offset": "0x11",
"type": "instruction",
"raw": "31 C0",
"instruction":
{
"operator": "xor" ,
"operands": [ {"type": "register", "value": "eax"}, {"type": "register", "value": "eax"}]
},
"refs": ["0x13"],
"xrefs": ["0x0c"]
},
{
"offset": "0x13",
"type": "instruction",
"raw": "5D",
"instruction":
{
"operator": "pop",
"operands": [ {"type": "register", "value": "ebp"}]
},
"refs": ["0x14"],
"xrefs": ["0x11"]
},
{
"offset": "0x14",
"type": "instruction",
"raw": "C2 08 00",
"instruction":
{
"operator": "ret",
"operands": [ {"type": "immediate", "value": "0x8"}]
},
"refs": [],
"xrefs": ["0x13"]
},
{
"offset": "0x17",
"type": "instruction",
"raw": "8A 08",
"instruction":
{
"operator": "mov",
"operands": [ {"type": "register", "value": "cl"}, {"type": "memory", "value": "[eax]"}]
},
"refs": ["0x19"],
"xrefs": ["0x14", "0x08"]
},
{
"offset": "0x19",
"type": "instruction",
"raw": "84 C9",
"instruction":
{
"operator": "test",
"operands": [ {"type": "register", "value": "cl"}, {"type": "register", "value": "cl"}]
},
"refs": ["0x1b"],
"xrefs": ["0x17"]
},
{
"offset": "0x1B",
"type": "instruction",
"raw": "74 11",
"instruction":
{
"operator": "jz",
"operands": [ {"type": "immediate", "value": "0x2e"}]
},
"refs": ["0x1d", "0x2e"],
"xrefs": ["0x19"]
},
{
"offset": "0x1D",
"type": "instruction",
"raw": "8A 55 08",
"instruction":
{
"operator": "mov",
"operands": [ {"type": "register", "value": "dl"}, {"type": "memory", "value": "[ebp+0x8]"}]
},
"refs": ["0x20"],
"xrefs": ["0x1b"]
},
{
"offset": "0x20",
"type": "instruction",
"raw": "EB 00",
"instruction":
{
"operator": "jmp",
"operands": [ {"type": "immediate", "value": "0x22"}]
},
"refs": ["0x22"],
"xrefs": ["0x1d"]
},
{
"offset": "0x22",
"type": "instruction",
"raw": "38 D1",
"instruction":
{
"operator": "cmp",
"operands": [ {"type": "register", "value": "cl"}, {"type": "register", "value": "dl"}]
},
"refs": ["0x24"],
"xrefs": ["0x20", "0x2C"]
},
{
"offset": "0x24",
"type": "instruction",
"raw": "74 0A",
"instruction":
{
"operator": "jz",
"operands": [ {"type": "immediate", "value": "0x30"}]
},
"refs": ["0x24", "0x26"],
"xrefs": ["0x22"]
},
{
"offset": "0x26",
"type": "instruction",
"raw": "8A 48 01",
"instruction":
{
"operator": "mov",
"operands": [ {"type": "register", "value": "cl"}, {"type": "memory", "value": "[eax+0x1]"}]
},
"refs": ["0x29"],
"xrefs": ["0x24"]
},
{
"offset": "0x29",
"type": "instruction",
"raw": "40",
"instruction":
{
"operator": "inc",
"operands": [ {"type": "register", "value": "eax"}]
},
"refs": ["0x2a"],
"xrefs": ["0x26"]
},
{
"offset": "0x2A",
"type": "instruction",
"raw": "84 C9",
"instruction":
{
"operator": "test",
"operands": [ {"type": "register", "value": "cl"}, {"type": "register", "value": "cl"}]
},
"refs": ["0x2c"],
"xrefs": ["0x2a"]
},
{
"offset": "0x2C",
"type": "instruction",
"raw": "75 F4",
"instruction":
{
"operator": "jnz",
"operands": [ {"type": "immediate", "value": "0x22"}]
},
"refs": ["0x2e"],
"xrefs": ["0x2a"]
},
{
"offset": "0x2E",
"type": "instruction",
"raw": "31 C0",
"instruction":
{
"operator": "xor",
"operands": [ {"type": "register", "value": "eax"}, {"type": "register", "value": "eax"}]
},
"refs": ["0x30"],
"xrefs": ["0x2c", "0x1b", "0x24"]
},
{
"offset": "0x30",
"type": "instruction",
"raw": "5D",
"instruction":
{
"operator": "pop",
"operands": [ {"type": "register", "value": "ebp"}]
},
"refs": ["0x31"],
"xrefs": ["0x2e", "0x24"]
},
{
"offset": "0x31",
"type": "instruction",
"raw": "C2 08 00",
"instruction":
{
"operator": "ret",
"operands": [ {"type": "immediate", "value": "0x8"}]
},
"refs": [],
"xrefs": ["0x30"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment