Function at 0x402d11
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x10]
push esi
push edi
mov edi, dword [eax]
push edi
call fcn.00403ee3
mov esi, eax
test esi, esi
mov dword [ebp - 0xc], esi
jne 0x402d37
xor al, al
jmp 0x403152
push ebx
push dword [ebp + 0xc]
lea eax, [esi + 0x28]
mov dword [ebp - 0x1c], eax
call fcn.004047d3
push edi
push esi
push dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
call fcn.004047a9
movzx edi, word [esi + 0xe]
mov ecx, dword [esi + 4]
mov eax, dword [esi + 8]
movzx ebx, di
imul ebx, ecx
cdq
add ebx, 0x1f
xor eax, edx
shr ebx, 5
sub eax, edx
cmp dword [ebp + 0x18], 3
mov dword [ebp - 0x10], ebx
jne 0x402d7c
cdq
sub eax, edx
sar eax, 1
cmp byte [ebp + 8], 0
mov dword [ebp - 4], eax
je 0x402f7a
cmp di, 2
je 0x402f80
cmp di, 1
je 0x402f80
mov edi, dword [ebp + 0x18]
lea edx, [ecx + ecx + 0x1f]
shr edx, 5
cmp edi, 3
mov dword [ebp - 0x14], edx
jne 0x402dc6
add ecx, 0x1f
shr ecx, 5
mov dword [ebp - 0x18], ecx
add ecx, edx
imul ecx, eax
lea eax, [ecx*4 + 0x38]
jmp 0x402dd0
imul edx, eax
lea eax, [edx*4 + 0x38]
push eax
mov dword [ebp + 8], eax
call fcn.00403ee3
mov dword [ebp + 0xc], eax
mov eax, dword [edi*4 + 0x4013b0]
push eax
push 2
push eax
movzx eax, word [esi + 0xe]
push eax
push 0x138a
call fcn.004029c3
push eax
call fcn.00404a15
movzx ecx, word [esi + 0xe]
add esp, 0x14
cmp cx, 0x18
jne 0x402e0f
and dword [ebp - 0x10], 0
jmp 0x402e17
xor eax, eax
inc eax
shl eax, cl
mov dword [ebp - 0x10], eax
mov edi, dword [ebp + 0xc]
xor eax, eax
cmp dword [ebp - 0x10], eax
mov dword [edi + 0x28], eax
mov dword [edi + 0x2c], 0x808080
mov dword [edi + 0x30], 0xc0c0c0
mov dword [edi + 0x34], 0xffffff
mov dword [ebp - 8], eax
jbe 0x402e5c
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 8]
lea edi, [eax + ecx*4]
push dword [edi]
call fcn.004024b3
inc dword [ebp - 8]
mov dword [edi], eax
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x10]
jb 0x402e3c
mov edi, dword [ebp + 0xc]
cmp dword [ebp + 0x18], 3
push 0xa
pop ecx
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp + 0xc]
mov word [edi + 0xe], 2
jne 0x402e9d
mov ecx, dword [edi + 4]
lea eax, [ecx + ecx + 0x1f]
and eax, 0xffffffe0
cdq
and edx, 7
add eax, edx
mov esi, eax
lea eax, [ecx + 0x1f]
and eax, 0xffffffe0
cdq
and edx, 7
add eax, edx
sar esi, 3
sar eax, 3
add esi, eax
imul esi, dword [ebp - 4]
mov dword [edi + 0x14], esi
push dword [ebp + 0x10]
push 1
push 0x28
push edi
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
cmp eax, 1
je 0x402ec4
push 0x4014c4
call fcn.00404a04
xor al, al
jmp 0x403150
push dword [ebp + 0x10]
lea esi, [edi + 0x28]
push 4
push 4
push esi
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
cmp eax, 4
je 0x402ee4
push 0x401490
jmp 0x402eb8
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
lea ecx, [eax + ecx*4]
mov dword [ebp + 0xc], ecx
lea ecx, [ebp - 8]
push ecx
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
movzx ecx, word [ecx + 0xe]
push ebx
push dword [ebp - 4]
add esi, 0x10
push ecx
push eax
mov dword [ebp - 8], esi
call fcn.004026c6
cmp dword [ebp + 0x18], 3
jne 0x402f34
mov eax, dword [ebp - 0x18]
imul eax, dword [ebp - 4]
shl eax, 2
je 0x402f34
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
mov bl, byte [edx]
mov byte [ecx], bl
inc ecx
inc edx
dec eax
jne 0x402f2b
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 8]
sub dword [ebp + 8], 0x38
mov eax, dword [eax + 0x10]
mov dword [eax], ecx
je 0x402f67
mov ebx, 0x400
cmp dword [ebp + 8], ebx
ja 0x402f52
mov ebx, dword [ebp + 8]
sub dword [ebp + 8], ebx
push ebx
push esi
push dword [ebp + 0x10]
call fcn.004047f3
add esi, ebx
cmp dword [ebp + 8], 0
jne 0x402f45
push dword [ebp - 0xc]
mov esi, dword [sym.imp.MSVCR80.dll_free]
call esi
push edi
call esi
jmp 0x40314d
cmp di, 2
je 0x402f9c
push esi
call dword [sym.imp.MSVCR80.dll_free]
pop ecx
push 0
push dword [ebp - 0x18]
push dword [ebp + 0xc]
call fcn.00404894
xor al, al
jmp 0x403151
lea edx, [ecx*4 + 0x1f]
shr edx, 5
cmp dword [ebp + 0x18], 3
mov dword [ebp - 0x14], edx
jne 0x402fc6
add ecx, 0x1f
shr ecx, 5
mov dword [ebp - 0x18], ecx
add ecx, edx
imul ecx, eax
lea eax, [ecx*4 + 0x68]
jmp 0x402fd0
imul edx, eax
lea eax, [edx*4 + 0x68]
mov dword [ebp + 8], eax
add eax, 4
push eax
call fcn.00403ee3
mov edi, eax
mov eax, dword [ebp + 0x18]
mov eax, dword [eax*4 + 0x4013b0]
push eax
push 4
push eax
push 2
push 0x138a
mov dword [ebp + 0xc], edi
lea ebx, [edi + 0x28]
call fcn.004029c3
push eax
call fcn.00404a15
and dword [ebx], 0
mov eax, 0xffffff
add esp, 0x14
cmp dword [ebp + 0x18], 3
push 0xa
mov dword [ebx + 4], 0x808080
mov dword [ebx + 8], 0xc0c0c0
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], eax
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x28], eax
mov dword [ebx + 0x2c], eax
mov dword [ebx + 0x30], eax
mov dword [ebx + 0x34], eax
mov dword [ebx + 0x38], eax
mov dword [ebx + 0x3c], eax
pop ecx
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp + 0xc]
mov word [esi + 0xe], 4
jne 0x403088
mov ecx, dword [esi + 4]
lea eax, [ecx*4 + 0x1f]
and eax, 0xffffffe0
cdq
and edx, 7
add eax, edx
mov edi, eax
lea eax, [ecx + 0x1f]
and eax, 0xffffffe0
cdq
and edx, 7
add eax, edx
sar edi, 3
sar eax, 3
add edi, eax
imul edi, dword [ebp - 4]
mov dword [esi + 0x14], edi
push dword [ebp + 0x10]
mov edi, dword [sym.imp.MSVCR80.dll_fwrite]
push 1
push 0x28
push esi
call edi
add esp, 0x10
cmp eax, 1
jne 0x402eb3
push dword [ebp + 0x10]
push 0x10
push 4
push ebx
call edi
add esp, 0x10
cmp eax, 0x10
jne 0x402edd
mov eax, dword [ebp - 0xc]
add eax, 0x28
lea ecx, [eax + 0x10]
mov dword [ebp + 0xc], ecx
lea ecx, [ebp - 8]
push ecx
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
push dword [ebp - 0x10]
movzx ecx, word [ecx + 0xe]
push dword [ebp - 4]
add ebx, 0x40
push ecx
push eax
mov dword [ebp - 8], ebx
call fcn.004026c6
cmp dword [ebp + 0x18], 3
jne 0x40310c
mov eax, dword [ebp - 0x18]
imul eax, dword [ebp - 4]
shl eax, 2
je 0x40310c
mov edi, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
mov dl, byte [edi]
mov byte [ecx], dl
inc ecx
inc edi
dec eax
jne 0x403103
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 8]
sub dword [ebp + 8], 0x68
mov eax, dword [eax + 0x10]
mov dword [eax], ecx
je 0x40313f
mov edi, 0x400
cmp dword [ebp + 8], edi
ja 0x40312a
mov edi, dword [ebp + 8]
sub dword [ebp + 8], edi
push edi
push ebx
push dword [ebp + 0x10]
call fcn.004047f3
add ebx, edi
cmp dword [ebp + 8], 0
jne 0x40311d
push dword [ebp - 0xc]
mov edi, dword [sym.imp.MSVCR80.dll_free]
call edi
push esi
call edi
mov al, 1
pop ecx
pop ecx
pop ebx
pop edi
pop esi
leave
ret 0x14