Function at 0x401050
Capabilities:
Encode data using xor
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x134
mov eax, ecx
push ebx
push ebp
push esi
mov ebp, dword [eax]
xor esi, esi
add ebp, eax
mov dword [esp + 0x24], eax
add eax, 0x356000
push edi
cmp ebp, eax
jae 0x401248
mov eax, 0x14c
cmp word [ebp + 4], ax
jne 0x401248
mov ebx, dword [ebp + 0x38]
test bl, 1
jne 0x401248
movzx eax, word [ebp + 0x14]
movzx edx, word [ebp + 6]
add eax, 0x24
test edx, edx
je 0x4010bb
add eax, ebp
nop
mov ecx, dword [eax + 4]
mov edi, dword [eax]
test ecx, ecx
jne 0x4010ab
mov ecx, ebx
add ecx, edi
cmp ecx, esi
jbe 0x4010b3
mov esi, ecx
add eax, 0x28
sub edx, 1
jne 0x4010a0
mov ecx, dword [ebp + 0x50]
lea eax, [esi + 0xfff]
add ecx, 0xfff
and eax, 0xfffff000
and ecx, 0xfffff000
cmp ecx, eax
jne 0x401248
push 0
push ecx
push 0
push 0
mov ecx, 0x3000
call fcn.004020d0
add esp, 0x10
mov dword [esp + 0x24], eax
test eax, eax
je 0x401248
mov eax, dword [0x802e00]
test eax, eax
jne 0x40121e
push 0x100
push eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov word [esp + 0x44], ax
mov byte [esp + 0x46], al
lea eax, [esp + 0x48]
push eax
call fcn.00403ca0
add esp, 0xc
xor edi, edi
xor eax, eax
mov byte [esp + eax + 0x40], al
inc eax
cmp eax, 0x100
jb 0x401136
xor esi, esi
mov dl, byte [esp + esi + 0x40]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41b120]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x40]
mov byte [esp + esi + 0x40], al
inc esi
mov byte [esp + edi + 0x40], dl
cmp esi, 0x100
jb 0x401144
xor edi, edi
xor ebx, ebx
xor esi, esi
lea esp, [esp]
lea eax, [edi + 1]
movzx edi, al
mov cl, byte [esp + edi + 0x40]
movzx edx, cl
lea eax, [edx + ebx]
movzx ebx, al
movzx eax, byte [esp + ebx + 0x40]
mov byte [esp + edi + 0x40], al
mov byte [esp + ebx + 0x40], cl
movzx eax, byte [esp + edi + 0x40]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x40]
xor al, byte [esi + 0x41b124]
mov byte [esp + esi + 0x30], al
inc esi
cmp esi, 0xf
jb 0x401180
call fcn.004042c0
mov esi, eax
call fcn.00403880
test esi, esi
je 0x4011fd
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x4011fd
mov ecx, dword [eax + esi + 0x7c]
test ecx, ecx
je 0x4011fd
mov eax, dword [eax + esi + 0x78]
test eax, eax
je 0x4011fd
lea edx, [esp + 0x30]
push edx
push ecx
lea edx, [eax + esi]
mov ecx, esi
call fcn.00403120
add esp, 8
test eax, eax
jne 0x401215
mov eax, dword [0x802000]
test eax, eax
jne 0x40120d
mov dword [0x802e00], eax
jmp 0x401220
lea ecx, [esp + 0x30]
push ecx
push esi
call eax
mov dword [0x802e00], eax
test eax, eax
je 0x401220
call eax
push ecx
mov ecx, eax
call fcn.00402da0
mov esi, eax
mov dword [esp + 0x14], esi
test esi, esi
jne 0x401255
push eax
push eax
mov eax, dword [esp + 0x2c]
mov ecx, 0x8000
cdq
push edx
push eax
call fcn.00403fd0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x134
ret
mov ecx, dword [esp + 0x24]
mov dword [esi + 8], ecx
mov dword [esi + 0x14], 0x1000
cmp dword [ebp + 0x54], 0x356000
ja 0x401248
mov dword [esi], ebp
mov eax, ecx
sub eax, dword [ebp + 0x34]
xor edx, edx
mov dword [ebp + 0x34], ecx
xor ebx, ebx
mov ecx, dword [esi]
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 8]
mov dword [esp + 0x18], eax
movzx edi, word [ecx + 0x14]
add edi, 0x24
cmp dx, word [ecx + 6]
jae 0x401368
cdq
add edi, ecx
mov esi, eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], esi
jmp 0x4012ab
mov esi, dword [esp + 0x20]
mov ecx, dword [edi + 4]
test ecx, ecx
jne 0x4012ff
mov esi, dword [ebp + 0x38]
test esi, esi
jle 0x401352
mov ecx, dword [edi]
mov eax, esi
cdq
push edx
push eax
xor eax, eax
add ecx, dword [esp + 0x28]
adc eax, dword [esp + 0x24]
push eax
push ecx
mov ecx, 0x1000
call fcn.004020d0
add esp, 0x10
test eax, eax
je 0x401248
mov eax, dword [edi]
add eax, dword [esp + 0x18]
mov dword [edi - 4], eax
test esi, esi
je 0x40134e
mov byte [eax], 0
lea eax, [eax + 1]
sub esi, 1
jne 0x4012f2
jmp 0x40134e
mov eax, dword [edi + 8]
add eax, ecx
cmp eax, 0x356000
ja 0x401248
push 0
push ecx
mov ecx, dword [edi]
xor eax, eax
add ecx, esi
adc eax, edx
push eax
push ecx
mov ecx, 0x1000
call fcn.004020d0
add esp, 0x10
test eax, eax
je 0x401248
push dword [edi + 4]
mov eax, dword [edi + 8]
mov esi, dword [edi]
add eax, dword [esp + 0x2c]
add esi, dword [esp + 0x1c]
push eax
push esi
call fcn.004043d0
add esp, 0xc
mov dword [edi - 4], esi
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
inc ebx
add edi, 0x28
mov ecx, dword [esi]
movzx eax, word [ecx + 6]
cmp ebx, eax
jl 0x4012a7
cmp dword [esp + 0x2c], 0
je 0x401487
cmp dword [ecx + 0xa4], 0
jne 0x401383
xor eax, eax
jmp 0x40148c
mov edx, dword [esi + 8]
mov ebp, dword [ecx + 0xa0]
add ebp, edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], ebp
mov eax, dword [ebp]
test eax, eax
je 0x401487
lea ebx, [eax + edx]
xor esi, esi
mov eax, dword [ebp + 4]
lea edi, [ebp + 4]
sub eax, 8
lea edx, [ebp + 8]
test eax, 0xfffffffe
jbe 0x4013ee
mov ebp, dword [esp + 0x2c]
lea ecx, [ecx]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x4013db
and eax, 0xfff
add dword [eax + ebx], ebp
mov eax, dword [edi]
inc esi
sub eax, 8
add edx, 2
shr eax, 1
cmp esi, eax
jb 0x4013c0
mov ebp, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
mov eax, dword [esi + 0x14]
mov dword [esp + 0x18], eax
mov eax, ebx
cdq
mov dword [esp + 0x20], eax
mov eax, dword [0x802024]
mov dword [esp + 0x28], edx
test eax, eax
je 0x401472
mov ecx, dword [eax]
xor esi, esi
test ecx, ecx
je 0x40146e
add eax, 4
cmp dword [eax], 0x7b2d37fc
je 0x40142a
inc esi
add eax, 4
cmp esi, ecx
jb 0x401418
jmp 0x40146e
cmp esi, 0xffffffff
je 0x40146e
call fcn.00403cd0
cmp dword [0x802144], 0
je 0x40145c
push 0
push dword [esp + 0x1c]
push dword [esp + 0x30]
push dword [esp + 0x2c]
push 0xffffffffffffffff
push 0xffffffffffffffff
push 3
push esi
call fcn.00402640
add esp, 0x20
jmp 0x40146e
push dword [esp + 0x18]
push ebx
push 0xffffffffffffffff
push 3
push esi
call fcn.0041acb0
add esp, 0x14
mov esi, dword [esp + 0x14]
add ebp, dword [edi]
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x18], ebp
mov eax, dword [ebp]
test eax, eax
jne 0x4013a1
mov eax, 1
mov ecx, esi
mov dword [esi + 0x10], eax
call fcn.00402500
test eax, eax
je 0x401248
mov ecx, esi
call fcn.00403e50
test eax, eax
je 0x401248
mov ecx, dword [esi]
mov edx, ecx
mov ebx, dword [esp + 0x14]
mov esi, dword [ecx + 0xc0]
test esi, esi
je 0x4014f7
cmp dword [ecx + 0xc4], 0
je 0x4014f7
mov edi, dword [ebx + 8]
mov esi, dword [edi + esi + 0xc]
test esi, esi
je 0x4014f7
mov eax, dword [esi]
test eax, eax
je 0x4014f7
lea esp, [esp]
push 0
push 1
push edi
push eax
call fcn.0041ace0
mov eax, dword [esi + 4]
lea esi, [esi + 4]
test eax, eax
jne 0x4014e0
mov edx, dword [ebx]
mov ecx, dword [edx + 0x28]
test ecx, ecx
je 0x40151a
mov eax, dword [esp + 0x24]
add ecx, eax
push 0
push 1
push eax
call ecx
test eax, eax
je 0x401248
mov dword [ebx + 0xc], 1
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x134
ret