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

Disassembly:
push edi
pushfd
push ebp
mov ebp, esp
sub esp, 0x78
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x64], ecx
mov ecx, 0xfffffff
mov dword [ebp - 0x74], edx
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x68], esi
mov dword [ebp - 0x70], edi
mov esi, dword [0x102dddc]
lea edi, [ebp + 4]
sub edi, 4
mov dword [ebp - 0x20], edi
add edi, 0xc
mov ebx, dword [edi]
mov eax, dword [ebx + 4]
and eax, ecx
add eax, 0x1000000
mov dword [ebp - 0xc], eax
mov eax, dword [ebx]
and eax, ecx
lea ecx, [esi + eax - 1]
xor edx, edx
mov eax, ecx
div esi
sub ecx, edx
mov eax, dword [0x102dddc]
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x10], ecx
mov eax, dword [0x101da18]
mov dword [ebp - 0x14], eax
mov eax, dword [0x102dddc]
mov eax, dword [0x101da18]
test eax, eax
je 0x107c754
and dword [ebp - 0x18], 0
mov eax, dword [0x101da18]
dec eax
lea ecx, [eax + 1]
xor eax, eax
mov edx, ecx
test ecx, ecx
je 0x107c705
mov esi, dword [0x10893f8]
imul esi, esi, 0x343fd
add esi, 0x269ec3
mov dword [0x10893f8], esi
shr esi, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, esi
test edx, edx
jne 0x107c6de
xor edx, edx
div ecx
cmp dword [ebp - 0x14], 0
jbe 0x107c747
inc dword [ebp - 0x18]
mov ecx, 0xffff2e5b
lea esi, [edx*4 + 0x1088fa0]
mov eax, 0xd1a4
lock cmpxchg dword [esi], ecx
cmp eax, 0xd1a4
je 0x107c8da
mov ecx, dword [0x101da18]
lea eax, [edx + 1]
xor edx, edx
div ecx
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x14]
jb 0x107c70f
xor eax, eax
test eax, eax
mov dword [ebp - 8], eax
jne 0x107c7d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
xor esi, esi
inc esi
push 0x40
push 0x1000
push dword [ebp - 0x10]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x107c8ed
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, 0x11
jb 0x107c75f
and dword [ebp - 8], 0
cmp dword [ebp - 8], 0x10000
jb 0x107c79c
test dword [ebp - 8], 3
je 0x107c7b5
xor esi, esi
cmp dword [ebp - 8], esi
je 0x107c7b2
push 0x8000
push esi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [ebp - 8], esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 8], 0
je 0x107c6af
mov ecx, dword [ebp - 0x10]
test ecx, ecx
mov eax, dword [ebp - 8]
je 0x107c7d9
mov byte [eax], 0
inc eax
dec ecx
jne 0x107c7d2
mov eax, 0x19ccc9f6
add dword [edi], 8
mov esi, dword [ebx]
mov eax, dword [ebp - 0xc]
and esi, 0xfffffff
lea ebx, [esi + eax]
sub eax, 0x1000000
mov dword [ebp - 0x18], eax
mov eax, dword [0x102dddc]
mov dword [ebp - 0x1c], esi
sub eax, esi
lea ecx, [eax + 1]
mov dword [ebp - 0x30], ebx
xor eax, eax
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x107c83a
mov edx, dword [0x10893f8]
shr dword [ebp - 0x14], 0x10
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [0x10893f8], edx
shr edx, 0x10
shl eax, 0x10
or eax, edx
cmp dword [ebp - 0x14], 0
jne 0x107c810
xor edx, edx
div ecx
mov eax, dword [ebp - 8]
add eax, edx
push esi
push dword [ebp - 0x18]
mov dword [ebp - 0x10], eax
mov eax, 0x3f298758
mov eax, dword [ebx]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebx + 4]
test esi, esi
pop ecx
pop ecx
mov dword [ebp - 0x48], eax
mov byte [ebp - 1], 0
jbe 0x107ccf2
lea esi, [ebp - 0x4c]
mov eax, 0xaf367703
mov eax, 0xfffffff
mov esi, dword [ebp - 0x4c]
and esi, eax
mov edi, dword [ebp - 0x48]
mov ecx, dword [0x100771c]
and edi, eax
mov eax, 0x1000000
xor ebx, ebx
add esi, eax
sub eax, ecx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x24], eax
jne 0x107c8f5
cmp edi, ebx
jbe 0x107cabc
mov ecx, 0x54594da6
movzx eax, byte [ebx + esi]
mov edx, ecx
add eax, ecx
add dword [ebp - 0x44], eax
add eax, dword [ebp - 0x40]
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xa77f
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x44], edx
mov dword [ebp - 0x40], edx
inc ebx
cmp ebx, edi
jb 0x107c8a8
jmp 0x107cabc
mov eax, dword [0x102dddc]
imul eax, edx
lea eax, [eax + 0x107f008]
jmp 0x107c749
mov dword [ebp - 8], eax
jmp 0x107c78a
mov ecx, esi
mov edx, dword [0x100003c]
lea edx, [edx + 0x10000a0]
mov ebx, 0x1000000
lea eax, [edi + esi]
mov dword [ebp - 0x2c], eax
mov eax, dword [edx]
add eax, ebx
sub ecx, ebx
mov ebx, dword [edx + 4]
mov edx, ecx
and edx, 0xfffff000
mov dword [ebp - 0x14], edx
mov edx, ecx
sub edx, dword [ebp - 0x14]
add ecx, edi
mov edi, ecx
and edi, 0xfffff000
sub ecx, edi
add ebx, eax
cmp eax, ebx
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x58], ebx
mov edi, eax
je 0x107c953
mov eax, dword [ebp - 0x14]
cmp dword [edi], eax
jae 0x107c953
add edi, dword [edi + 4]
cmp edi, dword [ebp - 0x58]
jne 0x107c944
and dword [ebp - 0x50], 0
cmp edi, dword [ebp - 0x58]
je 0x107c987
mov eax, dword [ebp - 0x14]
cmp dword [edi], eax
jne 0x107c987
mov eax, dword [edi + 4]
sub eax, 8
shr eax, 1
je 0x107c987
lea ecx, [edi + 8]
movzx ebx, word [ecx]
and ebx, 0xfff
cmp ebx, edx
jae 0x107c987
inc dword [ebp - 0x50]
inc ecx
inc ecx
cmp dword [ebp - 0x50], eax
jne 0x107c970
mov ecx, 0x54594da6
mov edx, dword [ebp - 0x60]
cmp edi, dword [ebp - 0x58]
je 0x107ca86
cmp dword [edi], edx
ja 0x107ca86
mov eax, dword [edi + 4]
lea ebx, [eax - 8]
shr ebx, 1
cmp dword [ebp - 0x50], ebx
jne 0x107c9c6
add edi, eax
cmp edi, dword [ebp - 0x58]
je 0x107ca86
cmp dword [edi], edx
ja 0x107ca86
and dword [ebp - 0x50], 0
jmp 0x107c9a0
cmp dword [edi], edx
jne 0x107c9e0
mov eax, dword [ebp - 0x50]
movzx eax, word [edi + eax*2 + 8]
and eax, 0xfff
cmp eax, dword [ebp - 0x5c]
jae 0x107ca86
mov ebx, 0xf000
mov eax, dword [ebp - 0x50]
inc dword [ebp - 0x50]
test word [edi + eax*2 + 8], bx
je 0x107c98f
movzx eax, word [edi + eax*2 + 8]
and eax, 0xfff
xor ebx, ebx
mov edx, dword [edi]
lea eax, [eax + edx + 0x1000000]
mov dword [ebp - 0x14], eax
sub dword [ebp - 0x14], esi
mov dword [ebp - 8], eax
je 0x107ca42
movzx eax, byte [ebx + esi]
add eax, ecx
add dword [ebp - 0x44], eax
add eax, dword [ebp - 0x40]
mov edx, ecx
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xa77f
rol edx, 6
ror eax, 6
xor edx, eax
mov eax, edx
add dword [ebp - 0x44], eax
mov dword [ebp - 0x40], edx
inc ebx
cmp ebx, dword [ebp - 0x14]
jb 0x107ca12
mov esi, dword [ebp - 8]
mov eax, dword [esi]
sub eax, dword [ebp - 0x24]
xor ebx, ebx
mov dword [ebp - 0x28], eax
mov edx, ecx
movzx eax, byte [ebp + ebx - 0x28]
add eax, ecx
add dword [ebp - 0x44], eax
add eax, dword [ebp - 0x40]
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xa77f
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x44], edx
inc ebx
mov dword [ebp - 0x40], edx
cmp ebx, 4
jb 0x107ca4f
add esi, 4
jmp 0x107c98c
mov ebx, dword [ebp - 0x2c]
xor edi, edi
sub ebx, esi
je 0x107cabc
movzx eax, byte [edi + esi]
add eax, ecx
mov edx, ecx
add dword [ebp - 0x44], eax
add eax, dword [ebp - 0x40]
mul edx
add eax, edx
mov edx, eax
imul edx, edx, 0xa77f
rol edx, 6
ror eax, 6
xor edx, eax
add dword [ebp - 0x44], edx
mov dword [ebp - 0x40], edx
inc edi
cmp edi, ebx
jb 0x107ca8f
xor eax, eax
mov ecx, eax
and ecx, 7
mov cl, byte [ebp + ecx - 0x44]
mov byte [ebp + eax - 0x3c], cl
inc eax
cmp eax, 6
jb 0x107cabe
mov eax, 0xe2a782a2
mov esi, 0x100
mov eax, dword [ebp - 0x1c]
or byte [ebp - 0x3c], 1
or byte [ebp - 0x3a], 1
or byte [ebp - 0x38], 1
or byte [ebp - 0x37], 1
dec eax
mov dword [ebp - 0x14], eax
je 0x107cc66
mov ecx, dword [ebp - 0xc]
add eax, ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
sub eax, ecx
mov dword [ebp - 0x2c], eax
test byte [ebp - 0x14], 1
je 0x107cbb1
movzx edi, byte [ebp - 0x39]
mov edx, dword [ebp - 8]
mov al, byte [edx]
mov cl, al
movzx eax, al
xor cl, byte [ebp - 0x39]
and cl, 1
mov byte [ebp - 2], cl
je 0x107cb41
mov ebx, edi
movzx ecx, byte [ebp - 0x3a]
shr ebx, 1
shr ecx, 1
xor ecx, ebx
mov ebx, eax
xor ebx, esi
sar ebx, 1
xor ecx, ebx
jmp 0x107cb47
mov ecx, eax
xor ecx, edi
shr ecx, 1
movzx edx, byte [edx - 1]
mov ebx, edx
xor ebx, ecx
test bl, 1
je 0x107cb88
cmp byte [ebp - 2], 0
je 0x107cb6c
movzx ecx, byte [ebp - 0x3a]
shr ecx, 1
shr edi, 1
xor eax, esi
xor ecx, edi
sar eax, 1
xor ecx, eax
jmp 0x107cb72
xor eax, edi
shr eax, 1
mov ecx, eax
movzx eax, byte [ebp - 0x37]
shr eax, 1
xor edx, ecx
xor eax, 0x80
sar edx, 1
xor eax, edx
jmp 0x107cc4a
cmp byte [ebp - 2], 0
je 0x107cba0
movzx ecx, byte [ebp - 0x3a]
shr ecx, 1
shr edi, 1
xor eax, esi
xor ecx, edi
sar eax, 1
xor ecx, eax
jmp 0x107cba6
xor eax, edi
shr eax, 1
mov ecx, eax
xor edx, ecx
sar edx, 1
mov eax, edx
jmp 0x107cc4a
mov eax, dword [ebp - 8]
mov cl, byte [eax]
mov al, cl
xor al, byte [ebp - 0x3b]
and al, 1
mov byte [ebp - 2], al
movzx ecx, cl
movzx eax, byte [ebp - 0x3b]
je 0x107cbdf
mov edx, eax
shr edx, 1
movzx edi, byte [ebp - 0x3c]
shr edi, 1
xor edi, edx
mov edx, ecx
xor edx, esi
sar edx, 1
xor edi, edx
jmp 0x107cbe5
mov edi, eax
xor edi, ecx
shr edi, 1
mov edx, dword [ebp - 8]
movzx ebx, byte [edx - 1]
mov edx, ebx
xor edx, edi
test dl, 1
je 0x107cc26
cmp byte [ebp - 2], 0
je 0x107cc0d
movzx edx, byte [ebp - 0x3c]
shr edx, 1
shr eax, 1
xor ecx, esi
xor edx, eax
sar ecx, 1
xor edx, ecx
jmp 0x107cc13
xor eax, ecx
shr eax, 1
mov edx, eax
movzx eax, byte [ebp - 0x38]
shr eax, 1
xor ebx, edx
xor eax, 0x80
sar ebx, 1
xor eax, ebx
jmp 0x107cc4a
cmp byte [ebp - 2], 0
je 0x107cc3e
movzx edx, byte [ebp - 0x3c]
shr edx, 1
shr eax, 1
xor ecx, esi
xor edx, eax
sar ecx, 1
xor edx, ecx
jmp 0x107cc44
xor eax, ecx
shr eax, 1
mov edx, eax
xor ebx, edx
sar ebx, 1
mov eax, ebx
xor byte [ebp - 1], al
mov edx, dword [ebp - 8]
dec dword [ebp - 0x14]
mov ecx, dword [ebp - 0x2c]
dec dword [ebp - 8]
cmp dword [ebp - 0x14], 0
mov byte [ecx + edx], al
ja 0x107cb08
mov eax, dword [ebp - 0xc]
mov cl, byte [eax]
mov bl, cl
movzx eax, byte [ebp - 0x3b]
xor bl, byte [ebp - 0x3b]
and bl, 1
movzx ecx, cl
je 0x107cc92
movzx edx, byte [ebp - 0x3c]
mov edi, eax
shr edi, 1
shr edx, 1
xor edx, edi
mov edi, ecx
xor edi, esi
sar edi, 1
xor edx, edi
jmp 0x107cc98
mov edx, eax
xor edx, ecx
shr edx, 1
test dl, 1
je 0x107ccc3
test bl, bl
je 0x107ccb3
movzx edi, byte [ebp - 0x3c]
shr edi, 1
shr eax, 1
xor ecx, esi
xor edi, eax
sar ecx, 1
xor edi, ecx
jmp 0x107ccb9
xor eax, ecx
shr eax, 1
mov edi, eax
movzx edx, byte [ebp - 0x38]
xor edx, edi
xor edx, esi
jmp 0x107ccdf
test bl, bl
je 0x107ccd9
movzx edx, byte [ebp - 0x3c]
shr edx, 1
shr eax, 1
xor ecx, esi
xor edx, eax
sar ecx, 1
xor edx, ecx
jmp 0x107ccdf
xor eax, ecx
shr eax, 1
mov edx, eax
mov esi, dword [ebp - 0x1c]
mov edi, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x30]
sar edx, 1
mov eax, dword [ebp - 0x10]
xor byte [ebp - 1], dl
mov byte [eax], dl
mov al, byte [ebx + 8]
xor al, byte [ebp - 1]
je 0x107cd80
call fcn.01035dac
mov esi, eax
and edi, 0xfffffffc
mov eax, 0xfffff000
mov edx, 0xffff
and esi, eax
lea ecx, [edi + 0xfff]
and ecx, eax
mov eax, dword [ebp - 0x20]
mov dword [eax + 8], 0x1021023
xor eax, eax
mov ebx, dword [0x10893f8]
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov dword [0x10893f8], ebx
shr ebx, 0x10
shl eax, 0x10
shr edx, 0x10
or eax, ebx
test edx, edx
jne 0x107cd28
mov ebx, 0xffff
div ebx
mov dword [ebp - 0x74], esi
inc edx
cmp edi, ecx
mov eax, edi
mov dword [ebp - 0x64], edx
mov dword [ebp - 0x34], 0
jae 0x107cd76
mov edx, dword [ebp - 0x34]
mov dword [eax], edx
add eax, 4
cmp eax, ecx
jb 0x107cd6a
mov eax, 0x1021023
jmp 0x107ce4f
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x10]
mov edx, dword [0x100771c]
mov dword [ebp - 0x14], eax
mov ecx, 0x1000000
sub ecx, edx
mov dword [ebp - 0x1c], ecx
jne 0x107cda3
test eax, eax
je 0x107ce42
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x10]
sub edi, dword [ebp - 0xc]
mov ecx, dword [0x101c5b0]
add eax, esi
mov dword [ebp - 0x34], eax
xor esi, esi
dec ecx
js 0x107cde4
lea eax, [esi + ecx]
cdq
sub eax, edx
sar eax, 1
mov edx, dword [eax*4 + 0x101c5b4]
and edx, 0xfffffff
cmp dword [ebp - 0x18], edx
jae 0x107cddb
lea ecx, [eax - 1]
jmp 0x107cde0
jbe 0x107cde8
lea esi, [eax + 1]
cmp ecx, esi
jge 0x107cdbc
mov ebx, esi
jmp 0x107ce3a
mov ebx, eax
jmp 0x107ce3a
mov eax, dword [ebx*4 + 0x101c5b4]
mov ecx, eax
and ecx, 0xfffffff
cmp ecx, dword [ebp - 0x34]
jae 0x107ce42
lea esi, [ecx + edi + 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 0x107ce2d
dec ecx
je 0x107ce28
dec ecx
jne 0x107ce33
mov edx, dword [ebp - 0x1c]
jmp 0x107ce33
mov edx, dword [ebp - 0x14]
jmp 0x107ce33
mov edx, dword [ebp - 0x1c]
sub edx, dword [ebp - 0x14]
dec eax
dec eax
jne 0x107ce39
add dword [esi], edx
inc ebx
cmp ebx, dword [0x101c5b0]
jb 0x107cdec
mov eax, dword [0x102dddc]
mov eax, 0xf1b90c1d
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x20]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x78]
mov ebx, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x64]
mov edx, dword [ebp - 0x74]
mov edi, dword [ebp - 0x70]
mov esi, dword [ebp - 0x68]
mov esp, ebp
pop ebp
popfd
ret