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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0x10]
test ebx, ebx
je 0x40416b
cmp dword [ebp + 0x28], 8
je 0x4039d7
cmp dword [ebp + 0x28], 0
jne 0x40416b
cmp dword [ebx + 0x2c], 1
jne 0x4039ef
mov dword [esp], ebx
call fcn.004030bc
mov edx, eax
test eax, eax
jne 0x404170
cmp dword [ebp + 0xc], 0
jne 0x4039fc
mov dword [ebp + 0xc], 0x63c05c
mov dword [ebp - 0x3c], 0
cmp dword [ebp + 0x24], 0
je 0x403a19
xor eax, eax
or ecx, 0xffffffff
mov edi, dword [ebp + 0x24]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [ebp - 0x3c], ecx
xor eax, eax
or ecx, 0xffffffff
mov edi, dword [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
test esi, esi
lea edi, [ecx - 1]
jne 0x403a38
mov dword [ebx + 0x4088], 0
jmp 0x403a85
mov eax, dword [esi + 0x18]
test eax, eax
jne 0x403a7f
mov eax, dword [esi + 0x14]
cmp eax, 0x7bc
jbe 0x403a50
sub eax, 0x7bc
jmp 0x403a58
cmp eax, 0x50
jbe 0x403a58
sub eax, 0x50
mov edx, dword [esi + 0x10]
mov ecx, dword [esi]
shl eax, 4
shr ecx, 1
lea eax, [edx + eax + 1]
mov edx, dword [esi + 8]
shl edx, 6
shl eax, 5
add edx, dword [esi + 4]
shl edx, 5
add eax, dword [esi + 0xc]
shl eax, 0x10
add edx, ecx
or eax, edx
mov dword [ebx + 0x4088], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebx + 0x7c], 0
sub eax, 8
cmp eax, 1
ja 0x403aa0
mov dword [ebx + 0x7c], 2
jmp 0x403abc
cmp dword [ebp + 0x2c], 2
jne 0x403aaf
mov dword [ebx + 0x7c], 4
jmp 0x403abc
cmp dword [ebp + 0x2c], 1
jne 0x403abc
mov dword [ebx + 0x7c], 6
cmp dword [ebp + 0x40], 0
je 0x403ac6
or dword [ebx + 0x7c], 1
mov eax, dword [ebp + 0x28]
mov dword [ebx + 0x408c], 0
mov dword [ebx + 0x80], eax
mov eax, dword [ebp + 0x30]
mov dword [ebx + 0x84], eax
mov eax, dword [ebx + 0x20]
mov dword [ebx + 0x4090], 0
mov dword [ebx + 0x68], 0
mov dword [ebx + 0x6c], 0
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [ebx + 0xc]
mov edx, dword [ebp + 0x20]
add edx, edi
mov ecx, dword [ebp - 0x3c]
mov dword [ebx + 0x70], eax
mov dword [ebp - 0x50], edx
lea eax, [ecx + edx + 0x2e]
mov dword [ebx + 0x78], eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x74], eax
mov byte [eax], 0x50
mov byte [eax + 1], 0x4b
mov byte [eax + 2], 1
mov byte [eax + 3], 2
mov byte [eax + 4], 0
mov byte [eax + 5], 0
mov byte [eax + 6], 0x14
mov byte [eax + 7], 0
mov edx, dword [ebx + 0x7c]
mov ecx, edx
mov byte [eax + 8], dl
shr ecx, 8
shr edx, 0x10
mov byte [eax + 9], cl
test edx, edx
je 0x403b66
mov byte [eax + 8], 0xff
mov byte [eax + 9], 0xff
mov edx, dword [ebx + 0x80]
mov eax, dword [ebx + 0x74]
mov ecx, edx
shr ecx, 8
mov byte [eax + 0xa], dl
shr edx, 0x10
mov byte [eax + 0xb], cl
test edx, edx
je 0x403b89
mov byte [eax + 0xa], 0xff
mov byte [eax + 0xb], 0xff
mov edx, dword [ebx + 0x4088]
mov eax, dword [ebx + 0x74]
mov ecx, edx
shr ecx, 8
mov byte [eax + 0xc], dl
mov byte [eax + 0xd], cl
mov ecx, edx
shr ecx, 0x10
shr edx, 0x18
mov byte [eax + 0xe], cl
mov byte [eax + 0xf], dl
mov edx, dword [ebx + 0x74]
lea eax, [edx + 0x10]
mov byte [edx + 0x10], 0
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 0
mov edx, dword [ebx + 0x74]
lea eax, [edx + 0x14]
mov byte [edx + 0x14], 0
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 0
mov edx, dword [ebx + 0x74]
lea eax, [edx + 0x18]
mov byte [edx + 0x18], 0
mov edx, edi
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 0
mov eax, dword [ebx + 0x74]
mov byte [eax + 0x1c], dl
mov edx, edi
shr edx, 8
mov byte [eax + 0x1d], dl
mov edx, edi
shr edx, 0x10
test edx, edx
je 0x403c0e
mov byte [eax + 0x1c], 0xff
mov byte [eax + 0x1d], 0xff
mov eax, dword [ebx + 0x74]
mov cl, byte [ebp + 0x20]
mov byte [eax + 0x1e], cl
mov edx, dword [ebp + 0x20]
shr edx, 8
mov byte [eax + 0x1f], dl
mov edx, dword [ebp + 0x20]
shr edx, 0x10
test edx, edx
je 0x403c32
mov byte [eax + 0x1e], 0xff
mov byte [eax + 0x1f], 0xff
mov eax, dword [ebx + 0x74]
mov dl, byte [ebp - 0x3c]
mov byte [eax + 0x20], dl
mov edx, dword [ebp - 0x3c]
shr edx, 8
mov byte [eax + 0x21], dl
mov edx, dword [ebp - 0x3c]
shr edx, 0x10
test edx, edx
je 0x403c56
mov byte [eax + 0x20], 0xff
mov byte [eax + 0x21], 0xff
mov eax, dword [ebx + 0x74]
test esi, esi
mov byte [eax + 0x22], 0
mov byte [eax + 0x23], 0
mov eax, dword [ebx + 0x74]
jne 0x403c88
mov byte [eax + 0x24], 0
mov byte [eax + 0x25], 0
mov edx, dword [ebx + 0x74]
lea eax, [edx + 0x26]
mov byte [edx + 0x26], 0
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 0
jmp 0x403cae
mov edx, dword [esi + 0x1c]
mov ecx, edx
mov byte [eax + 0x24], dl
shr ecx, 8
shr edx, 0x10
mov byte [eax + 0x25], cl
test edx, edx
je 0x40417a
mov byte [eax + 0x24], 0xff
mov byte [eax + 0x25], 0xff
jmp 0x40417a
mov eax, dword [ebx + 0x70]
mov ecx, dword [ebx + 0x74]
sub eax, dword [ebx + 0x40ac]
lea edx, [ecx + 0x2a]
mov byte [ecx + 0x2a], al
mov ecx, eax
shr ecx, 8
mov byte [edx + 1], cl
mov ecx, eax
shr ecx, 0x10
shr eax, 0x18
mov byte [edx + 2], cl
mov byte [edx + 3], al
xor eax, eax
mov esi, dword [ebp + 0xc]
jmp 0x403ce8
mov edx, dword [ebx + 0x74]
mov cl, byte [esi + eax]
mov byte [edx + eax + 0x2e], cl
inc eax
cmp eax, edi
jb 0x403cdd
lea edx, [edi + 0x2e]
xor eax, eax
mov dword [ebp - 0x40], edi
mov esi, dword [ebp + 0x1c]
jmp 0x403d04
mov edi, dword [ebx + 0x74]
mov cl, byte [esi + eax]
inc eax
mov byte [edi + edx], cl
inc edx
cmp eax, dword [ebp + 0x20]
jb 0x403cf9
mov edx, dword [ebp - 0x50]
xor eax, eax
add edx, 0x2e
mov esi, dword [ebp + 0x24]
jmp 0x403d21
mov edi, dword [ebx + 0x74]
mov cl, byte [esi + eax]
inc eax
mov byte [edi + edx], cl
inc edx
cmp eax, dword [ebp - 0x3c]
jb 0x403d16
mov edi, dword [ebp - 0x40]
mov edx, 0xffffff98
cmp dword [ebx + 0x74], 0
je 0x404170
mov edx, dword [ebx + 0x20]
mov ecx, 0x4034b50
mov eax, ebx
mov dword [esp], 4
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, 0x14
mov eax, ebx
mov dword [esp], 2
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x7c]
mov eax, ebx
mov dword [esp], 2
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x80]
mov eax, ebx
mov dword [esp], 2
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x4088]
mov eax, ebx
mov dword [esp], 4
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
xor ecx, ecx
mov eax, ebx
mov dword [esp], 4
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
xor ecx, ecx
mov eax, ebx
mov dword [esp], 4
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
xor ecx, ecx
mov eax, ebx
mov dword [esp], 4
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, edi
mov eax, ebx
mov dword [esp], 2
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
mov edx, dword [ebx + 0x20]
mov ecx, dword [ebp + 0x18]
mov eax, ebx
mov dword [esp], 2
call fcn.00402b4b
mov edx, eax
test eax, eax
jne 0x403ebd
test edi, edi
je 0x403e8b
mov eax, dword [ebp + 0xc]
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov dword [ebp - 0x58], edx
mov eax, dword [ebx + 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [ebx + 8]
mov edx, dword [ebp - 0x58]
cmp eax, edi
jne 0x403eba
cmp dword [ebp + 0x18], 0
je 0x403ebd
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x18]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x20]
mov dword [ebp - 0x58], edx
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [ebx + 8]
mov edx, dword [ebp - 0x58]
cmp eax, dword [ebp + 0x18]
je 0x403ebd
or edx, 0xffffffff
lea eax, [ebx + 0x88]
mov dword [ebx + 0x34], 0
mov dword [ebx + 0x40], 0x4000
mov dword [ebx + 0x3c], eax
mov dword [ebx + 0x38], 0
mov dword [ebx + 0x44], 0
test edx, edx
jne 0x403f63
cmp dword [ebx + 0x80], 8
jne 0x403f63
cmp dword [ebx + 0x84], 0
jne 0x403f63
mov eax, dword [ebp + 0x34]
mov edx, dword [ebp + 0x34]
sar eax, 0x1f
mov ecx, dword [ebp + 0x3c]
xor edx, eax
mov dword [ebx + 0x50], 0
sub eax, edx
mov dword [ebx + 0x54], 0
mov dword [ebx + 0x58], 0
mov edi, dword [ebp + 0x2c]
mov dword [esp + 0x14], ecx
mov dword [esp + 0xc], eax
mov ecx, dword [ebp + 0x38]
lea eax, [ebx + 0x30]
mov dword [esp + 0x1c], 0x38
mov dword [esp + 0x18], 0x63c05e
mov dword [esp + 0x10], ecx
mov dword [esp + 8], 8
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.0055fdfb
mov edx, eax
test eax, eax
jne 0x403f63
mov dword [ebx + 0x68], 1
mov dword [ebx + 0x40a4], 0
test edx, edx
jne 0x404170
cmp dword [ebp + 0x40], 0
je 0x404160
mov dword [ebx + 0x4090], 1
lea esi, [ebx + 0x4094]
call fcn.0055ed10
mov edi, eax
mov dword [ebx + 0x40a0], eax
mov eax, dword [0x696010]
inc eax
mov dword [0x696010], eax
dec eax
jne 0x403fc3
mov dword [esp], 0
call sub.msvcrt.dll_time
xor eax, 0xbb40e64e
mov dword [esp], eax
call sub.msvcrt.dll_srand
lea eax, [esi + 8]
mov edx, dword [ebp + 0x40]
mov dword [ebx + 0x4094], 0x12345678
mov dword [ebp - 0x48], eax
mov dword [esi + 4], 0x23456789
mov dword [esi + 8], 0x34567890
mov dword [ebp - 0x3c], edx
jmp 0x403ff8
movsx ecx, cl
mov edx, edi
mov eax, esi
call fcn.00402b00
inc dword [ebp - 0x3c]
mov eax, dword [ebp - 0x3c]
mov cl, byte [eax]
test cl, cl
jne 0x403fe9
mov dword [ebp - 0x44], 0
call sub.msvcrt.dll_rand
mov edx, dword [ebp - 0x48]
movzx edx, word [edx]
sar eax, 7
or edx, 2
and eax, 0xff
mov dword [ebp - 0x3c], edx
mov ecx, eax
mov dword [ebp - 0x4c], eax
mov edx, edi
mov eax, esi
call fcn.00402b00
mov eax, dword [ebp - 0x3c]
xor eax, 1
mov ecx, dword [ebp - 0x44]
imul eax, dword [ebp - 0x3c]
movzx eax, ah
xor eax, dword [ebp - 0x4c]
mov byte [ebp + ecx - 0x22], al
inc ecx
mov dword [ebp - 0x44], ecx
cmp ecx, 0xa
jne 0x404008
mov dword [ebx + 0x4094], 0x12345678
mov dword [esi + 4], 0x23456789
mov dword [esi + 8], 0x34567890
jmp 0x404078
movsx ecx, cl
mov edx, edi
mov eax, esi
call fcn.00402b00
inc dword [ebp + 0x40]
mov eax, dword [ebp + 0x40]
mov cl, byte [eax]
test cl, cl
jne 0x404069
mov dword [ebp - 0x3c], 0
mov edx, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x3c]
mov eax, esi
movzx edx, word [edx]
movzx ecx, byte [ebp + ecx - 0x22]
or edx, 2
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x40], edx
mov edx, edi
call fcn.00402b00
mov eax, dword [ebp - 0x40]
xor eax, 1
mov edx, dword [ebp - 0x3c]
imul eax, dword [ebp - 0x40]
movzx eax, ah
xor eax, dword [ebp - 0x44]
mov byte [ebp + edx - 0x2e], al
inc edx
mov dword [ebp - 0x3c], edx
cmp edx, 0xa
jne 0x404088
movzx ecx, word [esi + 8]
mov eax, dword [ebp + 0x44]
or ecx, 2
shr eax, 0x10
mov dword [ebp - 0x3c], ecx
and eax, 0xff
mov edx, edi
mov ecx, eax
mov dword [ebp - 0x40], eax
mov eax, esi
call fcn.00402b00
mov eax, dword [ebp - 0x3c]
xor eax, 1
mov edx, dword [ebp + 0x44]
imul eax, dword [ebp - 0x3c]
movzx eax, ah
shr edx, 0x18
xor eax, dword [ebp - 0x40]
mov byte [ebp - 0x24], al
mov ecx, edx
movzx eax, word [esi + 8]
or eax, 2
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x3c], eax
mov edx, edi
mov eax, esi
call fcn.00402b00
mov eax, dword [ebp - 0x3c]
xor eax, 1
lea ecx, [ebp - 0x2e]
imul eax, dword [ebp - 0x3c]
movzx eax, ah
xor eax, dword [ebp - 0x54]
mov byte [ebp - 0x23], al
mov dword [ebx + 0x40a4], 0xc
mov dword [esp + 0xc], 0xc
mov dword [esp + 8], ecx
mov eax, dword [ebx + 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call dword [ebx + 8]
or edx, 0xffffffff
cmp eax, 0xc
jne 0x404170
mov dword [ebx + 0x2c], 1
xor edx, edx
jmp 0x404170
mov edx, 0xffffff9a
add esp, 0x6c
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esi + 0x20]
mov eax, dword [ebx + 0x74]
mov ecx, edx
shr ecx, 8
mov byte [eax + 0x26], dl
mov byte [eax + 0x27], cl
mov ecx, edx
shr ecx, 0x10
shr edx, 0x18
mov byte [eax + 0x28], cl
mov byte [eax + 0x29], dl
jmp 0x403cae