Function at 0x102c2860
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x20]
test ebx, ebx
jne 0x102c2886
push str.We_need_an_image_previously_created._n
push 1
push dword [esp + 0x2c]
call fcn.102c4df0
add esp, 0xc
xor eax, eax
pop ebx
add esp, 0x10
ret
push ebp
mov ebp, dword [esp + 0x2c]
push esi
mov esi, dword [esp + 0x20]
mov eax, dword [esi + 0x74]
mov ecx, dword [esi + 0x70]
imul eax, ecx
cmp ebp, eax
jb 0x102c28bc
dec eax
push eax
push ebp
push str.Tile_index_provided_by_the_user_is_incorrect__d__max___d___n
push 1
push dword [esp + 0x3c]
call fcn.102c4df0
add esp, 0x14
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
xor edx, edx
mov eax, ebp
div ecx
push edi
mov edi, dword [esi + 0x64]
mov ecx, edx
imul edi, ecx
mov edx, eax
mov dword [esp + 0x18], ecx
mov ecx, dword [esi + 0x5c]
add ecx, edi
mov dword [ebx], ecx
mov eax, dword [esi + 0x50]
mov eax, dword [eax]
cmp ecx, eax
jae 0x102c28e3
mov dword [ebx], eax
mov ecx, dword [esp + 0x18]
inc ecx
imul ecx, dword [esi + 0x64]
add ecx, dword [esi + 0x5c]
mov dword [ebx + 8], ecx
mov eax, dword [esi + 0x50]
mov eax, dword [eax + 8]
cmp ecx, eax
jbe 0x102c28ff
mov dword [ebx + 8], eax
mov ecx, dword [esi + 0x68]
imul ecx, edx
add ecx, dword [esi + 0x60]
mov dword [ebx + 4], ecx
mov eax, dword [esi + 0x50]
mov eax, dword [eax + 4]
cmp ecx, eax
jae 0x102c2918
mov dword [ebx + 4], eax
lea ecx, [edx + 1]
imul ecx, dword [esi + 0x68]
add ecx, dword [esi + 0x60]
mov dword [ebx + 0xc], ecx
mov eax, dword [esi + 0x50]
mov eax, dword [eax + 0xc]
cmp ecx, eax
jbe 0x102c2932
mov dword [ebx + 0xc], eax
cmp dword [ebx + 0x10], 0
mov edi, dword [ebx + 0x18]
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], 0
jbe 0x102c2a95
xor ecx, ecx
mov ebp, edi
mov dword [esp + 0x18], ecx
mov eax, dword [esi + 0x50]
mov edi, dword [ebp]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + ecx + 0x28]
mov dword [ebp + 0x28], eax
mov eax, dword [ebx]
dec eax
mov ecx, dword [ebp + 4]
add eax, edi
cdq
idiv edi
mov dword [ebp + 0x10], eax
mov eax, dword [ebx + 4]
dec eax
add eax, ecx
cdq
idiv ecx
mov dword [ebp + 0x14], eax
mov eax, dword [ebx + 0xc]
dec eax
mov ebp, dword [ebp + 0x28]
add eax, ecx
cdq
idiv ecx
mov ecx, ebp
mov dword [esp + 0x1c], eax
mov eax, dword [ebx + 8]
dec eax
add eax, edi
cdq
idiv edi
xor edi, edi
cdq
bts edi, ecx
mov ebx, eax
xor eax, eax
cmp ecx, 0x20
cmovae eax, edi
xor edi, eax
cmp ecx, 0x40
cmovae eax, edi
add ebx, edi
adc edx, eax
sub ebx, 1
mov eax, ebx
sbb edx, 0
call fcn.1033e2d0
mov ebp, eax
xor edi, edi
mov eax, dword [esp + 0x10]
xor ebx, ebx
mov ecx, dword [eax + 0x28]
bts edi, ecx
mov eax, dword [eax + 0x10]
cmp ecx, 0x20
cdq
cmovae ebx, edi
xor edi, ebx
cmp ecx, 0x40
cmovae ebx, edi
add eax, edi
mov edi, dword [esp + 0x10]
adc edx, ebx
sub eax, 1
sbb edx, 0
mov ebx, dword [edi + 0x28]
mov ecx, ebx
call fcn.1033e2d0
sub ebp, eax
mov edx, edi
mov eax, ebx
xor ecx, ecx
bts ecx, eax
xor edi, edi
cmp eax, 0x20
mov dword [edx + 8], ebp
cmovae edi, ecx
xor ecx, edi
cmp eax, 0x40
mov eax, dword [edx + 0x14]
cmovae edi, ecx
cdq
add eax, ecx
mov ecx, ebx
adc edx, edi
sub eax, 1
sbb edx, 0
call fcn.1033e2d0
mov ecx, ebx
xor edi, edi
bts edi, ecx
xor ebx, ebx
cmp ecx, 0x20
mov ebp, eax
mov eax, dword [esp + 0x1c]
cmovae ebx, edi
cdq
xor edi, ebx
cmp ecx, 0x40
cmovae ebx, edi
add eax, edi
mov edi, dword [esp + 0x10]
adc edx, ebx
sub eax, 1
sbb edx, 0
mov ecx, dword [edi + 0x28]
call fcn.1033e2d0
mov ebx, dword [esp + 0x2c]
sub eax, ebp
mov ecx, dword [esp + 0x18]
mov ebp, edi
add ecx, 0x34
mov dword [esp + 0x18], ecx
mov dword [ebp + 0xc], eax
add ebp, 0x34
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], eax
cmp eax, dword [ebx + 0x10]
jb 0x102c2953
mov ebp, dword [esp + 0x34]
mov ecx, dword [esi + 0x54]
test ecx, ecx
je 0x102c2aa1
call fcn.102b9d30
push 0x24
push 1
call dword [sym.imp.MSVCR120.dll_calloc]
add esp, 8
mov dword [esi + 0x54], eax
test eax, eax
je 0x102c2afe
mov edx, eax
mov ecx, ebx
call fcn.102b9f00
mov edi, dword [esp + 0x30]
mov edx, 0x102c24d0
mov ecx, dword [esi + 0xc0]
push edi
mov dword [esi + 0x3c], ebp
call fcn.102db190
mov edx, dword [esi + 0xc0]
mov ecx, esi
push edi
push dword [esp + 0x30]
call fcn.102bf3e0
add esp, 0xc
test eax, eax
jne 0x102c2b08
mov ecx, dword [esi + 0x50]
call fcn.102b9d30
mov dword [esi + 0x50], 0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
xor ebp, ebp
cmp dword [ebx + 0x10], ebp
jbe 0x102c2b5f
xor edi, edi
mov eax, dword [esi + 0x54]
mov ecx, dword [ebx + 0x18]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + edi + 0x24]
mov dword [edi + ecx + 0x24], eax
mov eax, dword [ebx + 0x18]
mov eax, dword [edi + eax + 0x2c]
test eax, eax
je 0x102c2b37
push eax
call dword [sym.imp.MSVCR120.dll_free]
add esp, 4
mov eax, dword [esi + 0x54]
inc ebp
mov ecx, dword [ebx + 0x18]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + edi + 0x2c]
mov dword [edi + ecx + 0x2c], eax
mov eax, dword [esi + 0x54]
mov eax, dword [eax + 0x18]
mov dword [eax + edi + 0x2c], 0
add edi, 0x34
cmp ebp, dword [ebx + 0x10]
jb 0x102c2b11
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10
ret