Function at 0x1013c24
Capabilities:
Allocate or change rwx memory
Encode data using xor

Disassembly:
pushfd
push ebp
mov ebp, esp
sub esp, 0x8c
mov dword [ebp - 0x88], eax
lea eax, [ebp + 4]
mov dword [ebp - 0x80], ecx
mov dword [ebp - 0x78], edx
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0x8c], esi
mov dword [ebp - 0x84], edi
mov edi, dword [0x1007840]
mov esi, dword [eax + 4]
sub eax, 4
mov dword [ebp - 0x64], eax
mov eax, dword [esi + 4]
and eax, 0xfffffff
lea ecx, [edi + eax - 1]
mov eax, ecx
xor edx, edx
div edi
sub ecx, edx
mov eax, dword [0x1007840]
mov dword [ebp - 0x40], ecx
mov eax, dword [0x107beec]
mov dword [ebp - 0x3c], eax
mov eax, dword [0x1007840]
mov eax, dword [0x107beec]
test eax, eax
je 0x1013d09
mov eax, dword [0x107beec]
xor edi, edi
dec eax
lea ecx, [eax + 1]
xor eax, eax
mov edx, ecx
test ecx, ecx
je 0x1013cc6
mov ebx, dword [0x108d0c4]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x108d0c4], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x1013c9f
xor edx, edx
div ecx
cmp dword [ebp - 0x3c], 0
jbe 0x1013d03
inc edi
mov eax, 0xc4a6
mov ecx, 0xffff3b59
lea ebx, [edx*4 + 0x108e3bc]
lock cmpxchg dword [ebx], ecx
cmp eax, 0xc4a6
je 0x1013e7e
lea eax, [edx + 1]
xor edx, edx
mov ecx, dword [0x107beec]
div ecx
cmp edi, dword [ebp - 0x3c]
jb 0x1013cd0
xor edi, edi
test edi, edi
jne 0x1013d7f
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
mov ebx, eax
push 0x40
push 0x1000
push dword [ebp - 0x40]
inc edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x1013e92
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp edi, 0x11
jb 0x1013d13
xor edi, edi
cmp edi, 0x10000
jb 0x1013d4c
test edi, 3
je 0x1013d60
test edi, edi
je 0x1013d5e
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor edi, edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
test edi, edi
je 0x1013c76
mov eax, edi
mov ecx, dword [ebp - 0x40]
test ecx, ecx
je 0x1013d7f
mov byte [eax], 0
inc eax
dec ecx
jne 0x1013d78
mov eax, 0x6002ad2b
mov ebx, 0x1000000
mov eax, dword [esi]
mov ecx, dword [esi + 4]
shr eax, 1
and eax, 7
and ecx, 0xfffffff
lea eax, [eax + esi + 8]
lea edx, [eax + ecx]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x40], eax
mov eax, dword [0x1007840]
sub eax, ecx
sub dword [ebp - 0x38], ebx
mov dword [ebp - 0x3c], ecx
lea esi, [eax + 1]
xor eax, eax
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x34], esi
test esi, esi
je 0x1013dec
mov edx, dword [0x108d0c4]
shr dword [ebp - 0x34], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x108d0c4], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x34], 0
jne 0x1013dc2
xor edx, edx
div esi
add edx, edi
push ecx
push dword [ebp - 0x38]
mov dword [ebp - 0x34], edx
mov eax, edx
mov eax, 0xfdc22182
mov eax, dword [ebp - 0x4c]
pop ecx
lea esi, [ebp - 0x6c]
pop ecx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x6c], ecx
mov dword [ebp - 0x68], eax
mov byte [ebp - 0xd], 0
mov eax, 0xb8a54b4b
mov edx, dword [0x1001228]
mov esi, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x6c]
and dword [ebp - 0x20], 0
mov eax, 0xfffffff
and dword [ebp - 0x1c], 0
and ecx, eax
and esi, eax
add ecx, ebx
mov eax, ebx
sub eax, edx
mov dword [ebp - 0x2c], eax
jne 0x1013e99
xor ebx, ebx
test esi, esi
jbe 0x1014055
mov edi, 0x74a3cf2e
mov edx, edi
movzx eax, byte [ebx + ecx]
add eax, edi
add dword [ebp - 0x20], eax
add eax, dword [ebp - 0x1c]
imul eax, eax, 0x74a3cf2e
ror eax, 0x13
mul edx
add eax, edx
add dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
inc ebx
cmp ebx, esi
jb 0x1013e53
jmp 0x1014055
mov edi, dword [0x1007840]
imul edi, edx
lea edi, [edi + 0x1084008]
jmp 0x1013d05
mov edi, eax
jmp 0x1013d3c
mov ebx, 0x1000000
mov edi, dword [0x100003c]
lea edi, [edi + 0x10000a0]
mov edx, ecx
lea eax, [ecx + esi]
mov dword [ebp - 0x24], eax
mov eax, dword [edi]
add eax, ebx
sub edx, ebx
mov ebx, dword [edi + 4]
mov edi, edx
and edi, 0xfffff000
mov dword [ebp - 0x18], edi
mov edi, edx
sub edi, dword [ebp - 0x18]
add edx, esi
mov esi, edx
and esi, 0xfffff000
mov dword [ebp - 0x60], esi
sub edx, esi
mov dword [ebp - 0x5c], edx
mov esi, eax
add ebx, eax
cmp eax, ebx
mov dword [ebp - 0x58], ebx
je 0x1013ef7
mov eax, dword [ebp - 0x18]
cmp dword [esi], eax
jae 0x1013ef7
add esi, dword [esi + 4]
cmp esi, dword [ebp - 0x58]
jne 0x1013ee8
mov edx, 0xfff
and dword [ebp - 0x50], 0
cmp esi, dword [ebp - 0x58]
je 0x1013f34
mov eax, dword [ebp - 0x18]
cmp dword [esi], eax
jne 0x1013f34
mov eax, dword [esi + 4]
sub eax, 8
shr eax, 1
je 0x1013f34
lea ebx, [esi + 8]
mov dword [ebp - 0x18], ebx
mov ebx, dword [ebp - 0x18]
movzx ebx, word [ebx]
and ebx, edx
cmp ebx, edi
jae 0x1013f34
inc dword [ebp - 0x50]
add dword [ebp - 0x18], 2
cmp dword [ebp - 0x50], eax
jne 0x1013f1c
mov edi, 0x74a3cf2e
cmp esi, dword [ebp - 0x58]
je 0x1014026
mov eax, dword [esi]
cmp eax, dword [ebp - 0x60]
ja 0x1014026
mov ebx, dword [ebp - 0x50]
mov eax, dword [esi + 4]
add eax, 0xfffffff8
shr eax, 1
cmp ebx, eax
jne 0x1013f77
add esi, dword [esi + 4]
cmp esi, dword [ebp - 0x58]
je 0x1014026
mov eax, dword [ebp - 0x60]
cmp dword [esi], eax
ja 0x1014026
xor ebx, ebx
jmp 0x1013f50
mov eax, dword [ebp - 0x60]
cmp dword [esi], eax
jne 0x1013f8e
movzx eax, word [esi + ebx*2 + 8]
and eax, edx
cmp eax, dword [ebp - 0x5c]
jae 0x1014026
mov eax, ebx
inc ebx
mov dword [ebp - 0x50], ebx
mov ebx, 0xf000
test word [esi + eax*2 + 8], bx
je 0x1013f39
movzx eax, word [esi + eax*2 + 8]
and eax, edx
xor ebx, ebx
mov edx, dword [esi]
lea eax, [eax + edx + 0x1000000]
mov dword [ebp - 0x18], eax
sub dword [ebp - 0x18], ecx
mov dword [ebp - 0x28], eax
je 0x1013fe4
movzx eax, byte [ebx + ecx]
mov edx, edi
add eax, edi
add dword [ebp - 0x20], eax
add eax, dword [ebp - 0x1c]
imul eax, eax, 0x74a3cf2e
ror eax, 0x13
mul edx
add eax, edx
add dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
inc ebx
cmp ebx, dword [ebp - 0x18]
jb 0x1013fbd
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx]
sub eax, dword [ebp - 0x2c]
xor ebx, ebx
mov dword [ebp - 0x70], eax
movzx eax, byte [ebp + ebx - 0x70]
mov edx, edi
add eax, edi
add dword [ebp - 0x20], eax
add eax, dword [ebp - 0x1c]
imul eax, eax, 0x74a3cf2e
ror eax, 0x13
mul edx
add eax, edx
add dword [ebp - 0x20], eax
inc ebx
cmp ebx, 4
mov dword [ebp - 0x1c], eax
jb 0x1013ff1
add ecx, 4
mov edx, 0xfff
jmp 0x1013f39
xor esi, esi
mov ebx, dword [ebp - 0x24]
sub ebx, ecx
je 0x1014055
mov edx, edi
movzx eax, byte [ecx + esi]
add eax, edi
add dword [ebp - 0x20], eax
add eax, dword [ebp - 0x1c]
imul eax, eax, 0x74a3cf2e
ror eax, 0x13
mul edx
add eax, edx
add dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
inc esi
cmp esi, ebx
jb 0x101402f
xor eax, eax
mov ecx, eax
and ecx, 7
mov cl, byte [ebp + ecx - 0x20]
mov byte [ebp + eax - 0xc], cl
inc eax
cmp eax, 8
jb 0x1014057
mov eax, 0x515e7b96
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x3c]
and eax, 7
mov dword [ebp - 0x28], eax
je 0x1014232
mov edi, dword [ebp - 0x38]
not edi
xor ecx, ecx
cmp eax, ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x14], ecx
jle 0x10140c4
push 0x38
pop edx
movzx ebx, byte [esi]
cmp dword [ebp - 0x14], 4
jge 0x10140b1
lea ecx, [edx - 0x20]
shl ebx, cl
or dword [ebp - 0x2c], ebx
jmp 0x10140b8
mov ecx, edx
shl ebx, cl
or dword [ebp - 0x18], ebx
inc esi
inc dword [ebp - 0x14]
sub edx, 8
cmp dword [ebp - 0x14], eax
jl 0x101409e
mov eax, dword [ebp - 8]
movzx ebx, word [ebp - 8]
mov ecx, dword [ebp - 0xc]
xor ecx, edi
sub eax, ecx
movzx ecx, word [ebp - 6]
xor eax, dword [ebp - 0x38]
mov edx, eax
sub edx, ecx
sub edx, dword [ebp - 0xc]
mov dword [ebp - 0x14], ecx
xor edi, edx
movzx edx, word [ebp - 0xc]
mov dword [ebp - 0x24], edx
xor edx, edi
imul edx, ebx
mov ebx, edi
shr ebx, 3
add edx, ebx
xor eax, edx
mov ebx, eax
movzx edx, word [ebp - 0xa]
xor ecx, eax
rol ecx, 3
mov dword [ebp - 0x44], edx
imul edx, ecx
ror ebx, 0xe
xor ebx, edx
xor edi, ebx
mov ecx, edi
sub ecx, dword [ebp - 8]
ror ecx, 4
mov ebx, dword [ebp - 0x24]
mov edx, edi
imul ebx, ecx
rol edx, 7
mov ecx, dword [ebp - 0xc]
add edx, ebx
mov ebx, dword [ebp - 0x14]
xor eax, edx
sub ecx, eax
mov edx, eax
rol ecx, 6
imul ebx, ecx
ror edx, 6
add edx, ebx
xor edi, edx
mov ecx, edi
movzx edx, word [ebp - 8]
mov ebx, edi
sub ecx, dword [ebp - 0xc]
rol ecx, 0xf
imul edx, ecx
rol ebx, 0xc
movzx ecx, word [ebp - 8]
xor ebx, edx
xor eax, ebx
xor ecx, eax
imul ecx, dword [ebp - 0x44]
mov edx, eax
ror edx, 4
sub ecx, edx
xor edi, ecx
mov ecx, dword [ebp - 8]
xor ecx, dword [ebp - 0xc]
xor ecx, edi
xor eax, ecx
mov edx, eax
mov ecx, dword [ebp - 0x14]
sub edx, ecx
xor edx, dword [ebp - 0xc]
xor edi, edx
mov ebx, edi
movzx edx, word [ebp - 8]
sub ebx, ecx
imul ebx, edx
mov edx, edi
shr edx, 3
sub ebx, edx
xor eax, ebx
mov ebx, eax
mov edx, dword [ebp - 0x44]
xor ecx, eax
rol ecx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x24]
and dword [ebp - 0x14], 0
ror ebx, 0xe
sub edx, ebx
xor edi, edx
mov edx, dword [ebp - 8]
sub edx, edi
mov ebx, edi
ror edx, 4
imul ecx, edx
xor edi, dword [ebp - 0x18]
ror ebx, 0xd
sub ecx, ebx
mov ebx, dword [ebp - 0x28]
xor ecx, dword [ebp - 0x2c]
xor eax, ecx
mov ecx, edi
test ebx, ebx
mov dword [ebp - 0x24], eax
jle 0x1014208
cmp dword [ebp - 0x14], 4
jge 0x10141ef
rol dword [ebp - 0x24], 8
mov ebx, dword [ebp - 0x30]
mov dl, byte [ebp - 0x24]
inc dword [ebp - 0x30]
xor byte [ebp - 0xd], dl
mov byte [ebx], dl
jmp 0x10141fd
mov edx, dword [ebp - 0x30]
inc dword [ebp - 0x30]
rol ecx, 8
xor byte [ebp - 0xd], cl
mov byte [edx], cl
inc dword [ebp - 0x14]
mov ebx, dword [ebp - 0x28]
cmp dword [ebp - 0x14], ebx
jl 0x10141d5
add ebx, 0xfffffffc
test ebx, ebx
jle 0x101421f
push 4
pop ecx
sub ecx, ebx
shl ecx, 3
shr edi, cl
shl edi, cl
mov edx, edi
jmp 0x1014241
xor edx, edx
test ebx, ebx
jge 0x1014241
neg ebx
shl ebx, 3
mov ecx, ebx
shr eax, cl
shl eax, cl
jmp 0x1014241
xor edx, edx
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
not eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov ecx, dword [ebp - 0x3c]
shr ecx, 3
test ecx, ecx
jbe 0x1014413
mov edi, dword [ebp - 8]
xor edi, dword [ebp - 0xc]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x74], edi
movzx edi, word [ebp - 6]
mov dword [ebp - 0x14], edi
movzx edi, word [ebp - 0xa]
mov dword [ebp - 0x44], edi
movzx edi, byte [esi + 1]
movzx ecx, byte [esi]
shl ecx, 8
movzx ebx, byte [esi + 5]
or ecx, edi
shl ecx, 8
movzx edi, byte [esi + 2]
or ecx, edi
shl ecx, 8
movzx edi, byte [esi + 3]
or ecx, edi
movzx edi, byte [esi + 4]
shl edi, 8
or edi, ebx
movzx ebx, byte [esi + 6]
shl edi, 8
or edi, ebx
movzx ebx, byte [esi + 7]
shl edi, 8
or edi, ebx
xor edx, edi
mov ebx, dword [ebp - 8]
mov dword [ebp - 0x48], edi
mov edi, dword [ebp - 0xc]
xor edi, edx
mov dword [ebp - 0x24], ecx
sub ebx, edi
xor ebx, ecx
xor eax, ebx
mov ecx, eax
mov ebx, dword [ebp - 0x44]
sub ecx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0xc]
add esi, 8
xor edx, ecx
movzx ecx, word [ebp - 0xc]
mov edi, ecx
xor edi, edx
movzx ecx, word [ebp - 8]
imul edi, ecx
mov ecx, edx
shr ecx, 3
add edi, ecx
xor eax, edi
mov edi, eax
mov ecx, dword [ebp - 0x14]
xor ecx, eax
rol ecx, 3
imul ebx, ecx
ror edi, 0xe
xor edi, ebx
xor edx, edi
mov ebx, edx
mov ecx, edx
sub ecx, dword [ebp - 8]
ror ecx, 4
movzx edi, word [ebp - 0xc]
imul edi, ecx
rol ebx, 7
mov ecx, dword [ebp - 0xc]
add ebx, edi
xor eax, ebx
mov edi, eax
sub ecx, eax
mov ebx, dword [ebp - 0x14]
rol ecx, 6
imul ebx, ecx
ror edi, 6
add edi, ebx
xor edx, edi
movzx edi, word [ebp - 8]
mov ebx, edx
mov ecx, edx
sub ecx, dword [ebp - 0xc]
rol ecx, 0xf
imul edi, ecx
rol ebx, 0xc
movzx ecx, word [ebp - 8]
xor ebx, edi
xor eax, ebx
mov ebx, dword [ebp - 0x44]
mov edi, eax
ror edi, 4
xor ecx, eax
imul ecx, dword [ebp - 0x44]
sub ecx, edi
xor edx, ecx
mov ecx, dword [ebp - 0x74]
xor ecx, edx
xor eax, ecx
mov ecx, eax
sub ecx, dword [ebp - 0x14]
xor ecx, dword [ebp - 0xc]
xor edx, ecx
movzx ecx, word [ebp - 8]
mov edi, edx
sub edi, dword [ebp - 0x14]
imul edi, ecx
mov ecx, edx
shr ecx, 3
sub edi, ecx
mov ecx, dword [ebp - 0x14]
xor eax, edi
mov edi, eax
xor ecx, eax
rol ecx, 1
imul ebx, ecx
ror edi, 0xe
sub ebx, edi
xor edx, ebx
mov ebx, edx
movzx edi, word [ebp - 0xc]
mov ecx, dword [ebp - 8]
sub ecx, edx
ror ecx, 4
imul edi, ecx
mov cl, byte [ebp - 0xd]
xor edx, dword [ebp - 0x18]
ror ebx, 0xd
sub edi, ebx
xor edi, dword [ebp - 0x2c]
xor eax, edi
xor cl, al
mov edi, dword [ebp - 0x30]
xor cl, dl
mov byte [edi + 3], al
mov byte [edi + 7], dl
ror eax, 8
mov byte [edi + 2], al
xor cl, al
ror edx, 8
mov byte [edi + 6], dl
xor cl, dl
ror eax, 8
mov byte [edi + 1], al
xor cl, al
ror edx, 8
mov byte [edi + 5], dl
xor cl, dl
ror eax, 8
ror edx, 8
mov bl, dl
xor bl, al
xor cl, bl
mov ebx, dword [ebp - 0x24]
mov byte [edi], al
mov byte [edi + 4], dl
add edi, 8
mov dword [ebp - 0x2c], ebx
mov ebx, dword [ebp - 0x48]
dec dword [ebp - 0x28]
ror eax, 8
ror edx, 8
mov byte [ebp - 0xd], cl
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x30], edi
jne 0x1014269
jmp 0x1014416
mov cl, byte [ebp - 0xd]
mov eax, dword [ebp - 0x4c]
cmp cl, byte [eax + 8]
je 0x10144a7
call fcn.01017a8f
mov edi, eax
mov eax, dword [ebp - 0x64]
lea ecx, [eax + 0xc]
mov dword [eax + 8], 0x1011318
mov edx, 0xfffff000
and ecx, 0xfffffffc
lea esi, [ecx + 0xfff]
and edi, edx
and esi, edx
mov edx, 0xffff
xor eax, eax
mov ebx, dword [0x108d0c4]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x108d0c4], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x101444f
mov ebx, 0xffff
div ebx
mov dword [ebp - 0x78], edi
inc edx
mov eax, ecx
mov dword [ebp - 0x80], edx
cmp ecx, esi
mov dword [ebp - 0x48], 0
jae 0x101449d
mov ecx, dword [ebp - 0x48]
mov dword [eax], ecx
add eax, 4
cmp eax, esi
jb 0x1014491
mov eax, 0x1011318
jmp 0x1014578
mov edx, dword [0x1001228]
mov eax, dword [ebp - 0x40]
mov ecx, 0x1000000
sub eax, dword [ebp - 0x34]
mov dword [ebp - 0x28], eax
sub ecx, edx
mov dword [ebp - 0x4c], ecx
jne 0x10144ca
test eax, eax
je 0x101456b
mov eax, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x34]
mov ecx, dword [0x1023f98]
mov ebx, dword [ebp - 0x38]
sub esi, dword [ebp - 0x40]
add eax, ebx
xor edi, edi
mov dword [ebp - 0x48], eax
dec ecx
js 0x101450d
lea eax, [ecx + edi]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x1023f9c]
and edx, 0xfffffff
cmp ebx, edx
jae 0x1014504
lea ecx, [eax - 1]
jmp 0x1014509
jbe 0x1014511
lea edi, [eax + 1]
cmp ecx, edi
jge 0x10144e6
mov ebx, edi
jmp 0x1014563
mov ebx, eax
jmp 0x1014563
mov eax, dword [ebx*4 + 0x1023f9c]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0x48]
jae 0x101456b
lea edi, [ecx + esi + 0x1000000]
mov ecx, eax
shl ecx, 2
sar ecx, 0x1e
sar eax, 0x1e
and ecx, 3
and eax, 3
xor edx, edx
dec ecx
je 0x1014556
dec ecx
je 0x1014551
dec ecx
jne 0x101455c
mov edx, dword [ebp - 0x4c]
jmp 0x101455c
mov edx, dword [ebp - 0x28]
jmp 0x101455c
mov edx, dword [ebp - 0x4c]
sub edx, dword [ebp - 0x28]
dec eax
dec eax
jne 0x1014562
add dword [edi], edx
inc ebx
cmp ebx, dword [0x1023f98]
jb 0x1014515
mov eax, dword [0x1007840]
mov eax, 0xcabb7bf9
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x64]
mov dword [ecx + 8], eax
mov edi, dword [ebp - 0x84]
mov edx, dword [ebp - 0x78]
mov esi, dword [ebp - 0x8c]
mov eax, dword [ebp - 0x88]
mov ebx, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x80]
mov esp, ebp
pop ebp
popfd
ret