Function at 0x46bf90
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x84c
mov edi, dword [ebp + 0x10]
cmp dword [ebp + 0x18], 3
jg 0x46c4bc
xor edx, edx
nop
lea esi, [esi]
xor eax, eax
mov dword [ebp + edx*4 - 0x428], eax
inc edx
cmp edx, 0x100
jle 0x46bfb0
xor edx, edx
cmp edx, dword [ebp + 0x14]
jge 0x46bfdd
mov ecx, dword [ebp + 0xc]
movzx eax, byte [edx + ecx]
inc edx
inc dword [ebp + eax*4 - 0x428]
cmp edx, dword [ebp + 0x14]
jl 0x46bfc9
xor edx, edx
nop
mov eax, dword [ebp + edx*4 - 0x428]
mov dword [ebp + edx*4 - 0x828], eax
inc edx
cmp edx, 0xff
jle 0x46bfe0
mov edx, 1
lea esi, [esi]
mov eax, dword [ebp + edx*4 - 0x42c]
add dword [ebp + edx*4 - 0x428], eax
inc edx
cmp edx, 0x100
jle 0x46c000
xor edx, edx
cmp edx, dword [ebp + 0x14]
jge 0x46c040
mov ebx, dword [ebp + 0xc]
movzx esi, byte [edx + ebx]
mov ebx, dword [ebp + esi*4 - 0x428]
dec ebx
mov dword [ebp + esi*4 - 0x428], ebx
mov esi, dword [ebp + 8]
mov dword [esi + ebx*4], edx
inc edx
cmp edx, dword [ebp + 0x14]
jl 0x46c01e
mov eax, dword [ebp + 0x14]
test eax, eax
js 0x46c4b4
sar eax, 5
xor edx, edx
add eax, 2
cmp edx, eax
jge 0x46c063
mov dword [edi + edx*4], 0
inc edx
cmp edx, eax
jl 0x46c057
xor edx, edx
mov ebx, 1
lea esi, [esi]
mov ecx, dword [ebp + edx*4 - 0x428]
mov esi, ebx
inc edx
mov eax, ecx
and ecx, 0x1f
sar eax, 5
shl esi, cl
or dword [edi + eax*4], esi
cmp edx, 0xff
jle 0x46c070
mov ebx, dword [ebp + 0x14]
mov edx, 0x1f
mov esi, esi
lea edi, [edi]
mov ecx, ebx
mov eax, ebx
and ecx, 0x1f
mov esi, 1
sar eax, 5
shl esi, cl
or dword [edi + eax*4], esi
lea ecx, [ebx + 1]
mov eax, ecx
mov esi, 1
and ecx, 0x1f
shl esi, cl
mov ecx, esi
sar eax, 5
not ecx
and dword [edi + eax*4], ecx
add ebx, 2
dec edx
jns 0x46c0a0
mov eax, 1
mov dword [ebp - 0x82c], eax
cmp dword [ebp + 0x18], 3
jg 0x46c48d
xor esi, esi
xor edx, edx
cmp esi, dword [ebp + 0x14]
jge 0x46c138
jmp 0x46c100
mov ecx, edx
mov eax, edx
and ecx, 0x1f
mov ebx, 1
sar eax, 5
shl ebx, cl
test dword [edi + eax*4], ebx
je 0x46c118
mov esi, edx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + edx*4]
mov ebx, eax
sub ebx, dword [ebp - 0x82c]
js 0x46c483
mov eax, dword [ebp + 0xc]
inc edx
mov dword [eax + ebx*4], esi
cmp edx, dword [ebp + 0x14]
jl 0x46c100
xor ebx, ebx
mov esi, 0xffffffff
mov dword [ebp - 0x834], ebx
lea esi, [esi]
lea edi, [edi]
lea ebx, [esi + 1]
mov eax, 1
mov ecx, ebx
and ecx, 0x1f
mov edx, ebx
sar edx, 5
shl eax, cl
test dword [edi + edx*4], eax
je 0x46c1a0
test ecx, ecx
je 0x46c1a0
mov esi, 1
lea esi, [esi]
lea edi, [edi]
inc ebx
mov eax, esi
mov ecx, ebx
and ecx, 0x1f
mov edx, ebx
sar edx, 5
shl eax, cl
test dword [edi + edx*4], eax
je 0x46c1a0
test ecx, ecx
jne 0x46c180
nop
lea esi, [esi]
mov eax, ebx
mov ecx, ebx
sar eax, 5
mov eax, dword [edi + eax*4]
and ecx, 0x1f
mov edx, 1
shl edx, cl
test edx, eax
je 0x46c200
inc eax
je 0x46c470
mov ecx, ebx
mov eax, ebx
and ecx, 0x1f
mov esi, 1
sar eax, 5
shl esi, cl
test dword [edi + eax*4], esi
je 0x46c200
mov edx, 1
lea esi, [esi]
inc ebx
mov esi, edx
mov ecx, ebx
and ecx, 0x1f
mov eax, ebx
sar eax, 5
shl esi, cl
test dword [edi + eax*4], esi
jne 0x46c1e0
lea esi, [esi]
lea edi, [edi]
mov edx, dword [ebp + 0x14]
lea eax, [ebx - 1]
mov dword [ebp - 0x830], eax
cmp eax, edx
jge 0x46c386
mov ecx, ebx
mov edx, ebx
and ecx, 0x1f
mov eax, 1
sar edx, 5
shl eax, cl
test dword [edi + edx*4], eax
jne 0x46c260
test ecx, ecx
je 0x46c260
mov esi, 1
lea esi, [esi]
lea edi, [edi]
inc ebx
mov eax, esi
mov ecx, ebx
and ecx, 0x1f
mov edx, ebx
sar edx, 5
shl eax, cl
test dword [edi + edx*4], eax
jne 0x46c260
test ecx, ecx
jne 0x46c240
nop
lea esi, [esi]
mov eax, ebx
mov ecx, ebx
sar eax, 5
mov eax, dword [edi + eax*4]
and ecx, 0x1f
mov esi, 1
shl esi, cl
test esi, eax
jne 0x46c2d0
test eax, eax
jne 0x46c28f
lea esi, [esi]
add ebx, 0x20
mov eax, ebx
sar eax, 5
mov ecx, dword [edi + eax*4]
test ecx, ecx
je 0x46c280
mov ecx, ebx
mov eax, ebx
and ecx, 0x1f
mov edx, 1
sar eax, 5
shl edx, cl
test dword [edi + eax*4], edx
jne 0x46c2d0
mov edx, 1
lea esi, [esi]
inc ebx
mov esi, edx
mov ecx, ebx
and ecx, 0x1f
mov eax, ebx
sar eax, 5
shl esi, cl
test dword [edi + eax*4], esi
je 0x46c2b0
lea esi, [esi]
lea edi, [edi]
lea esi, [ebx - 1]
cmp esi, dword [ebp + 0x14]
jge 0x46c386
cmp esi, dword [ebp - 0x830]
jle 0x46c150
mov dword [esp + 0xc], esi
mov edx, dword [ebp - 0x830]
mov eax, esi
mov ecx, dword [ebp - 0x830]
mov ebx, dword [ebp + 0xc]
sub eax, edx
mov dword [esp + 8], ecx
mov edx, dword [ebp - 0x834]
mov dword [esp + 4], ebx
lea edx, [eax + edx + 1]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x834], edx
mov dword [esp], eax
call fcn.0046bb40
mov edx, dword [ebp - 0x830]
mov eax, 0xffffffff
mov dword [ebp - 0x83c], eax
cmp edx, esi
jg 0x46c150
nop
lea esi, [esi]
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + edx*4]
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ecx + eax*4]
cmp dword [ebp - 0x83c], ebx
je 0x46c37c
mov dword [ebp - 0x83c], ebx
mov eax, edx
mov ecx, edx
sar eax, 5
and ecx, 0x1f
mov dword [ebp - 0x840], eax
mov eax, 1
shl eax, cl
mov ecx, eax
mov eax, dword [ebp - 0x840]
or dword [edi + eax*4], ecx
inc edx
cmp edx, esi
jle 0x46c340
jmp 0x46c150
cmp dword [ebp + 0x18], 3
jg 0x46c446
mov eax, dword [ebp - 0x82c]
mov ecx, dword [ebp + 0x14]
add eax, eax
mov dword [ebp - 0x82c], eax
cmp eax, ecx
jg 0x46c3b3
mov eax, dword [ebp - 0x834]
test eax, eax
jne 0x46c0de
cmp dword [ebp + 0x18], 3
jg 0x46c419
xor esi, esi
xor edx, edx
cmp esi, dword [ebp + 0x14]
jge 0x46c400
mov eax, dword [ebp + esi*4 - 0x828]
test eax, eax
jne 0x46c3dc
lea esi, [esi]
inc esi
mov eax, dword [ebp + esi*4 - 0x828]
test eax, eax
je 0x46c3d0
mov ebx, dword [ebp + 8]
dec eax
mov ecx, esi
mov dword [ebp + esi*4 - 0x828], eax
mov eax, dword [ebx + edx*4]
mov ebx, dword [ebp + 0xc]
inc edx
mov byte [eax + ebx], cl
cmp edx, dword [ebp + 0x14]
jl 0x46c3c2
cmp esi, 0xff
jg 0x46c40b
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0x3ed
call fcn.00462970
jmp 0x46c400
mov dword [esp + 8], 0x21
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], 1
mov dword [esp], 0x46bf20
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x46c3b9
mov dword [esp + 4], 0x46bf42
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp - 0x834]
add eax, 0x40
mov dword [esp + 8], edx
mov dword [esp], eax
call fcn.00413ea0
jmp 0x46c390
add ebx, 0x20
mov eax, ebx
sar eax, 5
cmp dword [edi + eax*4], 0xffffffff
je 0x46c470
jmp 0x46c1bf
mov eax, dword [ebp + 0x14]
add ebx, eax
jmp 0x46c12c
mov dword [esp + 4], 0x46bf5a
mov eax, dword [ebp - 0x82c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00413ea0
jmp 0x46c0e8
add eax, 0x1f
jmp 0x46c04b
mov dword [esp + 8], 0x1b
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], 1
mov dword [esp], 0x46bf71
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x46bfa9