Function at 0x10012a30
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x140
lea eax, [esp + 0x40]
push ebx
push ebp
mov ebp, dword [esp + 0x14c]
push esi
push edi
push ebp
push 0x16
push eax
xor ebx, ebx
call sym.alleg40.dll_pack_fread
add esp, 0xc
mov ecx, 3
mov edi, str.GF1PATCH110
lea esi, [esp + 0x50]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x10013146
mov ecx, 5
mov edi, str.ID000002
lea esi, [esp + 0x5c]
xor eax, eax
repe cmpsw word [esi], word es:[edi]
jne 0x10013146
push 0x208
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
add esp, 4
cmp edi, ebx
mov dword [esp + 0x18], edi
jne 0x10012ad9
mov ecx, dword [sym.alleg40.dll_allegro_errno]
mov dword [ecx], 0xc
test edi, edi
je 0x10012acc
mov eax, dword [edi]
xor esi, esi
test eax, eax
jle 0x10012acc
lea ebx, [edi + 4]
mov eax, dword [ebx]
push eax
call sym.alleg40.dll_lock_sample
mov eax, dword [edi]
add esp, 4
inc esi
add ebx, 4
cmp esi, eax
jl 0x10012ab7
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x140
ret
push ebp
lea edx, [esp + 0x54]
push 0x41
push edx
call sym.alleg40.dll_pack_fread
push ebp
call sym.alleg40.dll_pack_igetw
mov dword [edi + 0x204], eax
push ebp
lea eax, [esp + 0x64]
push 0x6d
push eax
call sym.alleg40.dll_pack_fread
mov ecx, dword [ebp + 0xc]
add esp, 0x1c
dec ecx
mov eax, ecx
mov dword [ebp + 0xc], ecx
cmp eax, ebx
jle 0x10012b1c
mov ecx, dword [ebp + 8]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp + 8], ecx
jmp 0x10012b25
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
push ebp
lea ecx, [esp + 0x54]
push 0x28
push ecx
mov dword [edi], eax
call sym.alleg40.dll_pack_fread
mov eax, dword [edi]
add esp, 0xc
cmp eax, 0x40
jle 0x10012b44
mov dword [edi], 0x40
mov eax, dword [edi]
mov dword [esp + 0x14], ebx
cmp eax, ebx
jle 0x10012aa8
lea esi, [edi + 0x104]
mov ebx, dword [sym.imp.MSVCRT.dll_malloc]
push 0x24
call ebx
add esp, 4
mov dword [esi - 0x100], eax
test eax, eax
je 0x100130a8
push 0x28
call ebx
add esp, 4
mov dword [esi], eax
test eax, eax
je 0x100130d0
push ebp
lea edx, [esp + 0x54]
push 8
push edx
call sym.alleg40.dll_pack_fread
push ebp
call sym.alleg40.dll_pack_igetl
mov ecx, dword [esi - 0x100]
push ebp
mov dword [ecx + 0x10], eax
call sym.alleg40.dll_pack_igetl
mov edx, dword [esi - 0x100]
push ebp
mov dword [edx + 0x14], eax
call sym.alleg40.dll_pack_igetl
mov ecx, dword [esi - 0x100]
push ebp
mov dword [ecx + 0x18], eax
call sym.alleg40.dll_pack_igetw
mov edx, dword [esi - 0x100]
push ebp
mov dword [edx + 8], eax
call sym.alleg40.dll_pack_igetl
mov ecx, dword [esi]
push ebp
mov dword [ecx], eax
call sym.alleg40.dll_pack_igetl
mov edx, dword [esi]
push ebp
mov dword [edx + 4], eax
call sym.alleg40.dll_pack_igetl
mov ecx, dword [esi]
push ebp
mov dword [ecx + 8], eax
call sym.alleg40.dll_pack_igetw
mov ecx, dword [ebp + 0xc]
add esp, 0x2c
dec ecx
mov eax, ecx
mov dword [ebp + 0xc], ecx
test eax, eax
jle 0x10012c10
mov ecx, dword [ebp + 8]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp + 8], ecx
jmp 0x10012c19
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
mov ecx, eax
lea edi, [esp + 0x38]
shl ecx, 8
sub ecx, eax
mov eax, 0x88888889
imul ecx
add edx, ecx
mov ecx, dword [esi]
sar edx, 3
mov eax, edx
mov ebx, 6
shr eax, 0x1f
add edx, eax
mov dword [ecx + 0x24], edx
mov ecx, dword [ebp + 0xc]
dec ecx
mov eax, ecx
mov dword [ebp + 0xc], ecx
test eax, eax
jle 0x10012c5b
mov ecx, dword [ebp + 8]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp + 8], ecx
jmp 0x10012c64
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
mov dword [edi], eax
add edi, 4
dec ebx
jne 0x10012c41
lea edi, [esp + 0x20]
mov ebx, 6
mov ecx, dword [ebp + 0xc]
dec ecx
mov eax, ecx
mov dword [ebp + 0xc], ecx
test eax, eax
jle 0x10012c8f
mov ecx, dword [ebp + 8]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [ebp + 8], ecx
jmp 0x10012c98
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
mov dword [edi], eax
add edi, 4
dec ebx
jne 0x10012c75
push ebp
lea edx, [esp + 0x54]
push 6
push edx
call sym.alleg40.dll_pack_fread
mov ecx, dword [ebp + 0xc]
add esp, 0xc
dec ecx
xor edi, edi
mov eax, ecx
mov dword [ebp + 0xc], ecx
cmp eax, edi
jle 0x10012cd0
mov ecx, dword [ebp + 8]
xor eax, eax
mov al, byte [ecx]
inc ecx
mov dword [esp + 0x10], eax
mov dword [ebp + 8], ecx
jmp 0x10012cdd
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
mov dword [esp + 0x10], eax
mov cl, al
mov edx, dword [esi - 0x100]
and cl, 1
neg cl
sbb ecx, ecx
and ecx, 8
add ecx, 8
mov dword [edx], ecx
mov ecx, dword [esi - 0x100]
test al, 4
mov dword [ecx + 4], edi
mov edx, dword [esi]
mov dword [edx + 0xc], edi
je 0x10012d0c
mov ecx, dword [esi]
or dword [ecx + 0xc], 1
test al, 8
je 0x10012d16
mov ecx, dword [esi]
or dword [ecx + 0xc], 5
test al, 0x10
je 0x10012d20
mov eax, dword [esi]
or dword [eax + 0xc], 3
lea edi, [esp + 0x38]
mov dword [esp + 0x1c], 6
mov eax, dword [edi]
mov ecx, eax
sar ecx, 6
and eax, 0x3f
mov ebx, eax
jne 0x10012d3f
mov ebx, 1
mov eax, dword [ecx*4 + 0x10075c9c]
add edi, 4
shl eax, 0x10
cdq
idiv ebx
sar eax, 0xc
mov dword [edi - 4], eax
mov eax, dword [esp + 0x1c]
dec eax
mov dword [esp + 0x1c], eax
jne 0x10012d2c
test byte [esp + 0x10], 0x20
je 0x10012e0a
mov eax, dword [esp + 0x158]
xor ecx, ecx
cmp eax, ecx
jne 0x10012e0c
mov eax, dword [esi]
mov ebx, dword [esp + 0x28]
mov edi, dword [esp + 0x20]
mov dword [eax + 0x18], ebx
mov eax, dword [esp + 0x38]
mov edx, dword [esi]
imul eax, edi
mov dword [edx + 0x10], ecx
mov ecx, dword [esi]
cdq
and edx, 0xff
add eax, edx
mov edx, dword [ecx + 0x10]
sar eax, 8
add edx, eax
mov dword [ecx + 0x10], edx
mov ecx, dword [esp + 0x24]
mov eax, ecx
sub eax, edi
js 0x10012db9
mov edx, eax
jmp 0x10012dbd
sub edi, ecx
mov edx, edi
mov eax, dword [esp + 0x3c]
mov edi, dword [esi]
imul eax, edx
cdq
and edx, 0xff
add eax, edx
mov edx, dword [edi + 0x10]
sar eax, 8
add edx, eax
mov eax, ebx
sub eax, ecx
mov dword [edi + 0x10], edx
js 0x10012de4
mov ecx, eax
jmp 0x10012de6
sub ecx, ebx
mov eax, dword [esp + 0x40]
mov edi, dword [esi]
imul eax, ecx
mov ecx, dword [edi + 0x10]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
add ecx, eax
mov dword [edi + 0x10], ecx
mov ecx, 3
jmp 0x10012e7b
xor ecx, ecx
mov eax, dword [esi]
mov dword [eax + 0x10], ecx
mov edx, dword [esi]
mov dword [edx + 0x18], ecx
test ecx, ecx
je 0x10012e20
mov eax, dword [esp + ecx*4 + 0x1c]
jmp 0x10012e22
xor eax, eax
mov ebx, dword [esp + ecx*4 + 0x20]
mov edx, ebx
sub edx, eax
js 0x10012e42
test ecx, ecx
je 0x10012e3a
mov eax, dword [esp + ecx*4 + 0x1c]
mov edx, ebx
sub edx, eax
jmp 0x10012e50
xor eax, eax
mov edx, ebx
sub edx, eax
jmp 0x10012e50
test ecx, ecx
je 0x10012e4c
mov edx, dword [esp + ecx*4 + 0x1c]
jmp 0x10012e4e
xor edx, edx
sub edx, ebx
mov eax, dword [esp + ecx*4 + 0x38]
mov edi, dword [esi]
imul eax, edx
cdq
and edx, 0xff
add eax, edx
mov edx, dword [edi + 0x10]
sar eax, 8
add edx, eax
cmp ebx, 0x10
mov dword [edi + 0x10], edx
jl 0x10012e7a
inc ecx
cmp ecx, 6
jl 0x10012e16
jmp 0x10012e7b
inc ecx
mov eax, dword [esi]
cmp ecx, 6
mov dword [eax + 0x14], 0
jge 0x10012ecc
lea edi, [ecx*4 - 4]
mov ebx, dword [esp + edi + 0x24]
mov eax, dword [esp + edi + 0x20]
mov edx, ebx
sub edx, eax
jns 0x10012ea2
sub eax, ebx
mov edx, eax
mov eax, dword [esp + edi + 0x3c]
mov ecx, dword [esi]
imul eax, edx
cdq
and edx, 0xff
add eax, edx
mov edx, dword [ecx + 0x14]
sar eax, 8
add edx, eax
cmp ebx, 0x10
mov dword [ecx + 0x14], edx
jl 0x10012ecc
add edi, 4
cmp edi, 0x14
jl 0x10012e90
mov eax, dword [esi]
mov ecx, dword [eax + 0x18]
cmp ecx, 0x10
jge 0x10012edf
mov dword [eax + 0x18], 0
jmp 0x10012eee
cmp ecx, 0xc0
jle 0x10012eee
mov dword [eax + 0x18], 0xff
mov eax, dword [esi]
cmp dword [eax + 0x14], 0xa
jge 0x10012efd
mov dword [eax + 0x14], 0
mov eax, dword [esi]
mov ecx, dword [eax + 0x18]
test ecx, ecx
jne 0x10012f1a
mov ecx, dword [eax + 0x10]
test ecx, ecx
jne 0x10012f1a
mov dword [eax + 0x18], 0xff
mov eax, dword [esi]
and dword [eax + 0xc], 0xfffffffe
push ebp
call sym.alleg40.dll_pack_igetw
mov ecx, dword [esi]
push ebp
mov dword [ecx + 0x1c], eax
call sym.alleg40.dll_pack_igetw
mov edx, dword [esi]
push ebp
push 0x24
mov dword [edx + 0x20], eax
lea eax, [esp + 0x60]
push eax
call sym.alleg40.dll_pack_fread
mov ecx, dword [esi - 0x100]
add esp, 0x14
cmp dword [ecx], 0x10
jne 0x10012f71
mov eax, dword [ecx + 0x10]
mov ebx, eax
shr eax, 1
mov dword [ecx + 0x10], eax
mov eax, dword [esi - 0x100]
and ebx, 1
mov edx, dword [eax + 0x14]
shr edx, 1
mov dword [eax + 0x14], edx
mov eax, dword [esi - 0x100]
shr dword [eax + 0x18], 1
jmp 0x10012f73
xor ebx, ebx
mov ecx, dword [esi - 0x100]
mov dword [ecx + 0xc], 0x80
mov edx, dword [esi - 0x100]
xor ecx, ecx
mov dword [edx + 0x1c], 0
mov eax, dword [esi - 0x100]
cmp dword [eax], 8
setne cl
inc ecx
imul ecx, dword [eax + 0x10]
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
mov edx, dword [esi - 0x100]
add esp, 4
mov dword [edx + 0x20], eax
mov eax, dword [esi - 0x100]
mov ecx, dword [eax + 0x20]
test ecx, ecx
je 0x10013103
cmp dword [eax], 8
jne 0x10013010
mov eax, dword [eax + 0x10]
push ebp
push eax
push ecx
call sym.alleg40.dll_pack_fread
mov al, byte [esp + 0x1c]
add esp, 0xc
test al, 2
jne 0x10013089
mov ecx, dword [esi - 0x100]
xor eax, eax
mov edx, dword [ecx + 0x10]
test edx, edx
jle 0x10013089
mov ecx, dword [ecx + 0x20]
add ecx, eax
mov bl, byte [ecx]
xor bl, 0x80
inc eax
mov byte [ecx], bl
mov ecx, dword [esi - 0x100]
cmp eax, dword [ecx + 0x10]
jl 0x10012ff6
jmp 0x10013089
mov ecx, dword [eax + 0x10]
xor edi, edi
test ecx, ecx
jle 0x1001303c
push ebp
call sym.alleg40.dll_pack_igetw
mov edx, dword [esi - 0x100]
add esp, 4
inc edi
mov ecx, dword [edx + 0x20]
mov word [ecx + edi*2 - 2], ax
mov edx, dword [esi - 0x100]
cmp edi, dword [edx + 0x10]
jl 0x10013019
test byte [esp + 0x10], 2
jne 0x1001306a
mov ecx, dword [esi - 0x100]
xor eax, eax
mov edx, dword [ecx + 0x10]
test edx, edx
jle 0x1001306a
mov ecx, dword [ecx + 0x20]
xor word [ecx + eax*2], 0x8000
lea ecx, [ecx + eax*2]
inc eax
mov ecx, dword [esi - 0x100]
cmp eax, dword [ecx + 0x10]
jl 0x10013052
test ebx, ebx
je 0x10013089
mov ecx, dword [ebp + 0xc]
dec ecx
mov eax, ecx
mov dword [ebp + 0xc], ecx
test eax, eax
jle 0x10013080
inc dword [ebp + 8]
jmp 0x10013089
push ebp
call sym.alleg40.dll__sort_out_getc
add esp, 4
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
inc eax
add esi, 4
mov ecx, dword [edi]
mov dword [esp + 0x14], eax
cmp eax, ecx
jl 0x10012b58
jmp 0x10012aa8
mov edx, dword [esp + 0x14]
push edi
mov dword [edi], edx
call fcn.10013160
mov ecx, dword [sym.alleg40.dll_allegro_errno]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
mov dword [ecx], 0xc
pop ebx
add esp, 0x140
ret
mov esi, dword [esp + 0x14]
mov edx, dword [edi + esi*4 + 4]
push edx
call dword [sym.imp.MSVCRT.dll_free]
push edi
mov dword [edi], esi
call fcn.10013160
mov ecx, dword [sym.alleg40.dll_allegro_errno]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
mov dword [ecx], 0xc
pop ebx
add esp, 0x140
ret
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov ebx, dword [sym.imp.MSVCRT.dll_free]
mov edx, dword [esi + edi*4 + 4]
push edx
call ebx
mov eax, dword [esi + edi*4 + 0x104]
push eax
call ebx
push esi
mov dword [esi], edi
call fcn.10013160
mov ecx, dword [sym.alleg40.dll_allegro_errno]
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
mov dword [ecx], 0xc
pop ebx
add esp, 0x140
ret
mov edx, dword [sym.alleg40.dll_allegro_errno]
pop edi
pop esi
mov eax, ebx
pop ebp
mov dword [edx], 0x16
pop ebx
add esp, 0x140
ret