Function at 0x401680
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebp, dword [esp + 0x40]
mov ebx, dword [esp + 0x54]
mov esi, dword [esp + 0x44]
mov edi, dword [esp + 0x58]
mov ecx, dword [ebp + 8]
lea eax, [ecx + 0x20]
add ecx, 0x19
cmovs ecx, eax
sar ecx, 3
mov dword [ebx], ecx
mov dword [esp], ecx
call sym._malloc
mov dword [0x4063e4], eax
test eax, eax
je 0x40192f
mov eax, dword [ebx]
sub eax, dword [esp + 0x48]
xor ebx, ebx
add eax, dword [esp + 0x4c]
mov dword [0x4063ec], eax
mov dword [edi], 0
jmp 0x4016e4
mov ebx, ebp
mov ebp, eax
mov eax, dword [ebp]
mov dword [ebp], ebx
test eax, eax
jne 0x4016e0
mov dword [0x4063e8], 0
mov eax, dword [esp + 0x4c]
mov dword [0x4063e0], 0
mov dword [0x4063f8], eax
test ebx, ebx
je 0x401844
mov dword [esp + 0x1c], 1
mov ebp, 1
jmp 0x401777
mov ecx, dword [0x4063f4]
test ecx, ecx
je 0x401908
mov dword [0x4063f4], 0
mov eax, dword [esp + 0x50]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dbg.write_interlaced_elias_gamma
mov eax, dword [ebx + 0x14]
add dword [0x4063f8], eax
add eax, dword [0x4063ec]
mov dword [0x4063ec], eax
cmp eax, dword [edi]
jle 0x40176d
mov dword [edi], eax
mov ebx, dword [ebx]
test ebx, ebx
je 0x401844
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x401878
cmp eax, dword [esp + 0x1c]
je 0x401728
mov dword [esp], 1
call sym._write_bit
mov eax, dword [esp + 0x50]
mov dword [esp + 4], eax
mov edx, dword [ebx + 0x10]
lea eax, [edx + 0x7e]
sub edx, 1
cmovns eax, edx
sar eax, 7
add eax, 1
mov dword [esp], eax
call dbg.write_interlaced_elias_gamma
mov eax, dword [ebx + 0x10]
sub eax, 1
cdq
shr edx, 0x19
add eax, edx
and eax, 0x7f
sub eax, edx
mov edx, dword [esp + 0x50]
test edx, edx
jne 0x4017d8
mov ecx, 0xff
sub ecx, eax
mov eax, ecx
mov edx, dword [0x4063e8]
add eax, eax
lea ecx, [edx + 1]
mov dword [0x4063e8], ecx
mov ecx, dword [0x4063e4]
mov byte [ecx + edx], al
mov eax, dword [esp + 0x50]
sub dword [0x4063ec], 1
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x14]
mov dword [0x4063f4], 1
sub eax, 1
mov dword [esp], eax
call dbg.write_interlaced_elias_gamma
mov eax, dword [ebx + 0x14]
add dword [0x4063f8], eax
add eax, dword [0x4063ec]
mov dword [0x4063ec], eax
cmp eax, dword [edi]
jle 0x401833
mov dword [edi], eax
mov eax, dword [ebx + 0x10]
mov ebx, dword [ebx]
mov dword [esp + 0x1c], eax
test ebx, ebx
jne 0x401777
mov dword [esp], 1
call sym._write_bit
mov eax, dword [esp + 0x50]
mov dword [esp], 0x100
mov dword [esp + 4], eax
call dbg.write_interlaced_elias_gamma
mov eax, dword [0x4063e4]
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
test ebp, ebp
jne 0x401893
mov eax, dword [0x4063f4]
test eax, eax
je 0x401918
mov dword [0x4063f4], 0
mov eax, dword [esp + 0x50]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dbg.write_interlaced_elias_gamma
mov ebp, dword [ebx + 0x14]
test ebp, ebp
jle 0x401928
mov dword [esp + 0x18], ebx
xor eax, eax
lea esi, [esi]
nop
mov edx, dword [0x4063f8]
movzx ebp, byte [esi + edx]
mov edx, dword [0x4063e8]
lea ecx, [edx + 1]
mov ebx, ebp
mov dword [0x4063e8], ecx
mov ecx, dword [0x4063e4]
mov byte [ecx + edx], bl
mov edx, dword [0x4063ec]
add dword [0x4063f8], 1
cmp dword [edi], edx
jge 0x4018ef
mov dword [edi], edx
mov ecx, dword [esp + 0x18]
add eax, 1
cmp dword [ecx + 0x14], eax
jg 0x4018b8
mov ebx, ecx
xor ebp, ebp
jmp 0x40176d
xor eax, eax
call sym._write_bit.part.0
jmp 0x401740
xor eax, eax
call sym._write_bit.part.0
jmp 0x401893
xor ebp, ebp
jmp 0x40176d
mov dword [esp], 2
call dword [0x40401c]
mov dword [esp + 8], 0x1b
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], section..rdata
call sym._fwrite
mov dword [esp], 1
call sym._exit
nop
nop
nop
nop
nop
nop
nop
nop