{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/comments/76325807","id":76325807,"diff_hunk":"@@ -0,0 +1,81 @@\n+import IReadableFile from \"./IReadableFile\";\n+import PEParserError from \"./PEParserError\";\n+import {SectionTable, SectionTableEntry} from \"./SectionTable\";\n+\n+const peSignature = 0x00004550;\n+const dosSignature = 0x5A4D;\n+\n+const sizeOfCoffHeader = 20;\n+\n+export interface CoffHeader {\n+    machine: number;\n+    numberOfSections: number;\n+    timeDateStamp: number;\n+    pointerToSymbolTable: number;\n+    numberOfSymbols: number;\n+    sizeOfOptionalHeader: number;\n+    characteristics: number;\n+}\n+\n+export class PEImageFile {\n+    constructor(public coffHeader: CoffHeader, public sectionTable: SectionTable) { }\n+\n+    public static async readAsync(file: IReadableFile): Promise<PEImageFile> {\n+        let buffer = new Buffer(1024);\n+        buffer.fill(0);\n+\n+        // read the DOS signature\n+        await file.readAsync(buffer, 0, 2, 0);\n+        const dosSignatureValue = buffer.readUInt16LE(0);\n+        if (dosSignatureValue !== dosSignature) {\n+            throw new PEParserError(\n+                \"invalidSignature\",\n+                \"The DOS signature of the PE file does not match the expected value\");\n+        }\n+\n+        // read the pointer to the PE signature\n+        await file.readAsync(buffer, 0, 4, 0x3c);","path":"Tasks/Common/nuget-task-common/pe-parser/PEImageFile.ts","position":37,"original_position":37,"commit_id":"56b39ee2f85cd443c63794f82385f249ebd73e7d","original_commit_id":"56b39ee2f85cd443c63794f82385f249ebd73e7d","user":{"login":"jmyersmsft","id":11822817,"avatar_url":"https://avatars.githubusercontent.com/u/11822817?v=3","gravatar_id":"","url":"https://api.github.com/users/jmyersmsft","html_url":"https://github.com/jmyersmsft","followers_url":"https://api.github.com/users/jmyersmsft/followers","following_url":"https://api.github.com/users/jmyersmsft/following{/other_user}","gists_url":"https://api.github.com/users/jmyersmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jmyersmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmyersmsft/subscriptions","organizations_url":"https://api.github.com/users/jmyersmsft/orgs","repos_url":"https://api.github.com/users/jmyersmsft/repos","events_url":"https://api.github.com/users/jmyersmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jmyersmsft/received_events","type":"User","site_admin":false},"body":"named constant","created_at":"2016-08-25T21:13:25Z","updated_at":"2016-08-25T21:13:25Z","html_url":"https://github.com/Microsoft/vsts-tasks/pull/2336#discussion_r76325807","pull_request_url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/comments/76325807"},"html":{"href":"https://github.com/Microsoft/vsts-tasks/pull/2336#discussion_r76325807"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336","id":82775152,"html_url":"https://github.com/Microsoft/vsts-tasks/pull/2336","diff_url":"https://github.com/Microsoft/vsts-tasks/pull/2336.diff","patch_url":"https://github.com/Microsoft/vsts-tasks/pull/2336.patch","issue_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2336","number":2336,"state":"open","locked":false,"title":"Detect NuGet version and adjust behavior by per-version quirks","user":{"login":"jmyersmsft","id":11822817,"avatar_url":"https://avatars.githubusercontent.com/u/11822817?v=3","gravatar_id":"","url":"https://api.github.com/users/jmyersmsft","html_url":"https://github.com/jmyersmsft","followers_url":"https://api.github.com/users/jmyersmsft/followers","following_url":"https://api.github.com/users/jmyersmsft/following{/other_user}","gists_url":"https://api.github.com/users/jmyersmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jmyersmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmyersmsft/subscriptions","organizations_url":"https://api.github.com/users/jmyersmsft/orgs","repos_url":"https://api.github.com/users/jmyersmsft/repos","events_url":"https://api.github.com/users/jmyersmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jmyersmsft/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-25T19:05:47Z","updated_at":"2016-08-25T21:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ed677c4de474c2cf80982c03528dd882400990a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2336/comments","statuses_url":"https://api.github.com/repos/Microsoft/vsts-tasks/statuses/56b39ee2f85cd443c63794f82385f249ebd73e7d","head":{"label":"jmyersmsft:detectNuGetVersion","ref":"detectNuGetVersion","sha":"56b39ee2f85cd443c63794f82385f249ebd73e7d","user":{"login":"jmyersmsft","id":11822817,"avatar_url":"https://avatars.githubusercontent.com/u/11822817?v=3","gravatar_id":"","url":"https://api.github.com/users/jmyersmsft","html_url":"https://github.com/jmyersmsft","followers_url":"https://api.github.com/users/jmyersmsft/followers","following_url":"https://api.github.com/users/jmyersmsft/following{/other_user}","gists_url":"https://api.github.com/users/jmyersmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jmyersmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmyersmsft/subscriptions","organizations_url":"https://api.github.com/users/jmyersmsft/orgs","repos_url":"https://api.github.com/users/jmyersmsft/repos","events_url":"https://api.github.com/users/jmyersmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jmyersmsft/received_events","type":"User","site_admin":false},"repo":{"id":50451379,"name":"vso-agent-tasks","full_name":"jmyersmsft/vso-agent-tasks","owner":{"login":"jmyersmsft","id":11822817,"avatar_url":"https://avatars.githubusercontent.com/u/11822817?v=3","gravatar_id":"","url":"https://api.github.com/users/jmyersmsft","html_url":"https://github.com/jmyersmsft","followers_url":"https://api.github.com/users/jmyersmsft/followers","following_url":"https://api.github.com/users/jmyersmsft/following{/other_user}","gists_url":"https://api.github.com/users/jmyersmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jmyersmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmyersmsft/subscriptions","organizations_url":"https://api.github.com/users/jmyersmsft/orgs","repos_url":"https://api.github.com/users/jmyersmsft/repos","events_url":"https://api.github.com/users/jmyersmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jmyersmsft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmyersmsft/vso-agent-tasks","description":"Build and Release Tasks for Visual Studio Online and Team Foundation Server","fork":true,"url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks","forks_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/forks","keys_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/teams","hooks_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/hooks","issue_events_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/events","assignees_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/tags","blobs_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/languages","stargazers_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/stargazers","contributors_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/contributors","subscribers_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/subscribers","subscription_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/subscription","commits_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/merges","archive_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/downloads","issues_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/labels{/name}","releases_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/jmyersmsft/vso-agent-tasks/deployments","created_at":"2016-01-26T18:57:02Z","updated_at":"2016-01-26T18:57:05Z","pushed_at":"2016-08-25T18:41:48Z","git_url":"git://github.com/jmyersmsft/vso-agent-tasks.git","ssh_url":"git@github.com:jmyersmsft/vso-agent-tasks.git","clone_url":"https://github.com/jmyersmsft/vso-agent-tasks.git","svn_url":"https://github.com/jmyersmsft/vso-agent-tasks","homepage":" https://www.visualstudio.com/features/devops-vs","size":14464,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"f50282b0dde9bb0a5eab338a9828499472b197f9","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27631673,"name":"vsts-tasks","full_name":"Microsoft/vsts-tasks","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vsts-tasks","description":"Build and Release Tasks for Visual Studio Team Services and Team Foundation Server","fork":false,"url":"https://api.github.com/repos/Microsoft/vsts-tasks","forks_url":"https://api.github.com/repos/Microsoft/vsts-tasks/forks","keys_url":"https://api.github.com/repos/Microsoft/vsts-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vsts-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vsts-tasks/teams","hooks_url":"https://api.github.com/repos/Microsoft/vsts-tasks/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vsts-tasks/events","assignees_url":"https://api.github.com/repos/Microsoft/vsts-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vsts-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vsts-tasks/tags","blobs_url":"https://api.github.com/repos/Microsoft/vsts-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vsts-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vsts-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vsts-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vsts-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vsts-tasks/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vsts-tasks/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vsts-tasks/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vsts-tasks/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vsts-tasks/subscription","commits_url":"https://api.github.com/repos/Microsoft/vsts-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vsts-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vsts-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vsts-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vsts-tasks/merges","archive_url":"https://api.github.com/repos/Microsoft/vsts-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vsts-tasks/downloads","issues_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vsts-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vsts-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vsts-tasks/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vsts-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/deployments","created_at":"2014-12-06T11:11:46Z","updated_at":"2016-08-24T20:42:30Z","pushed_at":"2016-08-25T20:05:23Z","git_url":"git://github.com/Microsoft/vsts-tasks.git","ssh_url":"git@github.com:Microsoft/vsts-tasks.git","clone_url":"https://github.com/Microsoft/vsts-tasks.git","svn_url":"https://github.com/Microsoft/vsts-tasks","homepage":"https://aka.ms/tfbuild","size":18401,"stargazers_count":382,"watchers_count":382,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":344,"mirror_url":null,"open_issues_count":101,"forks":344,"open_issues":101,"watchers":382,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336"},"html":{"href":"https://github.com/Microsoft/vsts-tasks/pull/2336"},"issue":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2336"},"comments":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/2336/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/pulls/2336/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vsts-tasks/statuses/56b39ee2f85cd443c63794f82385f249ebd73e7d"}}}}
{"actor":{"display_login":"jmyersmsft"}}