[Galaxy S II General] rizdroid:
Here is a revised version of fguy's code. It's faster than the original (e.g. converts factoryfs in less than 10 sec).

program imgconv2;
{$APPTYPE CONSOLE}
uses
SysUtils;

var
nameFI : string;
nameFO : string;
FI : file;
FO : file;
s : string;
buff_fi : array[1..16384] of longword;
buff_fo : array[1..16384] of longword;
n_fi : longword;
n_fo : longword;
s_fo : longword;
t_fo : longword;
t_fi : longword;
ni : integer;
n : integer;
B1 : longword;
B2 : longword;
B3 : longword;
PhaseWork: integer;
k : integer;
i : integer;

begin
If ParamCount <> 2 then
begin
Writeln('Convertor SGS II img to ext4.');
Writeln('Convert_sgs2img file_input.img file_output.img');
Halt(0);
end;
nameFI := Paramstr(1);
nameFO := Paramstr(2);
try
assignfile(FI, nameFI);
assignfile(FO, nameFO);
reset(FI, 1);
rewrite(FO, 1);
s_fo := sizeof(buff_fo) shr 2;
blockread(FI, buff_fi, sizeof(buff_fi), ni);
ni := ni shr 2;
t_fi := longword(ni);
t_fo := 0;
writeln('');
write(^M + IntToStr(t_fi) + ':' + IntToStr(t_fo));
n_fi := 1;
n_fi := 8;
n_fo := 1;
PhaseWork := 0;
while (not eof(FI)) and (n_fi <= ni) do
begin
repeat
case PhaseWork of
0 : begin
B1 := buff_fi[n_fi];
inc(n_fi);
if n_fi > ni then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
if B1 = $0000CAC1 then
begin
B2 := buff_fi[n_fi];
inc(n_fi);
if n_fi > ni then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
B3 := buff_fi[n_fi];
inc(n_fi);
if n_fi > ni then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
PhaseWork := 1;
end
else
begin
if B1 = $0000CAC3 then
begin
B2 := buff_fi[n_fi];
inc(n_fi);
if n_fi > ni then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
B3 := buff_fi[n_fi];
inc(n_fi);
if (n_fi > ni) and (not eof(FI)) then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
PhaseWork := 0;
if B2 > 0 then
begin
k := (B2 * 1024) - 1;
B3 := 0;
for i := 0 to k do
begin
//Write(FO, B3);
buff_fo[n_fo] := B3;
inc(n_fo);
if n_fo > s_fo then
begin
blockwrite(FO, buff_fo, sizeof(buff_fo), n);
n_fo := 1;
t_fo := t_fo + n;
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
end;
end;
end;
end
else
begin
Writeln('Error header.');
Halt;
end;
end;
end;

1 : begin
k := ((B3 - 12) shr 2) - 1;
for i := 0 to k do
begin
B1 := buff_fi[n_fi];
inc(n_fi);
if n_fi > ni then
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
buff_fo[n_fo] := B1;
inc(n_fo);
if n_fo > s_fo then
begin
blockwrite(FO, buff_fo, sizeof(buff_fo), n);
n_fo := 1;
t_fo := t_fo + n;
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
end;
end;
PhaseWork := 0;
end;
end;
until n_fi > ni;
if eof(FI) then
begin
Closefile(FI);
if n_fo > 1 then
begin
n_fo := n_fo shl 2;
blockwrite(FO, buff_fo, n_fo, n);
t_fo := t_fo + n;
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
end;
Closefile(FO);
Writeln('>>> ' + nameFI + ' (img/' + IntToStr(t_fi) + ' bytes) has been converted to ' +
nameFO + ' (ext4/' + IntToStr(t_fo) + ' bytes)');
Halt;
end
else
begin
blockread(FI, buff_fi, sizeof(buff_fi), ni);
t_fi := t_fi + longword(ni);
write(IntToStr(t_fi) + ':' + IntToStr(t_fo) + ^M);
ni := ni shr 2;
n_fi := 1;
end;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

EXE file can be downloaded from here

PS: I also included Ext2explore (a free ext4 file browser for win) in zip file.