Function at 0x40a2b0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41b1cb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x5d4
push ebx
push esi
mov esi, dword [ebp + 0x34]
xor eax, eax
push edi
xor edi, edi
mov ax, word [esi + 0xe]
mov ecx, dword [esi + 8]
imul eax, dword [esi + 4]
add eax, 0x1f
push edi
cdq
and edx, 0x1f
add eax, edx
mov ebx, eax
sar ebx, 5
shl ebx, 2
cmp ecx, edi
lea ecx, [esp + 0x3c]
setl al
mov byte [esp + 0x14], al
call sub.cimage.dll_public:_void___thiscall_CxImage::constructor_unsigned_long_int_
mov ecx, dword [esp + 0x10]
mov eax, dword [esi + 8]
xor edx, edx
push ecx
mov dx, word [esi + 0xe]
push ebx
push edx
mov ecx, dword [ebp + 0x30]
cdq
xor eax, edx
mov dword [esp + 0x5f4], edi
sub eax, edx
push eax
mov eax, dword [esi + 4]
push eax
push ecx
lea ecx, [esp + 0x50]
call sub.cimage.dll_public:_bool___thiscall_CxImage::CreateFromArray_unsigned_char___unsigned_long_int__unsigned_long_int__unsigned_long_int__unsigned_long_int__bool_
cmp dword [esp + 0x3c], edi
je 0x40a563
lea edx, [esp + 0x18]
push 4
lea eax, [esp + 0x18]
push edx
push eax
lea ecx, [esp + 0x44]
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
call sub.cimage.dll_public:_bool___thiscall_CxImage::Encode_unsigned_char____long_int___unsigned_long_int_
test al, al
je 0x40a563
cmp dword [esp + 0x14], edi
je 0x40a563
mov eax, dword [esp + 0x18]
cmp eax, edi
jle 0x40a563
push eax
call fcn.004041a0
lea esi, [eax + 0x400]
push esi
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 8
cmp ebx, edi
je 0x40a563
mov ecx, esi
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
push eax
push ecx
push ebx
call fcn.004041c0
mov dword [esp + 0x28], eax
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x1ed]
mov byte [esp + 0x1ec], 0
add esp, 0xc
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, 0x11b4148
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1e0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x10], 0
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 0xc]
push esi
call dword [sym.imp.GDI32.dll_GetGraphicsMode]
cmp eax, 2
jne 0x40a49a
lea ecx, [esp + 0x20]
push ecx
push esi
call dword [sym.imp.GDI32.dll_GetWorldTransform]
fld dword [esp + 0x34]
sub esp, 8
lea edi, [esp + 0x1e8]
or ecx, 0xffffffff
xor eax, eax
fstp qword [esp]
fld dword [esp + 0x38]
sub esp, 8
fstp qword [esp]
fld dword [esp + 0x3c]
sub esp, 8
fstp qword [esp]
fld dword [esp + 0x40]
sub esp, 8
fstp qword [esp]
fld dword [esp + 0x44]
sub esp, 8
fstp qword [esp]
sub esp, 8
repne scasb al, byte es:[edi]
fld dword [esp + 0x50]
fstp qword [esp]
not ecx
dec ecx
push 0x11b412c
lea edx, [esp + ecx + 0x214]
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x38
mov dword [esp + 0x10], 1
mov edi, 0x11b4128
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1e0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x10]
mov ecx, edx
and ecx, 3
test eax, eax
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x1e0]
jne 0x40a4df
mov eax, 0x19d1318
mov ecx, dword [ebp + 0x18]
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x1c]
push eax
mov eax, dword [ebp + 0x10]
push ecx
mov ecx, dword [esi + 0x78]
push edx
push eax
push 0x11b4204
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov edx, dword [esi + 0x78]
mov eax, dword [esp + 0x38]
push edx
push eax
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [esi + 0x78]
push ecx
push 0x11b41f4
call dword [sym.imp.MSVCRT.dll_fputs]
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x38
lea ecx, [esp + 0x38]
mov dword [esp + 0x5e8], 0xffffffff
mov dword [esp + 0x38], 0x41c380
call sub.cimage.dll_public:_bool___thiscall_CxImage::Destroy_void_
mov eax, 1
mov ecx, dword [esp + 0x5e0]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x38]
mov dword [esp + 0x5e8], 0xffffffff
mov dword [esp + 0x38], 0x41c380
call sub.cimage.dll_public:_bool___thiscall_CxImage::Destroy_void_
mov ecx, dword [esp + 0x5e0]
pop edi
pop esi
xor eax, eax
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret