Function at 0x476a60
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
push ebx
push ebp
mov ebp, dword [esp + 0x18]
push esi
push edi
mov esi, dword [ebp + 0x440]
mov esi, dword [esi]
cmp byte [esi + 0xcf], 0
jne 0x476bf7
mov edi, dword [esi + 0x138]
lea ebx, [esi + 0x21]
test edi, edi
jne 0x476aac
push pe_nt_image_headers32
push 1
call fcn.006dc77f
mov edi, eax
add esp, 8
mov dword [esi + 0x138], edi
test edi, edi
je 0x476c38
mov dword [edi + 0x12c], 0xffffffe7
test ebx, ebx
je 0x476c55
cmp byte [ebx], 0x6c
jne 0x476c55
cmp byte [ebx + 1], 0x68
jne 0x476c55
movsx eax, byte [ebx + 2]
sub eax, 0x35
je 0x476af4
sub eax, 1
je 0x476aed
sub eax, 1
jne 0x476c55
lea ebx, [eax + 0x10]
jmp 0x476af9
mov ebx, 0xf
jmp 0x476af9
mov ebx, 0xd
mov eax, dword [edi + 0xc]
mov dword [edi + 0x12c], 0xffffffe2
mov dword [edi + 4], 0x20000
mov dword [edi + 8], 0x1ffff
test eax, eax
jne 0x476b30
push 0x20000
call fcn.006e38fe
add esp, 4
mov dword [edi + 0xc], eax
test eax, eax
je 0x476c38
mov ecx, ebx
mov edx, 1
shl edx, cl
push edx
sub eax, edx
add eax, dword [edi + 4]
push 0x20
push eax
call fcn.006d8cf0
add esp, 0xc
mov dword [edi + 0x10], 0
mov dword [edi], 0
lea eax, [ebx + 1]
mov dword [edi + 0x114], eax
cmp ebx, 0xf
je 0x476b6f
mov eax, 4
cmp ebx, 0x10
jne 0x476b74
mov eax, 5
push 0x10
mov dword [edi + 0x118], eax
lea eax, [edi + 0x30]
push 0x1fe
push eax
mov dword [edi + 0x11c], 0x13
mov dword [edi + 0x120], 5
mov dword [edi + 0x20], 0
mov dword [edi + 0x24], 0
mov dword [edi + 0x28], 0
call fcn.00478990
add esp, 0xc
test eax, eax
jne 0x476c38
push 0x10
lea eax, [edi + 0xa0]
mov dword [edi + 0x38], 9
push 0x13
push eax
call fcn.00478990
add esp, 0xc
test eax, eax
jne 0x476c38
mov dword [edi + 0x12c], eax
mov byte [esi + 0xcf], 1
mov dword [esi + 0x12c], eax
mov dword [esi + 0x130], eax
mov dword [esi + 0x134], eax
lea eax, [esp + 0x10]
push eax
push 1
push ebp
lea edi, [esi + 0x118]
call fcn.00463260
mov dword [edi], eax
add esp, 0xc
mov ecx, dword [esp + 0x10]
test ecx, ecx
jg 0x476cac
push str.Truncated_LHa_file_body
push 0x2a
push ebp
call fcn.004649c0
add esp, 0xc
mov eax, 0xffffffe2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push str.Couldnt_allocate_memory_for_lzh_decompression
push 0xc
push ebp
call fcn.004649c0
add esp, 0xc
mov eax, 0xffffffe2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x24]
mov dword [eax], 0
mov eax, dword [esp + 0x28]
mov dword [eax], 0
mov eax, dword [esp + 0x2c]
mov dword [eax], 0
mov dword [eax + 4], 0
movsx eax, byte [esi + 0x23]
push eax
movsx eax, byte [esi + 0x22]
push eax
movsx eax, byte [esi + 0x21]
push eax
push str.Unsupported_lzh_compression_method___c_c_c_
push 0x2a
push ebp
call fcn.004649c0
push ebp
call fcn.00475ca0
add esp, 0x1c
mov eax, 0xffffffec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ebx, dword [esi + 8]
mov eax, ecx
cdq
cmp edx, dword [esi + 0xc]
jl 0x476cc3
jg 0x476cbd
cmp eax, ebx
jbe 0x476cc3
mov ecx, ebx
mov dword [esp + 0x10], ecx
mov dword [esi + 0x11c], ecx
mov dword [esi + 0x120], 0
mov dword [esi + 0x124], 0
mov dword [esi + 0x12c], 0
mov eax, dword [esp + 0x10]
cdq
cmp eax, dword [esi + 8]
jne 0x476cfd
cmp edx, dword [esi + 0xc]
jne 0x476cfd
mov ebx, 1
jmp 0x476cff
xor ebx, ebx
mov ecx, dword [edi + 0x20]
mov dword [esp + 0x14], ecx
mov ecx, dword [ecx + 0x12c]
test ecx, ecx
jne 0x476d50
mov eax, dword [edi + 4]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x18], eax
nop dword [eax + eax]
cmp dword [ebp], 9
push ebx
push edi
jge 0x476d2f
call fcn.00478ec0
jmp 0x476d34
call fcn.004783c0
mov ecx, eax
add esp, 8
cmp ecx, 0x64
je 0x476d20
mov eax, dword [esp + 0x18]
sub eax, dword [edi + 4]
mov ebp, dword [esp + 0x20]
cdq
add dword [edi + 8], eax
adc dword [edi + 0xc], edx
sub ecx, 0
je 0x476d7e
sub ecx, 1
je 0x476d77
push str.Bad_lzh_data
push 0xffffffffffffffff
push ebp
call fcn.004649c0
add esp, 0xc
mov eax, 0xffffffe7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov byte [esi + 0xd0], 1
mov eax, dword [esi + 0x120]
sub dword [esi + 8], eax
mov edx, dword [esi + 0x124]
mov edi, dword [esi + 0x12c]
mov ecx, dword [esi]
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0xc]
sbb eax, edx
mov dword [esi + 0x14], edx
mov edx, dword [esi + 4]
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x2c]
mov dword [eax], ecx
mov dword [eax + 4], edx
test edi, edi
je 0x476f06
mov ebp, dword [esp + 0x28]
mov eax, dword [esi + 0x12c]
mov dword [ebp], eax
mov eax, dword [esp + 0x24]
mov edx, dword [esi + 0x128]
mov dword [eax], edx
mov edi, dword [ebp]
movzx ecx, word [esi + 0x18]
mov dword [esp + 0x20], ecx
test edi, edi
je 0x476eea
test dl, 1
je 0x476e05
movzx eax, byte [edx]
inc edx
xor eax, ecx
shr cx, 8
movzx eax, al
xor cx, word [eax*2 + 0x7c4a00]
dec edi
movzx ecx, cx
mov dword [esp + 0x20], ecx
cmp edi, 8
jb 0x476ebe
mov ebx, edi
shr ebx, 3
mov ax, word [esp + 0x20]
sub edi, 8
xor ax, word [edx]
movzx eax, ax
mov ecx, eax
movzx eax, al
shr ecx, 8
movzx ecx, word [ecx*2 + 0x7c4a00]
xor cx, word [eax*2 + 0x7c4c00]
movzx eax, cx
mov dword [esp + 0x20], eax
xor ax, word [edx + 2]
movzx eax, ax
mov ecx, eax
movzx eax, al
shr ecx, 8
movzx ecx, word [ecx*2 + 0x7c4a00]
xor cx, word [eax*2 + 0x7c4c00]
movzx eax, cx
mov dword [esp + 0x20], eax
xor ax, word [edx + 4]
movzx eax, ax
mov ecx, eax
movzx eax, al
shr ecx, 8
movzx ecx, word [ecx*2 + 0x7c4a00]
xor cx, word [eax*2 + 0x7c4c00]
movzx eax, cx
mov dword [esp + 0x20], eax
xor ax, word [edx + 6]
add edx, 8
movzx eax, ax
mov ecx, eax
movzx eax, al
shr ecx, 8
movzx ecx, word [ecx*2 + 0x7c4a00]
xor cx, word [eax*2 + 0x7c4c00]
movzx ecx, cx
mov dword [esp + 0x20], ecx
sub ebx, 1
jne 0x476e13
test edi, edi
je 0x476eea
movzx eax, byte [edx]
lea edx, [edx + 1]
xor eax, ecx
mov cx, word [esp + 0x20]
movzx eax, al
shr cx, 8
xor cx, word [eax*2 + 0x7c4a00]
movzx ecx, cx
mov dword [esp + 0x20], ecx
sub edi, 1
jne 0x476ec2
mov ax, word [esp + 0x20]
mov word [esi + 0x18], ax
mov eax, dword [ebp]
add dword [esi], eax
adc dword [esi + 4], 0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x28]
mov dword [eax], 0
mov eax, dword [esp + 0x24]
mov dword [eax], 0
cmp byte [esi + 0xd0], 0
je 0x476efc
push ebp
call fcn.00476a10
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret