Aaron Sorkin has a fruitful working relationship with Sony Pictures Entertainment. The studio distributed his hit films The Social Network and Moneyball and is actively seeking to develop new projects with him, including at one point the ill-fated Steve Jobs biopic. But none of that stopped SPE co-chairman Amy Pascal from alleging in an email that Sorkin is broke—or that he's sleeping with an author whose book he is turning into a movie.

Sorkin has spent much of the last two months discussing three films with SPE. One is the untitled and perhaps nonexistent Steve Jobs biopic that caused Pascal and producer Scott Rudin to have a prolonged meltdown. The other two films are the financial-industry drama Flash Boys, based on the Michael Lewis book Flash Boys: A Wall Street Revolt; and Molly's Game, an adaptation of a book of the same name about a woman named Molly Bloom who ran an underground poker ring in Los Angeles.

Since at least October, when he sent an email listing projects he wanted to work on, Sorkin had been going back and forth about Flash Boys and Molly's Game with Pascal and other SPE executives over email. But on Nov. 13 his agent Ari Emanuel told SPE that Sorkin was deciding not to take on Flash Boys, and wanted to shop Molly's Game around town.

Later that day, Pascal sent a long and biting missive to Doug Belgrad, president of Columbia Pictures and Sony Pictures Entertainment Motion Picture Group, as well as Michael De Luca and Hannah Minghella, the co-presidents of production at Columbia.

In the email, Pascal runs down the statuses of a number of projects—and lashes out at Sorkin, saying that he's trying to play hardball, is "broke," "just wants to get paid" and is maybe sleeping with Bloom, the author of Molly's Game.

Sorkin, it's clear from Emanuel's email, vastly prefers Molly's Game to Flash Boys—but Pascal would much rather he work on Flash Boys than "the poker movie." Sorkin and Emanuel are shopping the movie around to "Donna" (Langley, the Universal Pictures chair) and "Stacey" (Snider, who had just started as co-chair of 20th Century Fox). She also notes that Sony paid Sorkin an "insane fee" for some sort of work on Flash Boys—over the summer, trade reports suggested that Sorkin had all but signed on to to adapt the film.

It's unclear what exactly Sony paid Sorkin to do on Flash Boys considering he decided to not go forward with the film, but we do have an idea of what his "insane fee" might look like. Below is a document that lists various salaries for the non-existent Jobs film, which shows Sorkin being paid $2 million for his draft of the film as well as $3 million in deferred money.

A day later, Pascal emailed Sorkin to tell him that she doesn't think she can raise enough money to get the Michael Fassbender version of the Jobs movie made. Sorkin responds to her by saying that in order to make up for the Jobs debacle, she's asking him to write a film he doesn't want to write—Flash Boys—while putting the one he does want to do—Molly's Game—on the backburner.

In an email later that evening, Sorkin elucidated to Pascal his reasoning behind not wanting to do Flash Boys—not only did he think Flash Boys was too research-intensive and didn't have an obvious plot, it would be hard to make because its protagonist is Asian-Canadian but "there aren't any Asian movie stars."

"All of this is happening," he continues, "against the the backdrop of the disintegration of Steve Jobs, which is completely blowing my mind." Clearly, producer Scott Rudin wasn't the only person frustrated with Sony's handling of the Jobs movie.

Pascal responds to this email by asking Sorkin to call her. After their phone call, Sorkin sent the following email, which confirms that he was shopping Molly's Game around and that he is looking for money to pay for his teenage daughter Roxy's schooling:

Sorkin tells Pascal that Paramount is interested in the film, as well as Stacey Snider at 20th Century Fox, though Sorkin says that Snider is nervous about angering Tobey Maguire's father-in-law Ronald Meyer, chairman of NBC Universal, probably because Bloom writes negatively of Maguire in her book.

Despite all that, Sorkin maintains that he wants to make the movie with Pascal and Sony. He leans on their personal relationship—"I know you and I like you and I have an important relationship with you that I want to continue"—and even says that he will take a deal based on the success of the film as long as he gets enough money "in the meantime" to pay for his daughter's tuition.

Pascal, in turn, forwarded that email to fellow Sony executives Belgrad and DeLuca. Belgrad responded, "Don't let Aaron guilt you by mentioning Roxy's tuition."

That is the last that Sorkin and Pascal discussed Molly's Game in the emails leaked by Sony's hackers. But after the death of the Jobs biopic at Sony, Pascal asked Sorkin if she could call him, and he responded, "Absolutely—anytime you want."

Sorkin and Pascal need each other, of course. As long as he is writing blockbusters, Sony will still saddle up to him. As Pascal says herself in her rant, the studio "want[s] to be in the Aaron business." And Sorkin, it appears, could use the money.