Function at 0x516400
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xa4
mov dword [ebp - 0x1c], 0
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x20]
mov dword [esp + 4], eax
mov esi, dword [ebp + 0xc]
mov dword [esp], esi
mov dword [esp + 0xc], 0
call sub.cvirte.dll_GetBitmapInfo
sub esp, 0x10
mov edi, eax
test edi, edi
js 0x51678a
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.cvirte.dll_malloc
mov dword [ebp - 0x84], eax
mov dword [ebp - 0x80], 0
mov eax, dword [ebp - 0x20]
test eax, eax
mov ecx, 0
je 0x51646f
mov dword [esp], eax
call sub.cvirte.dll_malloc
mov ecx, eax
mov dword [ebp - 0x88], ecx
mov eax, dword [ebp - 0x84]
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ecx
lea eax, [ebp - 0x10]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x14]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x18]
mov dword [esp + 4], eax
mov dword [esp], esi
mov dword [esp + 0x1c], 0
call sub.cvirte.dll_GetBitmapData
sub esp, 0x20
test eax, eax
js 0x5167a9
mov dword [ebp - 0x90], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x6c], eax
fild dword [ebp - 0x6c]
fstp qword [esp + 8]
mov dword [esp + 4], 0x40000000
mov dword [esp], 0
call sub.cvirte.dll_pow_FLTREG_
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x60], 0x28
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x5c], eax
mov edi, dword [ebp - 0x10]
mov dword [ebp - 0x58], edi
mov word [ebp - 0x54], 1
mov esi, dword [ebp - 0x1c]
mov word [ebp - 0x52], si
call fcn.004fb896
mov dword [ebp - 0x74], eax
cmp esi, 0x18
jl 0x516513
xor eax, eax
lea ecx, [ebx + 3]
sar ecx, 0x1f
shr ecx, 0x1e
lea esi, [ebx + ecx + 3]
and esi, 0xfffffffc
imul edi, esi
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], edi
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], 0
mov word [ebp - 0x38], 0x4d42
mov eax, dword [ebp - 0x20]
lea ecx, [eax + edi + 0x36]
mov dword [ebp - 0x36], ecx
mov word [ebp - 0x32], 0
mov word [ebp - 0x30], 0
add eax, 0x36
mov dword [ebp - 0x2e], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov dword [esp + 4], 0x53742b
call sub.cvirte.dll_fopen
mov ebx, eax
mov dword [esp + 0xc], ebx
lea eax, [ebp - 0x38]
mov dword [esp], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0xe
call sub.cvirte.dll_fwrite
mov edi, 0xffffffa3
cmp eax, 1
jne 0x5167af
mov dword [esp + 0xc], ebx
mov dword [ebp - 0x8c], ebx
lea eax, [ebp - 0x60]
mov dword [esp], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x28
call sub.cvirte.dll_fwrite
cmp eax, 1
mov dword [ebp - 0x80], 0
jne 0x5167ba
cmp dword [ebp - 0x1c], 0x17
jg 0x516616
mov eax, dword [ebp - 0x8c]
mov dword [esp + 0xc], eax
mov ebx, dword [ebp - 0x74]
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x88]
mov dword [esp], eax
mov dword [esp + 4], 4
call sub.cvirte.dll_fwrite
cmp eax, ebx
jne 0x5167c5
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x70], esi
add eax, esi
mov dword [esp], eax
mov dword [esp + 4], 1
call sub.cvirte.dll_calloc
mov dword [ebp - 0x80], eax
mov edx, dword [ebp - 0x10]
test edx, edx
jle 0x516670
xor esi, esi
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x80]
mov ebx, dword [ebp - 0x84]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], edi
add edi, dword [ebp - 0x70]
call sub.cvirte.dll_memcpy
mov eax, dword [ebp - 0x18]
add ebx, eax
inc esi
mov edx, dword [ebp - 0x10]
cmp esi, edx
jl 0x516650
mov edi, dword [ebp - 0x70]
cmp dword [ebp - 0x1c], 0x18
jne 0x5166bd
test edx, edx
mov ebx, dword [ebp - 0x80]
jle 0x5166bd
xor eax, eax
mov ecx, dword [ebp - 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
test ecx, ecx
jle 0x5166b8
mov edx, eax
imul edx, edi
add edx, ebx
xor esi, esi
nop
nop
nop
mov cl, byte [edx]
mov ch, byte [edx + 2]
mov byte [edx], ch
mov byte [edx + 2], cl
add edx, 3
inc esi
mov ecx, dword [ebp - 0x14]
cmp esi, ecx
jl 0x5166a0
mov edx, dword [ebp - 0x10]
inc eax
cmp eax, edx
jl 0x516690
mov dword [esp], edi
mov ebx, edx
call sub.cvirte.dll_malloc
mov dword [ebp - 0x74], eax
cmp dword [ebp - 0x10], 2
jl 0x516745
dec ebx
mov dword [ebp - 0x70], edi
imul ebx, edi
mov ecx, dword [ebp - 0x80]
add ebx, ecx
neg edi
mov dword [ebp - 0x7c], edi
xor esi, esi
mov edi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [ebp - 0x78], esi
mov esi, dword [ebp - 0x70]
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.cvirte.dll_memcpy
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], edi
call sub.cvirte.dll_memcpy
mov dword [esp + 8], esi
mov eax, dword [ebp - 0x74]
mov dword [esp + 4], eax
mov dword [esp], ebx
add ebx, dword [ebp - 0x7c]
add edi, esi
mov esi, dword [ebp - 0x78]
call sub.cvirte.dll_memcpy
mov ecx, dword [ebp - 0x10]
mov edx, ecx
shr edx, 0x1f
add edx, ecx
mov eax, dword [ebp - 0x74]
sar edx, 1
inc esi
cmp esi, edx
jl 0x5166f0
mov ebx, eax
mov eax, dword [ebp - 0x4c]
mov esi, dword [ebp - 0x8c]
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
mov dword [esp + 4], 1
call sub.cvirte.dll_fwrite
cmp eax, dword [ebp - 0x4c]
jne 0x5167be
mov dword [esp], esi
call sub.cvirte.dll_fclose
mov edi, 0xffffffa3
cmp eax, 0xffffffff
je 0x5167c7
mov edi, dword [ebp - 0x90]
jmp 0x5167c7
mov dword [ebp - 0x80], 0
xor ebx, ebx
mov dword [ebp - 0x84], 0
mov dword [ebp - 0x88], 0
jmp 0x5167c7
mov edi, eax
xor ebx, ebx
jmp 0x5167c7
xor ebx, ebx
mov dword [ebp - 0x80], 0
jmp 0x5167c7
xor ebx, ebx
jmp 0x5167c7
mov edi, 0xffffffa3
jmp 0x5167c7
xor ebx, ebx
mov dword [esp], ebx
call sub.cvirte.dll_free
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
call sub.cvirte.dll_free
cmp dword [ebp - 0x1c], 0x17
jg 0x5167ee
mov eax, dword [ebp - 0x88]
mov dword [esp], eax
call sub.cvirte.dll_free
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sub.cvirte.dll_free
mov eax, edi
add esp, 0xa4
pop esi
pop edi
pop ebx
pop ebp
ret 8